Code

Added sorting in Profile dialog
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 06:45:40 +0000 (06:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 9 Sep 2005 06:45:40 +0000 (06:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1337 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/FAI/class_faiProfile.inc
plugins/admin/FAI/class_faiProfileEntry.inc

index 9b720fbf94aba2e6fa35dbac14c897e6644a5395..ab637d22b15f45b569b4cad3b1407c1c31984f1a 100644 (file)
@@ -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;
     }
index 609eb982101fb1cb9d90b81f5631acdcaa6bde01..b38614e3b19389a00b23c6b0b10415c273c0a2c4 100644 (file)
@@ -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" => "*");