Code

Changed gotoLdapServer from html select to divSelectBox
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Mar 2006 06:45:47 +0000 (06:45 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 29 Mar 2006 06:45:47 +0000 (06:45 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2925 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_terminalStartup.inc
plugins/admin/systems/terminalStartup.tpl

index 0f644245cfd85b8fdcfb94a2a8c3e11a13e8e1f0..35b521d49017d7f58a3f8469f8eff43db334b6b1 100644 (file)
@@ -151,12 +151,43 @@ class termstartup extends plugin
     $smarty->assign("gotoShares",$this->printOutAssignedShares());
     $smarty->assign("gotoShareKeys",array_flip($this->printOutAssignedShares()));
 
+    /* Arrays */
+    $tmp = $this->config->data['SERVERS']['LDAP'];
 
+    /* Create divSelectBox for ldap server selection
+     */
+    $SelectBoxLdapServer = new divSelectBox("LdapServer");
+    $SelectBoxLdapServer->SetHeight(80);
+
+    /* Set first entry as selected, if $this->gotoLdapServer is empty
+     *  or given entry is no longer available ...
+     */
+    $found = false;
+    foreach($tmp as $server){
+      if($this->gotoLdapServer==$server){
+        $found = true;
+      }
+    }
+    
+    /* Add Entries
+     */
+    foreach($tmp as $server){
+      $use ="";
+      if(($this->gotoLdapServer == $server) || ($found == false)) {
+        $found = true;
+        $use = " checked ";
+      };
+
+      $SelectBoxLdapServer->AddEntry(
+          array(
+            array("string"=>$server),
+            array("string"=>"<input type='radio' name='gotoLdapServer' value='".$server."' ".$use.">",
+                  "attach"=>"style='border-right:0px;'")
+            ));
+    }
+
+    $smarty->assign("SelectBoxLdapServer",$SelectBoxLdapServer->DrawList());
 
-    /* Arrays */
-    $smarty->assign("ldapservers", $this->config->data['SERVERS']['LDAP']);
-    $smarty->assign("gotoLdapServer_select", $this->gotoLdapServer);
-    $smarty->assign("gotoLdapServerACL", chkacl($this->acl, "gotoLdapServer"));
     $smarty->assign("gotoShareACL", chkacl($this->acl, "gotoShareACL"));
     foreach (array("gotoModules" ) as $val){
       $smarty->assign("$val", $this->$val);
index b5c2af419ff7ffb420a6eea777271073a6782bc5..3360d9f817c31d35764f0f36c209b52ca8dff6df 100644 (file)
@@ -5,12 +5,8 @@
 
    <table summary="">
     <tr>
-     <td><LABEL for="gotoLdapServer">{t}LDAP server{/t}</LABEL></td>
-     <td>
-      <select name="gotoLdapServer" id="gotoLdapServer" title="{t}Choose LDAP server to use for accounts and terminal management{/t}" {$gotoLdapServerACL}>
-       {html_options values=$ldapservers output=$ldapservers selected=$gotoLdapServer_select}
-          <option disabled>&nbsp;</option>
-      </select>
+     <td colspan="2" style='vertical-align:top;padding-top:3px;'><LABEL for="gotoLdapServer">{t}LDAP server{/t}</LABEL>
+               {$SelectBoxLdapServer}
      </td>
     </tr>
     <tr>