X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FCheckboxGroup.class.php;h=13f207d9a758722bbc26a386dbfd7d6aa9fac8c0;hb=2d0b41f7a9a2064b7a41209ec85fa3779b1f8a29;hp=6fef23171993a2495cecdb2efd990d6c6b4cdd0a;hpb=9a23a8c0a51b7ec38a96f525484134f3cb85dc7e;p=timetracker.git diff --git a/WEB-INF/lib/form/CheckboxGroup.class.php b/WEB-INF/lib/form/CheckboxGroup.class.php index 6fef2317..13f207d9 100644 --- a/WEB-INF/lib/form/CheckboxGroup.class.php +++ b/WEB-INF/lib/form/CheckboxGroup.class.php @@ -39,10 +39,10 @@ class CheckboxGroup extends FormElement { var $lSelAll = "All"; var $lSelNone = "None"; - function CheckboxGroup($name,$value="") + function __construct($name,$value="") { - $this->mName = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setChecked($value) { $this->mChecked = $value; } @@ -69,7 +69,7 @@ class CheckboxGroup extends FormElement { function toStringControl() { if (!$this->isRenderable()) return ""; - if ($this->mId=="") $this->mId = $this->mName; + if ($this->id=="") $this->id = $this->name; $renderArray = array(); $renderCols = 0; @@ -86,14 +86,14 @@ class CheckboxGroup extends FormElement { $optkey = $optval[$this->mDataKeys[0]]; $optval = $optval[$this->mDataKeys[1]]; } - $html = "mName[]\" id=\"$this->mId"."_".$i."\""; - if (is_array($this->mValue)) { - foreach ($this->mValue as $value) { - if (($value == $optkey) && ($value != null)) + $html = "name[]\" id=\"$this->id"."_".$i."\""; + if (is_array($this->value)) { + foreach ($this->value as $element) { + if (($element == $optkey) && ($element != null)) $html .= " checked=\"true\""; } } - $html .= " value=\"".htmlspecialchars($optkey)."\"> "; + $html .= " value=\"".htmlspecialchars($optkey)."\"> "; $renderArray[$col][$row] = $html; $col++; @@ -114,14 +114,14 @@ class CheckboxGroup extends FormElement { $optkey = $optval[$this->mDataKeys[0]]; $optval = $optval[$this->mDataKeys[1]]; } - $html = "mName[]\" id=\"$this->mId"."_".$i."\""; - if (is_array($this->mValue)) { - foreach ($this->mValue as $value) { - if (($value == $optkey) && ($value != null)) + $html = "name[]\" id=\"$this->id"."_".$i."\""; + if (is_array($this->value)) { + foreach ($this->value as $element) { + if (($element == $optkey) && ($element != null)) $html .= " checked=\"true\""; } } - $html .= " value=\"".htmlspecialchars($optkey)."\"> "; + $html .= " value=\"".htmlspecialchars($optkey)."\"> "; $renderArray[$col][$row] = $html; $row++; @@ -160,4 +160,3 @@ class CheckboxGroup extends FormElement { return $html.$str; } } -?> \ No newline at end of file