From b29e0e5d8f51376c2407fc2dc577d43ada8a066b Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 9 Sep 2005 06:45:40 +0000 Subject: [PATCH] Added sorting in Profile dialog git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1337 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/FAI/class_faiProfile.inc | 17 ++++++++++++++--- plugins/admin/FAI/class_faiProfileEntry.inc | 11 +++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/plugins/admin/FAI/class_faiProfile.inc b/plugins/admin/FAI/class_faiProfile.inc index 9b720fbf9..ab637d22b 100644 --- a/plugins/admin/FAI/class_faiProfile.inc +++ b/plugins/admin/FAI/class_faiProfile.inc @@ -43,9 +43,13 @@ class faiProfile extends plugin $this->FAIclasses[trim($class)] = trim($class); } } - + natcasesort($this->FAIclasses); + reset($this->FAIclasses) ; + $categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTAble","FAIpackage"); - + + $sort = array(); + $base = $_SESSION['faifilter']['base']; $ldap->cd($base); $ldap->search("(objectClass=*)",array("*")); @@ -53,10 +57,17 @@ class faiProfile extends plugin foreach($categories as $cat){ if(in_array($cat,$attrs['objectClass'])){ $this->FAIAllclasses[$attrs['cn'][0]][$cat]=$attrs; + $sort[strtolower($attrs['cn'][0])] = $attrs['cn'][0]; } } } - + ksort($sort); + foreach($sort as $name){ + $tmp[$name] =$this->FAIAllclasses[$name]; + } + $this->FAIAllclasses = array(); + $this->FAIAllclasses = $tmp; + if($dn != "new"){ $this->dn =$dn; } diff --git a/plugins/admin/FAI/class_faiProfileEntry.inc b/plugins/admin/FAI/class_faiProfileEntry.inc index 609eb9821..b38614e3b 100644 --- a/plugins/admin/FAI/class_faiProfileEntry.inc +++ b/plugins/admin/FAI/class_faiProfileEntry.inc @@ -42,10 +42,21 @@ class faiProfileEntry extends plugin /* Set selected status to false */ $this->FAIAllclasses[$attrs['cn'][0]]['status']=false; + + $sort[strtolower($attrs['cn'][0])] = $attrs['cn'][0]; } } } } + + ksort($sort); + foreach($sort as $name){ + $tmp[$name] =$this->FAIAllclasses[$name]; + } + $this->FAIAllclasses = array(); + $this->FAIAllclasses = $tmp; + + /* If no search filter is set, create one */ if (!is_global("SUBfaifilter")){ $SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$base, "Sregex" => "*"); -- 2.30.2