Code

Added casesensitive sorting to scripts/templates/hooks/vars
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jan 2006 07:21:11 +0000 (07:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jan 2006 07:21:11 +0000 (07:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2439 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiHook.inc
plugins/admin/fai/class_faiScript.inc
plugins/admin/fai/class_faiTemplate.inc
plugins/admin/fai/class_faiVariable.inc

index 1d23d113ca791d9332c961de78c48175d63185a4..bfea1e7b21f75758de1554684b8dca810eb8c34d 100644 (file)
@@ -74,7 +74,6 @@ class faiHook extends plugin
         }
         $this->SubObjects[$object['cn'][0]]['FAIscript']   = addslashes($this->readBinary("FAIscript",$object['dn']));
       }
-      ksort($this->SubObjects);
     }
   }
 
@@ -163,10 +162,20 @@ class faiHook extends plugin
         $this->is_dialog=false;
         unset($this->dialog);
         $this->dialog=NULL;
-        ksort($this->SubObjects);
       }
     }
 
+    /* Sort entries */
+    $tmp = $keys = array();
+    foreach($this->SubObjects as $key => $entry){
+      $keys[$key]=$key;
+    }
+    natcasesort($keys);
+    foreach($keys as $key){
+      $tmp[$key]=$this->SubObjects[$key];
+    }
+    $this->SubObjects = $tmp;
+
     /* Cancel Dialog */
     if(isset($_POST['CancelSubObject'])){
       $this->is_dialog=false; 
index bd2ebf893b2aef9c60421eac6f799f9d3a808ab1..50e5349ad35f29dd70001030d775ff04f7bb01c9 100644 (file)
@@ -76,7 +76,6 @@ class faiScript extends plugin
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
-      ksort($this->SubObjects);
     }
   }
 
@@ -142,9 +141,19 @@ class faiScript extends plugin
         unset($this->dialog);
         $this->dialog=NULL;
       }
-    ksort($this->SubObjects);
     }
 
+    /* Sort entries */
+    $tmp = $keys = array();
+    foreach($this->SubObjects as $key => $entry){
+      $keys[$key]=$key;
+    }
+    natcasesort($keys);
+    foreach($keys as $key){
+      $tmp[$key]=$this->SubObjects[$key];
+    }
+    $this->SubObjects = $tmp;
+
     /* Cancel Dialog */
     if(isset($_POST['CancelSubObject'])){
       $this->is_dialog=false; 
index 94837291c76489072db48533bcd38f4357165152..a4017ea8c7e35ac171b88adc47363466a694a929 100644 (file)
@@ -72,7 +72,6 @@ class faiTemplate extends plugin
         $this->SubObjects[$object['cn'][0]]['status']= "edited";
         $this->SubObjects[$object['cn'][0]]['dn']= $object['dn'];
       }
-      ksort($this->SubObjects);
     }
   }
 
@@ -137,10 +136,20 @@ class faiTemplate extends plugin
         $this->is_dialog=false;
         unset($this->dialog);
         $this->dialog=NULL;
-        ksort($this->SubObjects);
       }
     }
 
+    /* Sort entries */
+    $tmp = $keys = array();
+    foreach($this->SubObjects as $key => $entry){
+      $keys[$key]=$key;
+    }
+    natcasesort($keys);
+    foreach($keys as $key){
+      $tmp[$key]=$this->SubObjects[$key];
+    }
+    $this->SubObjects = $tmp;
+
     /* Cancel Dialog */
     if(isset($_POST['CancelSubObject'])){
       $this->is_dialog=false; 
index fdf650198cee305ddb4104f1f881e474eebeafa6..87aab8e730d490d1bb2cba3cbf8f53a0c3176116 100644 (file)
@@ -70,7 +70,6 @@ class faiVariable extends plugin
         $this->SubObjects[$object['cn'][0]]['status']      = "edited";
         $this->SubObjects[$object['cn'][0]]['dn']          = $object['dn'];
       }
-      ksort($this->SubObjects);
     }
   }
 
@@ -135,10 +134,20 @@ class faiVariable extends plugin
         $this->is_dialog=false;
         unset($this->dialog);
         $this->dialog=NULL;
-        ksort($this->SubObjects);
       }
     }
 
+    /* Sort entries */
+    $tmp = $keys = array();
+    foreach($this->SubObjects as $key => $entry){
+      $keys[$key]=$key;
+    }
+    natcasesort($keys);
+    foreach($keys as $key){
+      $tmp[$key]=$this->SubObjects[$key];
+    } 
+    $this->SubObjects = $tmp;
+
     /* Cancel Dialog */
     if(isset($_POST['CancelSubObject'])){
       $this->is_dialog=false;