Code

Updated item handling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 13:46:39 +0000 (13:46 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 27 Sep 2010 13:46:39 +0000 (13:46 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19804 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/Config/class_DeviceConfig.inc

index a40c864a145112bb8c1da4ba9d09ecc0581231fd..dccca989dc43051d97c53266e65b1f7265cd0ad8 100644 (file)
@@ -233,6 +233,16 @@ class DeviceConfig extends plugin
             $sub = get_post('subModule');
             if(in_array($sub, $this->currentItemDescriptor['container'])){
 
+                // Check if this is a valid item
+                if(!isset($this->itemConfig[$sub])) {
+                    echo "Invalid item type '{$sub}'!";
+                    $values = array();
+                }else{
+                    $values = $this->itemConfig[$sub]['options'];
+                }
+                $name = 'test'.rand(0,99999);
+                $this->addItem($sub,$name,$values);
+                $this->setCurrentItem($name);
             }
         }