Code

Made hotplug devices [] multiple
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 May 2006 03:44:08 +0000 (03:44 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 31 May 2006 03:44:08 +0000 (03:44 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3568 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/personal/environment/class_environment.inc
plugins/personal/environment/class_hotplugDialog.inc
plugins/personal/environment/hotplugDialog.tpl

index be9e18f04a991f990669166c41b71c211d2e471d..dd9342cef22b5d4b3a2f745a35cac9820f3a12bf 100644 (file)
@@ -603,8 +603,11 @@ class environment extends plugin
       }else{
         $this->dialog->save_object();
         $a_tmp = $this->dialog->save();
+       
         if(is_array($a_tmp)){
-          $this->gotoHotplugDevices[$a_tmp['name']]= $a_tmp; 
+          foreach($a_tmp as $name => $hotplug){
+            $this->gotoHotplugDevices[$name]= $hotplug; 
+          }
         }
         unset($this->dialog);
         $this->dialog= NULL;
index eb013741ff8b563915c7a927bbebba586d3aeba4..a965e3c645989da54494d82fe8468cc57ec2dd2c 100644 (file)
@@ -141,14 +141,16 @@ class hotplugDialog extends plugin
     /* return generated entry from input fields*/
     if(!$this->use_existing){
       $a_return=array();
-      $a_return['name']= $this->HOT_name; 
-      $a_return['description']= $this->HOT_description; 
-      $a_return['id']= $this->HOT_id;
+      $a_return[$this->HOT_name]['name']= $this->HOT_name; 
+      $a_return[$this->HOT_name]['description']= $this->HOT_description; 
+      $a_return[$this->HOT_name]['id']= $this->HOT_id;
       return($a_return); 
     }else{
-      //return selected entry from select box
-      $entry = $this->hotplugDeviceList[$_POST['hotplugName']];
-      return $entry;
+      $entries = array();
+      foreach($_POST['hotplugName'] as $name){
+        $entries[$name] = $this->hotplugDeviceList[$name];
+      }
+      return $entries;
     }
   }
 
index 77e0408c185d32737c133b6182284603497565f7..ddc810599953a6f929492efe39cba8a2e0ebc778 100644 (file)
@@ -12,8 +12,8 @@
                                </div>
                                <div class="contentboxb">
                                <p class="contentboxb" style="border-top:1px solid #B0B0B0;background-color:#F8F8F8">
-                                               <select style="width:600px;height:450px" size=20 name="hotplugName" id="hotplugName">
-                                               {html_options values=$hotplugDeviceKeys output=$hotplugDevices}
+                                               <select style="width:600px;height:450px" size=20 name="hotplugName[]" id="hotplugName" multiple>
+                                                       {html_options values=$hotplugDeviceKeys output=$hotplugDevices}
                                                <option disabled>&nbsp;</option>
                                                </select><br>
                                        </p>