diff options
author | Simon Rettberg | 2016-07-07 11:13:33 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-07-07 11:13:33 +0200 |
commit | 9b73975ceb68ec7d91d3a20ba618b2b192d2dc35 (patch) | |
tree | c9ed58d6e005c0638cffdbe48a8bedab090ec65d /inc/module.inc.php | |
parent | [exams] Add button to zoom to selected exam period; autofill end day; show de... (diff) | |
download | slx-admin-9b73975ceb68ec7d91d3a20ba618b2b192d2dc35.tar.gz slx-admin-9b73975ceb68ec7d91d3a20ba618b2b192d2dc35.tar.xz slx-admin-9b73975ceb68ec7d91d3a20ba618b2b192d2dc35.zip |
Change menu overriding mechanism; simpler, now also supports changing the category of a module
Diffstat (limited to 'inc/module.inc.php')
-rw-r--r-- | inc/module.inc.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/inc/module.inc.php b/inc/module.inc.php index a7a767ef..960a0a87 100644 --- a/inc/module.inc.php +++ b/inc/module.inc.php @@ -68,12 +68,20 @@ class Module /** * @return \Module[] List of valid, enabled modules */ - public static function getEnabled() + public static function getEnabled($sortById = false) { $ret = array(); + $sort = array(); foreach (self::$modules as $module) { - if (self::resolveDeps($module)) + if (self::resolveDeps($module)) { $ret[] = $module; + } + if ($sortById) { + $sort[] = $module->name; + } + } + if ($sortById) { + array_multisort($sort, SORT_ASC, $ret); } return $ret; } |