Refactoring - removed unused stuff.
[timetracker.git] / WEB-INF / lib / form / CheckboxGroup.class.php
index 759a076..9d19d27 100644 (file)
@@ -41,8 +41,8 @@ class CheckboxGroup extends FormElement {
 
        function __construct($name,$value="")
        {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
 
        function setChecked($value)     { $this->mChecked = $value; }
@@ -66,9 +66,8 @@ class CheckboxGroup extends FormElement {
                $this->lSelNone = $i18n->getKey('label.select_none');
        }
                
-       function toStringControl()      {
-               if (!$this->isRenderable()) return "";
-           
+       function toStringControl() {
+
            if ($this->id=="") $this->id = $this->name;
            
            $renderArray = array();
@@ -87,9 +86,9 @@ class CheckboxGroup extends FormElement {
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                $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))
+                               if (is_array($this->value)) {
+                                       foreach ($this->value as $element) {
+                                               if (($element == $optkey) && ($element != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
@@ -115,9 +114,9 @@ class CheckboxGroup extends FormElement {
                                                $optval = $optval[$this->mDataKeys[1]];
                                        }
                                $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))
+                               if (is_array($this->value)) {
+                                       foreach ($this->value as $element) {
+                                               if (($element == $optkey) && ($element != null))
                                                        $html .= " checked=\"true\"";
                                        }
                                }
@@ -132,7 +131,7 @@ class CheckboxGroup extends FormElement {
            }
            
            
-           $html = "\n\t<table style=\"".$this->mStyle."\"><tr><td align=\"center\" bgcolor=\"eeeeee\">\n";
+           $html = "\n\t<table style=\"".$this->style."\"><tr><td align=\"center\" bgcolor=\"eeeeee\">\n";
            $html .= '<a href="#" onclick="setAll'.$this->getName().'(true);return false;">'.$this->lSelAll.'</a>&nbsp;/&nbsp;<a href="#" onclick="setAll'.$this->getName().'(false);return false;">'.$this->lSelNone.'</a>';
            $html .= "</td></tr>\n";
            $html .= "<tr><td>";