diff options
author | Udo Walter | 2017-04-07 15:49:54 +0200 |
---|---|---|
committer | Udo Walter | 2017-04-07 15:49:54 +0200 |
commit | d033483d3ed9e05f1109a3713ec6a3df883a1dae (patch) | |
tree | 13df2276d6c137901d87ea5daf23464e5c7bb869 /modules-available/permissionmanager/inc/permissionutil.inc.php | |
parent | [permission-manager] added possibility to select all permissions (diff) | |
download | slx-admin-d033483d3ed9e05f1109a3713ec6a3df883a1dae.tar.gz slx-admin-d033483d3ed9e05f1109a3713ec6a3df883a1dae.tar.xz slx-admin-d033483d3ed9e05f1109a3713ec6a3df883a1dae.zip |
[permission-manager] renamed some files, moved html generation to templates,
using bind variables in mysql code, changed order of modules in role editor
Diffstat (limited to 'modules-available/permissionmanager/inc/permissionutil.inc.php')
-rw-r--r-- | modules-available/permissionmanager/inc/permissionutil.inc.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules-available/permissionmanager/inc/permissionutil.inc.php b/modules-available/permissionmanager/inc/permissionutil.inc.php index 10f2a61a..d6adf2bf 100644 --- a/modules-available/permissionmanager/inc/permissionutil.inc.php +++ b/modules-available/permissionmanager/inc/permissionutil.inc.php @@ -16,10 +16,18 @@ class PermissionUtil $permissions = self::putInPermissionTree($out[1].".".$k, $v, $permissions); } } + ksort($permissions); + global $MENU_CAT_OVERRIDE; + $sortingOrder = $MENU_CAT_OVERRIDE; + foreach ($permissions as $module => $v) $sortingOrder[Module::get($module)->getCategory()][] = $module; + $permissions = array_replace(array_flip(call_user_func_array('array_merge', $sortingOrder)), $permissions); + foreach ($permissions as $module => $v) if (is_int($v)) unset($permissions[$module]); + + return $permissions; } - private function putInPermissionTree($permission, $description, $tree) + private static function putInPermissionTree($permission, $description, $tree) { $subPermissions = explode('.', $permission); $original =& $tree; |