From 1287d14f21be42feefba5ecd5c75e08bd17fbefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Wed, 15 Jan 2020 10:27:49 +0100 Subject: fix map link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl --- lib/Controller/PageController.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index fe09175e..b4b0e99a 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -34,6 +34,7 @@ use OCP\IInitialStateService; use OCP\IRequest; use OCP\Util; use OCP\IConfig; +use OCP\App\IAppManager; class PageController extends Controller { @@ -45,7 +46,11 @@ class PageController extends Controller { /** @var IInitialStateService */ private $initialStateService; + /** @var IAppManager */ + private $appManager; + public function __construct($appName, + IAppManager $appManager, IRequest $request, IEventDispatcher $eventDispatcher, IConfig $config, @@ -53,6 +58,7 @@ class PageController extends Controller { parent::__construct($appName, $request); $this->appName = $appName; + $this->appManager = $appManager; $this->eventDispatcher = $eventDispatcher; $this->initialStateService = $initialStateService; $this->config = $config; @@ -71,8 +77,7 @@ class PageController extends Controller { $this->eventDispatcher->dispatch(LoadViewer::class, new LoadViewer()); $this->initialStateService->provideInitialState($this->appName, 'mimes', Application::MIMES); - $this->initialStateService->provideInitialState($this->appName, 'maps', $this->config->getAppValue('maps', 'enabled', 'no') === 'yes'); - + $this->initialStateService->provideInitialState($this->appName, 'maps', $this->appManager->isEnabledForUser('maps') === true); Util::addScript($this->appName, 'photos'); Util::addStyle($this->appName, 'icons'); -- cgit v1.2.3