Code

Closes #273 Environment Button Disabling
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 12:10:29 +0000 (12:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 23 Nov 2007 12:10:29 +0000 (12:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7872 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 0fa8a76daeeadd8f5d35688ff57e0d6a4fcffa69..4434f9cbc1e19df21c1801779ccb2e51f0d5f858 100644 (file)
@@ -603,8 +603,10 @@ class environment extends plugin
     }
 
     /* Append List to smarty*/
-    $smarty->assign("gotoLogonScripts",   $this->printOutLogonScripts());
-    $smarty->assign("gotoLogonScriptKeys",array_flip($this->printOutLogonScripts()));
+    $ls = $this->printOutLogonScripts();
+    $smarty->assign("gotoLogonScripts",  $ls);
+    $smarty->assign("gotoLogonScriptKeys",array_flip($ls));
+    $smarty->assign("gotoLogonScriptKeysCnt",count($ls));
 
     /* In this section server shares will be defined 
      * A user can select one of the given shares and a mount point
index 952f722543060bf0d7599291d9f402eca73c7cb3..bbaa863bda9dce7c4cf14021fa2a5c555bd19f35 100644 (file)
       <input type="submit" name="gotoLogonScriptNew" value="{t}Add{/t}">
 {/render}
 {render acl=$gotoLogonScriptACL}
-      <input type="submit" name="gotoLogonScriptEdit"  value="{t}Edit{/t}">
+      <input type="submit" name="gotoLogonScriptEdit"  value="{t}Edit{/t}" {if $gotoLogonScriptKeysCnt ==0} disabled {/if}>
 {/render}
 {render acl=$gotoLogonScriptACL}
-      <input type="submit" name="gotoLogonScriptDel"  value="{t}Delete{/t}" >
+      <input type="submit" name="gotoLogonScriptDel"  value="{t}Delete{/t}" {if $gotoLogonScriptKeysCnt ==0} disabled {/if}>
 {/render}
      </td>
     </tr>