]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/form/CheckboxGroup.class.php
Ongoing refactoring of form controls.
[timetracker.git] / WEB-INF / lib / form / CheckboxGroup.class.php
index f9d850fc2273ddd67452f7e69d308488deb8962a..759a0767acb2ab3dee6ad90b7c4061f1c9b63e78 100644 (file)
@@ -41,7 +41,7 @@ class CheckboxGroup extends FormElement {
 
        function __construct($name,$value="")
        {
 
        function __construct($name,$value="")
        {
-               $this->mName                    = $name;
+               $this->name                     = $name;
                $this->mValue                   = $value;
        }
 
                $this->mValue                   = $value;
        }
 
@@ -69,7 +69,7 @@ class CheckboxGroup extends FormElement {
        function toStringControl()      {
                if (!$this->isRenderable()) return "";
            
        function toStringControl()      {
                if (!$this->isRenderable()) return "";
            
-           if ($this->mId=="") $this->mId = $this->mName;
+           if ($this->id=="") $this->id = $this->name;
            
            $renderArray = array();
            $renderCols = 0;
            
            $renderArray = array();
            $renderCols = 0;
@@ -86,14 +86,14 @@ class CheckboxGroup extends FormElement {
                                                $optkey = $optval[$this->mDataKeys[0]];
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                                $optkey = $optval[$this->mDataKeys[0]];
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
-                               $html = "<input type=\"checkbox\" name=\"$this->mName[]\" id=\"$this->mId"."_".$i."\"";
+                               $html = "<input type=\"checkbox\" name=\"$this->name[]\" id=\"$this->id"."_".$i."\"";
                                if (is_array($this->mValue)) {
                                        foreach ($this->mValue as $value) {
                                                if (($value == $optkey) && ($value != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
                                if (is_array($this->mValue)) {
                                        foreach ($this->mValue as $value) {
                                                if (($value == $optkey) && ($value != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
-                                       $html .= " value=\"".htmlspecialchars($optkey)."\">&nbsp;<label for=\"$this->mId"."_".$i."\">".htmlspecialchars($optval)."</label>";
+                                       $html .= " value=\"".htmlspecialchars($optkey)."\">&nbsp;<label for=\"$this->id"."_".$i."\">".htmlspecialchars($optval)."</label>";
                                        $renderArray[$col][$row] = $html;
                                        
                                $col++;                         
                                        $renderArray[$col][$row] = $html;
                                        
                                $col++;                         
@@ -114,14 +114,14 @@ class CheckboxGroup extends FormElement {
                                                $optkey = $optval[$this->mDataKeys[0]];
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                                $optkey = $optval[$this->mDataKeys[0]];
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
-                               $html = "<input type=\"checkbox\" name=\"$this->mName[]\" id=\"$this->mId"."_".$i."\"";
+                               $html = "<input type=\"checkbox\" name=\"$this->name[]\" id=\"$this->id"."_".$i."\"";
                                if (is_array($this->mValue)) {
                                        foreach ($this->mValue as $value) {
                                                if (($value == $optkey) && ($value != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
                                if (is_array($this->mValue)) {
                                        foreach ($this->mValue as $value) {
                                                if (($value == $optkey) && ($value != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
-                                       $html .= " value=\"".htmlspecialchars($optkey)."\">&nbsp;<label for=\"$this->mId"."_".$i."\">".htmlspecialchars($optval)."</label>";
+                                       $html .= " value=\"".htmlspecialchars($optkey)."\">&nbsp;<label for=\"$this->id"."_".$i."\">".htmlspecialchars($optval)."</label>";
                                        $renderArray[$col][$row] = $html;
 
                                        $row++;
                                        $renderArray[$col][$row] = $html;
 
                                        $row++;