diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-02-18 09:12:11 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2019-02-18 09:12:11 +0100 |
commit | a6b579b772a9966984d46daad82e46ac2905a343 (patch) | |
tree | 7f5bbe5f171de80614837617115718ddba3a0a35 /apps/theming/lib | |
parent | 1edfffd091ed416d99925d9dc660920560c457fa (diff) | |
download | nextcloud-server-a6b579b772a9966984d46daad82e46ac2905a343.tar.gz nextcloud-server-a6b579b772a9966984d46daad82e46ac2905a343.zip |
Add guest navigation type
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index 53198fe2b81..2305f570888 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -39,6 +39,7 @@ use OCP\Files\NotFoundException; use OCP\ICacheFactory; use OCP\IConfig; use OCP\IL10N; +use OCP\INavigationManager; use OCP\IURLGenerator; class ThemingDefaults extends \OC_Defaults { @@ -57,6 +58,9 @@ class ThemingDefaults extends \OC_Defaults { private $util; /** @var IAppManager */ private $appManager; + /** @var INavigationManager */ + private $navigationManager; + /** @var string */ private $name; /** @var string */ @@ -94,7 +98,8 @@ class ThemingDefaults extends \OC_Defaults { ICacheFactory $cacheFactory, Util $util, ImageManager $imageManager, - IAppManager $appManager + IAppManager $appManager, + INavigationManager $navigationManager ) { parent::__construct(); $this->config = $config; @@ -104,6 +109,7 @@ class ThemingDefaults extends \OC_Defaults { $this->cacheFactory = $cacheFactory; $this->util = $util; $this->appManager = $appManager; + $this->navigationManager = $navigationManager; $this->name = parent::getName(); $this->title = parent::getTitle(); @@ -170,6 +176,15 @@ class ThemingDefaults extends \OC_Defaults { ], ]; + $navigation = $this->navigationManager->getAll(INavigationManager::TYPE_GUEST); + $guestNavigation = array_map(function($nav) { + return [ + 'text' => $nav['name'], + 'url' => $nav['href'] + ]; + }, $navigation); + $links = array_merge($links, $guestNavigation); + $legalLinks = ''; $divider = ''; foreach($links as $link) { if($link['url'] !== '' |