aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dashboard/lib
diff options
context:
space:
mode:
authorJulien Veyssier <eneiluj@posteo.net>2020-10-20 12:36:41 +0200
committernpmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>2020-11-13 06:51:26 +0000
commitf5ef2d7d5897bb490f2a10792760f809a68e4c00 (patch)
tree04dcf6c646b10405a799e6d793137052fd848e02 /apps/dashboard/lib
parent35be4fdb019da658a824f41dc4bf0f415c032cb8 (diff)
downloadnextcloud-server-f5ef2d7d5897bb490f2a10792760f809a68e4c00.tar.gz
nextcloud-server-f5ef2d7d5897bb490f2a10792760f809a68e4c00.zip
override default dashboard background with theming one
fix getAppValue default value in theming app fix cacheBuster value injection Signed-off-by: Julien Veyssier <eneiluj@posteo.net> Signed-off-by: npmbuildbot-nextcloud[bot] <npmbuildbot-nextcloud[bot]@users.noreply.github.com>
Diffstat (limited to 'apps/dashboard/lib')
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 57717b26698..bc6cd02abbc 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -35,6 +35,7 @@ use OCP\AppFramework\Http\FileDisplayResponse;
use OCP\AppFramework\Http\JSONResponse;
use OCP\AppFramework\Http\NotFoundResponse;
use OCP\AppFramework\Http\TemplateResponse;
+use OCP\App\IAppManager;
use OCP\Dashboard\IManager;
use OCP\Dashboard\IWidget;
use OCP\Dashboard\RegisterWidgetEvent;
@@ -49,6 +50,8 @@ class DashboardController extends Controller {
private $inititalStateService;
/** @var IEventDispatcher */
private $eventDispatcher;
+ /** @var IAppManager */
+ private $appManager;
/** @var IManager */
private $dashboardManager;
/** @var IConfig */
@@ -65,6 +68,7 @@ class DashboardController extends Controller {
IRequest $request,
IInitialStateService $initialStateService,
IEventDispatcher $eventDispatcher,
+ IAppManager $appManager,
IManager $dashboardManager,
IConfig $config,
BackgroundService $backgroundService,
@@ -74,6 +78,7 @@ class DashboardController extends Controller {
$this->inititalStateService = $initialStateService;
$this->eventDispatcher = $eventDispatcher;
+ $this->appManager = $appManager;
$this->dashboardManager = $dashboardManager;
$this->config = $config;
$this->backgroundService = $backgroundService;
@@ -109,6 +114,11 @@ class DashboardController extends Controller {
// It does not matter if some statuses are missing from the array, missing ones are considered enabled
$statuses = ($statuses && count($statuses) > 0) ? $statuses : ['weather' => true];
+ // if theming app is enabled and wants to override default, we pass it
+ $themingDefaultBackground = $this->appManager->isEnabledForUser('theming')
+ ? $this->config->getAppValue('theming', 'backgroundMime', '')
+ : '';
+ $this->inititalStateService->provideInitialState('dashboard', 'themingDefaultBackground', $themingDefaultBackground);
$this->inititalStateService->provideInitialState('dashboard', 'panels', $widgets);
$this->inititalStateService->provideInitialState('dashboard', 'statuses', $statuses);
$this->inititalStateService->provideInitialState('dashboard', 'layout', $userLayout);