From: hickert Date: Wed, 11 Jan 2006 07:21:11 +0000 (+0000) Subject: Added casesensitive sorting to scripts/templates/hooks/vars X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=15cd57be451035d712fa790202b9203aa4213990;p=gosa.git Added casesensitive sorting to scripts/templates/hooks/vars git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2439 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_faiHook.inc b/plugins/admin/fai/class_faiHook.inc index 1d23d113c..bfea1e7b2 100644 --- a/plugins/admin/fai/class_faiHook.inc +++ b/plugins/admin/fai/class_faiHook.inc @@ -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; diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index bd2ebf893..50e5349ad 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -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; diff --git a/plugins/admin/fai/class_faiTemplate.inc b/plugins/admin/fai/class_faiTemplate.inc index 94837291c..a4017ea8c 100644 --- a/plugins/admin/fai/class_faiTemplate.inc +++ b/plugins/admin/fai/class_faiTemplate.inc @@ -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; diff --git a/plugins/admin/fai/class_faiVariable.inc b/plugins/admin/fai/class_faiVariable.inc index fdf650198..87aab8e73 100644 --- a/plugins/admin/fai/class_faiVariable.inc +++ b/plugins/admin/fai/class_faiVariable.inc @@ -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;