diff options
| author | Christian Klinger | 2016-07-13 12:41:27 +0200 |
|---|---|---|
| committer | Christian Klinger | 2016-07-13 12:41:27 +0200 |
| commit | 6cd6f0db49d15a455b92e038aa219c375cd0a1be (patch) | |
| tree | 111bbb90404a72656e901c16a447ea0665457b77 /inc/module.inc.php | |
| parent | Squashed commit of the following: (diff) | |
| parent | [util] Made traceError output prettier by using HTML (diff) | |
| download | slx-admin-6cd6f0db49d15a455b92e038aa219c375cd0a1be.tar.gz slx-admin-6cd6f0db49d15a455b92e038aa219c375cd0a1be.tar.xz slx-admin-6cd6f0db49d15a455b92e038aa219c375cd0a1be.zip | |
Merge branch 'modularization' of git.openslx.org:openslx-ng/slx-admin into modularization
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; } |
