Code

Fixed images in FAI list
[gosa.git] / gosa-plugins / goto / admin / systems / goto / class_terminalService.inc
index 12edba01f448e04be542226c32ed29fefc8fc706..360054533daadc85a204f2a33386a8c3ad761dc9 100644 (file)
@@ -110,7 +110,7 @@ class termservice extends plugin
       $file = $this->config->get_cfg_value("resolutions");
       if(is_readable($file)){
         $str = file_get_contents($file);
-        $lines = split("\n",$str);
+        $lines = preg_split("/\n/",$str);
         foreach($lines as $line){
           $line = trim($line);
           if(!empty($line)){
@@ -164,11 +164,11 @@ class termservice extends plugin
     if(file_exists(CONFIG_DIR."/keyboardLayouts")){
       if(is_readable(CONFIG_DIR."/keyboardLayouts")){
         $str = file_get_contents(CONFIG_DIR."/keyboardLayouts");
-        $tmp = split("\n",$str);
+        $tmp = preg_split("/\n/",$str);
         foreach($tmp as $entry){
           if((!empty($entry)) && (!preg_match("/^#/",$entry))){
             $entry = trim($entry);
-            $tmp2 = split ("\:",$entry);
+            $tmp2 = explode(":",$entry);
             $la =   trim($tmp2[0]);   // What would be saved to ldap
             $da =   trim($tmp2[1]);   // This wis displayed in the listbox
             $this->XKbLayouts [ $la] = $da;
@@ -241,7 +241,7 @@ class termservice extends plugin
         "gotoXColordepth", 
         "gotoXKbModel", 
         "gotoXKbLayout",
-#        "gotoXDriver",
+        "gotoXDriver",
         "gotoXdmcpServer",
         "gotoXKbVariant",
         "gotoXMouseType", 
@@ -256,9 +256,9 @@ class termservice extends plugin
         }
 
         switch ($name){
-#         case 'gotoXDriver': 
-#           $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
-#           break;
+         case 'gotoXDriver': 
+           $this->XDrivers = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XDrivers;
+           break;
           case 'gotoXMethod': 
             $this->XMethods = array('default' => _("inherited").' ['.$attrs[$name][0].']' ) + $this->XMethods;
             if(isset($attrs['gotoXdmcpServer'])){
@@ -404,7 +404,6 @@ class termservice extends plugin
     foreach(array("gotoXHsync", "gotoXVsync") as $val){
       $smarty->assign($val, $this->$val);
     }
-    $smarty->assign("staticAddress", "");
 
     /* Checkboxes */
     foreach(array("gotoScannerEnable") as $val){
@@ -626,7 +625,12 @@ class termservice extends plugin
         $drivers[] = $driver;
       }
     }
-    return($drivers);
+
+    $tmp = array();
+    foreach($drivers as $name){
+      $tmp[$name] = $name;
+    }
+    return($tmp);
   }
 
   function send_goto_reload()
@@ -678,6 +682,19 @@ class termservice extends plugin
   }
 
 
+  function PrepareForCopyPaste($source)
+  {
+    plugin::PrepareForCopyPaste($source);
+
+    $source_o = new termservice ($this->config, $source['dn']);
+
+    foreach(array("gotoXdmcpServer","selected_xdmcp_servers") as $attr){
+      $this->$attr = $source_o->$attr;
+    }
+  }
+
+
+
   /* Return plugin informations for acl handling */
   static function plInfo()
   {