diff options
author | Simon Rettberg | 2016-06-14 11:21:29 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-06-14 11:21:29 +0200 |
commit | 91bfa07f909101a42476accff50981d649e725d2 (patch) | |
tree | da8fd8df10fe0376a1b746fe27931279f8d1f778 /inc | |
parent | [install-all] cmdline script to install/update database (diff) | |
download | slx-admin-91bfa07f909101a42476accff50981d649e725d2.tar.gz slx-admin-91bfa07f909101a42476accff50981d649e725d2.tar.xz slx-admin-91bfa07f909101a42476accff50981d649e725d2.zip |
[dashboard] Add submenu feature
Diffstat (limited to 'inc')
-rw-r--r-- | inc/dashboard.inc.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/inc/dashboard.inc.php b/inc/dashboard.inc.php index ddea6166..3c913b76 100644 --- a/inc/dashboard.inc.php +++ b/inc/dashboard.inc.php @@ -4,6 +4,7 @@ class Dashboard { private static $iconCache = array(); + private static $subMenu = array(); public static function createMenu() { @@ -16,6 +17,7 @@ class Dashboard continue; $modByCategory[$cat][] = $module; } + $currentPage = Page::getModule()->getIdentifier(); $categories = array(); $catSort = array(); foreach ($modByCategory as $catId => $modList) { @@ -23,11 +25,15 @@ class Dashboard $sectionSort = array(); foreach ($modList as $module) { $modId = $module->getIdentifier(); - $modules[] = array( + $newEntry = array( 'displayName' => $module->getDisplayName(), - 'identifier' => $module->getIdentifier(), - 'className' => ($module->getIdentifier() === Page::getModule()->getIdentifier()) ? 'active' : '' + 'identifier' => $module->getIdentifier() ); + if ($module->getIdentifier() === $currentPage) { + $newEntry['className'] = 'active'; + $newEntry['subMenu'] = self::$subMenu; + } + $modules[] = $newEntry; if (isset($MENU_SETTING_SORT_ORDER[$modId])) { $sectionSort[] = (string)($MENU_SETTING_SORT_ORDER[$modId] + 1000); } else { @@ -82,5 +88,10 @@ class Dashboard } return 'glyphicon glyphicon-' . self::$iconCache[$module][$icon]; } + + public static function addSubmenu($url, $name) + { + self::$subMenu[] = array('url' => $url, 'name' => $name); + } }
\ No newline at end of file |