From 9b73975ceb68ec7d91d3a20ba618b2b192d2dc35 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Jul 2016 11:13:33 +0200 Subject: Change menu overriding mechanism; simpler, now also supports changing the category of a module --- inc/module.inc.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'inc/module.inc.php') 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; } -- cgit v1.2.3-55-g7522