Code

Fixed Translation Strings.
[gosa.git] / plugins / admin / systems / class_terminalStartup.inc
index e4d3412abf273d1767415fc05ca4aaa01f406f39..7a02964f21b2b15e9cac8df5a262bdbd8d7a387f 100644 (file)
@@ -96,10 +96,11 @@ class termstartup extends plugin
         $fh= popen($command, "r");
         while (!feof($fh)) {
           $buffer= fgets($fh, 256);
-          $this->gotoBootKernels[]= $buffer;
+          if(!empty($buffer)){
+            $this->gotoBootKernels[]= $buffer;
+          }
         }
         pclose($fh);
-        sort($this->gotoBootKernels);
       }
 
     }
@@ -111,6 +112,27 @@ class termstartup extends plugin
       }
       $this->goLdapServerList[$server] = $visible;
     }
+
+     /* Load hardware list */
+    $ldap= $this->config->get_ldap_link();
+    $ldap->cd($this->config->current['BASE']);
+    $ldap->search("(&(objectClass=gotoWorkstationTemplate)(member=".$this->dn."))");
+    if ($ldap->count() == 1){
+      $map= array("gotoLdapServer");
+      $attrs= $ldap->fetch();
+
+      foreach ($map as $name){
+        if (!isset($attrs[$name][0])){
+          continue;
+        }
+
+        switch ($name){
+          case 'gotoLdapServer':
+            $this->goLdapServerList= array_merge(array('default' => _("inherited").' ['.$attrs[$name][0].']' ), $this->goLdapServerList);
+            break;
+        }
+      }
+    }
   }
 
   function execute()
@@ -208,9 +230,9 @@ class termstartup extends plugin
 
       $SelectBoxLdapServer->AddEntry(
           array(
-            array("string"=>$visible),
             array("string"=>"<input type='radio' name='gotoLdapServer' value='".$server."' ".$use.">",
-                  "attach"=>"style='border-right:0px;'")
+                  "attach"=>"style='border-left:0px;'"),
+            array("string"=>$visible)
             ));
     }
 
@@ -341,7 +363,7 @@ class termstartup extends plugin
 
     /* Strip out 'default' values */
     foreach(array("gotoBootKernel","gotoLdapServer") as $value){
-      if ($this->attrs[$value] == "default"){
+      if (!isset($this->attrs[$value]) || $this->attrs[$value] == "default"){
         $this->attrs[$value] = array();
       } 
     }