From 1c245a85b4c017b41ddca0bc434585c067fa96b3 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Sep 2006 03:54:18 +0000 Subject: [PATCH] Added function that sorts the list of given classes by priority. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4786 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_acl.inc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/include/class_acl.inc b/include/class_acl.inc index 7bd9ba33f..dec421bec 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -473,7 +473,28 @@ class acl extends plugin return ($smarty->fetch (get_template_path('acl.tpl'))); } - + function sort_by_priority($list) + { + $tmp= get_global('plist'); + $plist= $tmp->info; + asort($plist); + + foreach($list as $name => $translation){ + $na = preg_replace("/^.*\//","",$name); + $prio= $plist[$na]['plPriority'] ; + + $newSort[$name] = $prio; + } + + asort($newSort); + + $ret = array(); + foreach($newSort as $name => $prio){ + $ret[$name] = $list[$name]; + } + return($ret); + } + function buildAclSelector($list) { $display= ""; @@ -483,6 +504,8 @@ class acl extends plugin asort($plist); /* Build general objects */ + + $list =$this->sort_by_priority($list); foreach ($list as $key => $name){ /* Create sub acl if it does not exist */ -- 2.30.2