Code

Some little changes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Sep 2005 12:40:17 +0000 (12:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 7 Sep 2005 12:40:17 +0000 (12:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1315 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/FAI/class_faiManagement.inc

index 2738653e8beae08d25da06f2072a036901939916..fb6681453ae5af620be262157bb2cf1f2f3bc202 100644 (file)
@@ -18,6 +18,7 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 require "tabsPartition.inc";
+require "tabsScript.inc";
 
 class faiManagement extends plugin
 {
@@ -195,16 +196,13 @@ class faiManagement extends plugin
                /* Edit Entry */
                if($s_action == "edit"){
                        $entry  = $this->objects[$s_entry];
-                       switch($entry['type']){
-                               case "FAIpartitionTable" :              
-                                       $this->dn = $entry['dn'];
-                               $this->dialog= new tabsPartition($this->config,
-                        $this->config->data['TABS']['PARTITIONTABS'],$this->dn);
-                                       $this->is_dialog = true;
-                                       ;break; 
-                               default :;break;
-                       }
-               
+
+                       $a_setup = ( $this->get_type($entry));
+
+                       $this->dn = $entry['dn'];
+                       $this->dialog= new $a_setup[0]($this->config,
+                                       $this->config->data['TABS'][$a_setup[2]],$this->dn);
+                       $this->is_dialog = true;
                }
 
 
@@ -223,7 +221,7 @@ class faiManagement extends plugin
                                $this->dn = "new" ;
                                $name = $this->dialog->save();
                                $this->dialog = new tabsPartition($this->config,
-                                               $this->config->data['TABS']['PARTITIONTABS'],$this->dn);
+                                               $this->config->data['TABS']['FAIPARTITIONTABS'],$this->dn);
                                $this->dialog->by_object['faiPartitionTable']->cn = $name;
                                $this->is_dialog = true;
                        }               
@@ -502,7 +500,10 @@ class faiManagement extends plugin
 
        function get_type($array){
                if(in_array("FAIpartitionTable",$array['objectClass'])){
-                       return(array("tabsPartition","faiPartitionTable","PARTITIONTABS"));
+                       return(array("tabsPartition","faiPartitionTable","FAIPARTITIONTABS"));
+               }
+               if(in_array("FAIscript",$array['objectClass'])){
+                       return(array("tabsScript","faiScript","FAISCRIPTTABS"));
                }
        }