summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-26 15:48:19 -0600
committerGitHub <noreply@github.com>2017-03-26 15:48:19 -0600
commit12c5c336ad8fdc5d47cb663f0c3c43744dfe5309 (patch)
treea5286ba7186d02b619cc7b4d9e5d58b145227130 /apps
parent96d4e1cab5ebf030832bbd052d8f4705b9b726d2 (diff)
parent8d3c461151ad9515772609059063f5bdf5a32bf3 (diff)
downloadnextcloud-server-12c5c336ad8fdc5d47cb663f0c3c43744dfe5309.tar.gz
nextcloud-server-12c5c336ad8fdc5d47cb663f0c3c43744dfe5309.zip
Merge pull request #4077 from nextcloud/better-navigation-management
Register the app management in the normal way
Diffstat (limited to 'apps')
-rw-r--r--apps/files/appinfo/info.xml12
-rw-r--r--apps/files/lib/App.php10
-rw-r--r--apps/files/tests/Controller/ViewControllerTest.php10
3 files changed, 25 insertions, 7 deletions
diff --git a/apps/files/appinfo/info.xml b/apps/files/appinfo/info.xml
index 8b5678b331a..c49ec7aa407 100644
--- a/apps/files/appinfo/info.xml
+++ b/apps/files/appinfo/info.xml
@@ -55,10 +55,12 @@
<command>OCA\Files\Command\ScanAppData</command>
</commands>
- <navigation>
- <name>Files</name>
- <route>files.view.index</route>
- <order>0</order>
- </navigation>
+ <navigations>
+ <navigation>
+ <name>Files</name>
+ <route>files.view.index</route>
+ <order>0</order>
+ </navigation>
+ </navigations>
</info>
diff --git a/apps/files/lib/App.php b/apps/files/lib/App.php
index add27a2d2df..34d3ab4384c 100644
--- a/apps/files/lib/App.php
+++ b/apps/files/lib/App.php
@@ -40,7 +40,15 @@ class App {
public static function getNavigationManager() {
// TODO: move this into a service in the Application class
if (self::$navigationManager === null) {
- self::$navigationManager = new \OC\NavigationManager();
+ self::$navigationManager = new \OC\NavigationManager(
+ \OC::$server->getAppManager(),
+ \OC::$server->getURLGenerator(),
+ \OC::$server->getL10NFactory(),
+ \OC::$server->getUserSession(),
+ \OC::$server->getGroupManager(),
+ \OC::$server->getConfig()
+ );
+ self::$navigationManager->clear(false);
}
return self::$navigationManager;
}
diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php
index 1d8c2956551..2e497405a4d 100644
--- a/apps/files/tests/Controller/ViewControllerTest.php
+++ b/apps/files/tests/Controller/ViewControllerTest.php
@@ -134,6 +134,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files')->t('All files'),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'recent',
@@ -143,6 +144,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files')->t('Recent'),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'favorites',
@@ -152,6 +154,7 @@ class ViewControllerTest extends TestCase {
'name' => null,
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'sharingin',
@@ -161,6 +164,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared with you'),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'sharingout',
@@ -170,6 +174,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared with others'),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'sharinglinks',
@@ -179,6 +184,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared by link', []),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'systemtagsfilter',
@@ -188,6 +194,7 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('systemtags')->t('Tags'),
'active' => false,
'icon' => '',
+ 'type' => 'link',
],
[
'id' => 'trashbin',
@@ -197,7 +204,8 @@ class ViewControllerTest extends TestCase {
'name' => \OC::$server->getL10N('files_trashbin')->t('Deleted files'),
'active' => false,
'icon' => '',
- ],
+ 'type' => 'link',
+ ],
]);
$expected = new Http\TemplateResponse(