Code

Avoid multiple statement "disabled" in modify state buttons
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 04:40:20 +0000 (04:40 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 11 Aug 2006 04:40:20 +0000 (04:40 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4473 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_plugin.inc

index de552c67d16d6c32f4564ed155aeb5426194e8f0..24863ac16eb744738e38fdaea9bd1db22f7c90e1 100644 (file)
@@ -517,14 +517,13 @@ class plugin
   /* Show header message for tab dialogs */
   function show_enable_header($button_text, $text, $disabled= FALSE)
   {
-    if ($disabled == TRUE){
+    if (($disabled == TRUE) || (!$this->acl_is_createable())){
       $state= "disabled";
     } else {
       $state= "";
     }
     $display= "<table summary=\"\" width=\"100%\"><tr>\n<td colspan=2><p><b>$text</b></p>\n";
-    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".
-      ($this->acl_is_createable()?'':'disabled')." ".$state.
+    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".$state.
       "><p class=\"seperator\">&nbsp;</p></td></tr></table>";
 
     return($display);
@@ -534,14 +533,13 @@ class plugin
   /* Show header message for tab dialogs */
   function show_disable_header($button_text, $text, $disabled= FALSE)
   {
-    if ($disabled == TRUE){
+    if (($disabled == TRUE) || !$this->acl_is_removeable()){
       $state= "disabled";
     } else {
       $state= "";
     }
     $display= "<table summary=\"\" width=\"100%\"><tr>\n<td colspan=2><p><b>$text</b></p>\n";
-    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".
-      ($this->acl_is_removeable()?'':'disabled')." ".$state.
+    $display.= "<input type=submit value=\"$button_text\" name=\"modify_state\" ".$state.
       "><p class=\"seperator\">&nbsp;</p></td></tr></table>";
 
     return($display);