diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-02-15 16:55:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-15 16:55:12 +0100 |
commit | 14bc9b171427c1512226d5ea402021d8b44ac690 (patch) | |
tree | 1a4b9c64f711becf429f90da69d3d46279c55435 /lib/private/legacy/app.php | |
parent | 8a505e8767fe7af62a4e9e8d95ef2e336b05bf61 (diff) | |
parent | e694b30a4f1e1cce6cbca0fcbbfeceee8a16c8f6 (diff) | |
download | nextcloud-server-14bc9b171427c1512226d5ea402021d8b44ac690.tar.gz nextcloud-server-14bc9b171427c1512226d5ea402021d8b44ac690.zip |
Merge pull request #8095 from nextcloud/webapps-capabilities
Expose navigation entries as API endpoint
Diffstat (limited to 'lib/private/legacy/app.php')
-rw-r--r-- | lib/private/legacy/app.php | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 9384582bac3..f97b74ed24f 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -445,31 +445,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 * @@ -613,6 +588,7 @@ class OC_App { * Returns the navigation * * @return array + * @deprecated 14.0.0 use \OC::$server->getNavigationManager()->getAll() * * This function returns an array containing all entries added. The * entries are sorted by the key 'order' ascending. Additional to the keys @@ -620,21 +596,20 @@ 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(); } /** * Returns the Settings Navigation * * @return string[] + * @deprecated 14.0.0 use \OC::$server->getNavigationManager()->getAll('settings') * * This function returns an array containing all settings pages added. The * 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'); } /** |