Code

Updated checkbox Widget
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Apr 2011 09:02:37 +0000 (09:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 27 Apr 2011 09:02:37 +0000 (09:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20773 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/TemplateEngine.tpl
gosa-plugins/goto-ng/admin/newConfigManagement/TemplateEngine/class_TemplateWidget_checkbox.inc

index 9372b25ebfef879bee9e939764289d7041565e0d..99be426283e73d90046dccb3fba0899f5d60cb1d 100644 (file)
@@ -10,4 +10,3 @@
     <button name='saveItemEdit'>{msgPool type=okButton}</button>
     <button name='cancelItemEdit'>{msgPool type=cancelButton}</button>
 </div>
-
index 43318395e27a439bba95fc32e6cb79835f9ebcde..27488cbef79da5d8f2fd178f8e98ae115877c229 100644 (file)
@@ -7,14 +7,20 @@ class TemplateWidget_checkbox extends TemplateWidget
         $str = "";
         $disabled = (!$this->enabled)? "disabled" : "";
         $str .= "<input type='checkbox' value='1' name='{$this->postName}' {$disabled}";
-            if($this->value) $str .= " checked ";
+
+        if($this->value) $str .= " checked ";
+
         $str .= ">";
+
+        $str .= "<input type='hidden' name='{$this->postName}_posted' value='1'>";
         return($str);
     }
 
     function save_object()
     {
-        $this->value = isset($_POST[$this->postName]);
+        if(isset($_POST["{$this->postName}_posted"])){
+            $this->value = isset($_POST[$this->postName]);
+        }
     }
 }
 ?>