summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/app.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-01-29 10:07:12 +0100
committerJulius Härtl <jus@bitgrid.net>2018-02-12 17:22:32 +0100
commit864474b85850d8f6bc11bbd99c5e09111bd9a458 (patch)
tree5625c414eb3fb2977aca67dade374a5e626a2a81 /lib/private/legacy/app.php
parent4bd14ef3081fadce717e6b50d31fbb750962cabf (diff)
downloadnextcloud-server-864474b85850d8f6bc11bbd99c5e09111bd9a458.tar.gz
nextcloud-server-864474b85850d8f6bc11bbd99c5e09111bd9a458.zip
Move navigation processing to the NavigationManager
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r--lib/private/legacy/app.php31
1 files changed, 2 insertions, 29 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index b19d63f560e..6102de73693 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -443,31 +443,6 @@ class OC_App {
$appManager->disableApp($app);
}
- // This is private as well. It simply works, so don't ask for more details
- private static function proceedNavigation($list) {
- usort($list, function($a, $b) {
- if (isset($a['order']) && isset($b['order'])) {
- return ($a['order'] < $b['order']) ? -1 : 1;
- } else if (isset($a['order']) || isset($b['order'])) {
- return isset($a['order']) ? -1 : 1;
- } else {
- return ($a['name'] < $b['name']) ? -1 : 1;
- }
- });
-
- $activeApp = OC::$server->getNavigationManager()->getActiveEntry();
- foreach ($list as $index => &$navEntry) {
- if ($navEntry['id'] == $activeApp) {
- $navEntry['active'] = true;
- } else {
- $navEntry['active'] = false;
- }
- }
- unset($navEntry);
-
- return $list;
- }
-
/**
* Get the path where to install apps
*
@@ -618,8 +593,7 @@ class OC_App {
* - active: boolean, signals if the user is on this navigation entry
*/
public static function getNavigation() {
- $entries = OC::$server->getNavigationManager()->getAll();
- return self::proceedNavigation($entries);
+ return OC::$server->getNavigationManager()->getAll();
}
/**
@@ -631,8 +605,7 @@ class OC_App {
* entries are sorted by the key 'order' ascending.
*/
public static function getSettingsNavigation() {
- $entries = OC::$server->getNavigationManager()->getAll('settings');
- return self::proceedNavigation($entries);
+ return OC::$server->getNavigationManager()->getAll('settings');
}
/**