X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Ffai%2Fclass_faiScript.inc;h=b7e122058979700046a0fcd98573d80916ba0316;hb=6cb5be59b017449b99265b7ab8dead4eeab15b19;hp=d5580014138a919b89d8b519d286f9166b52e09a;hpb=104a46d512f64afea51f253e7f35e33ee3450c2d;p=gosa.git diff --git a/plugins/admin/fai/class_faiScript.inc b/plugins/admin/fai/class_faiScript.inc index d55800141..b7e122058 100644 --- a/plugins/admin/fai/class_faiScript.inc +++ b/plugins/admin/fai/class_faiScript.inc @@ -76,12 +76,14 @@ class faiScript extends plugin $this->SubObjects[$object['cn'][0]]['status'] = "edited"; $this->SubObjects[$object['cn'][0]]['dn'] = $object['dn']; } - ksort($this->SubObjects); } } function execute() { + /* Call parent execute */ + plugin::execute(); + /* Fill templating stuff */ $smarty= get_smarty(); $display= ""; @@ -92,20 +94,29 @@ class faiScript extends plugin $this->is_dialog=true; } - $_SESSION['objectinfo'] = $this->dn; + if($this->dn != "new"){ + $_SESSION['objectinfo']= $this->dn; + } + + /* Edit selected Sub Object */ if((isset($_POST['EditSubObject']))&&(isset($_POST['SubObject']))){ - $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$_POST['SubObject']]); - $_SESSION['objectinfo'] = $this->SubObjects[$_POST['SubObject']]['dn']; + $script = $_POST['SubObject'][0]; + + $this->dialog= new $this->subClassName($this->config,$this->dn,$this->SubObjects[$script]); + $_SESSION['objectinfo'] = $this->SubObjects[$script]['dn']; $this->is_dialog=true; } /* Remove Sub object */ if((isset($_POST['DelSubObject']))&&(isset($_POST['SubObject']))){ - if($this->SubObjects[$_POST['SubObject']]['status'] == "edited"){ - $this->SubObjects[$_POST['SubObject']]['status']= "delete"; - }else{ - unset($this->SubObjects[$_POST['SubObject']]); + + foreach($_POST['SubObject'] as $script){ + if($this->SubObjects[$script]['status'] == "edited"){ + $this->SubObjects[$script]['status']= "delete"; + }else{ + unset($this->SubObjects[$script]); + } } } @@ -135,9 +146,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;