From 7548825743bd2f7a65105b224c4eabe325c893b5 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 28 Mar 2017 15:04:56 +0200 Subject: Responsive app menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/legacy/app.php | 68 ---------------------------------------------- 1 file changed, 68 deletions(-) (limited to 'lib/private/legacy/app.php') diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index e6b811aa845..3800b8b770e 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -468,69 +468,16 @@ class OC_App { } }); - $activeAppIndex = -1; $activeApp = OC::$server->getNavigationManager()->getActiveEntry(); foreach ($list as $index => &$navEntry) { - $navEntry['showInHeader'] = true; if ($navEntry['id'] == $activeApp) { $navEntry['active'] = true; - $activeAppIndex = $index; } else { $navEntry['active'] = false; } } unset($navEntry); - if (count($list) <= 8) { - return $list; - } - - $headerIconCount = 7; - if($activeAppIndex > ($headerIconCount-1)) { - $active = $list[$activeAppIndex]; - $lastInHeader = $list[$headerIconCount-1]; - $list[$headerIconCount-1] = $active; - $list[$activeAppIndex] = $lastInHeader; - } - - foreach ($list as $index => &$navEntry) { - if($index >= $headerIconCount) { - $navEntry['showInHeader'] = false; - } - } - - return $list; - } - - public static function proceedAppNavigation($entries) { - $activeAppIndex = -1; - $list = self::proceedNavigation($entries); - - $activeApp = OC::$server->getNavigationManager()->getActiveEntry(); - foreach ($list as $index => &$navEntry) { - if ($navEntry['id'] == $activeApp) { - $navEntry['active'] = true; - $activeAppIndex = $index; - } else { - $navEntry['active'] = false; - } - } - - - if (count($list) <= 8) { - return $list; - } - - $headerIconCount = 7; - // move active item to last position - if($activeAppIndex > ($headerIconCount-1)) { - $active = $list[$activeAppIndex]; - $lastInHeader = $list[$headerIconCount-1]; - $list[$headerIconCount-1] = $active; - $list[$activeAppIndex] = $lastInHeader; - } - $list = array_slice($list, 0, $headerIconCount); - return $list; } @@ -722,21 +669,6 @@ class OC_App { return self::proceedNavigation($entries); } - /** - * Returns the navigation inside the header bar - * - * @return array - * - * This function returns an array containing all entries added. The - * entries are sorted by the key 'order' ascending. Additional to the keys - * given for each app the following keys exist: - * - active: boolean, signals if the user is on this navigation entry - */ - public static function getHeaderNavigation() { - $entries = OC::$server->getNavigationManager()->getAll(); - return self::proceedAppNavigation($entries); - } - /** * Returns the Settings Navigation * -- cgit v1.2.3