X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/098a79f0819ebb89b7d48df4a6b154af4560f68e..9a23a8c0a51b7ec38a96f525484134f3cb85dc7e:/WEB-INF/lib/form/Checkbox.class.php diff --git a/WEB-INF/lib/form/Checkbox.class.php b/WEB-INF/lib/form/Checkbox.class.php new file mode 100644 index 00000000..f605edf6 --- /dev/null +++ b/WEB-INF/lib/form/Checkbox.class.php @@ -0,0 +1,78 @@ +mName = $name; + $this->mValue = $value; + } + + function setChecked($value) { $this->mChecked = $value; } + function isChecked() { return $this->mChecked; } + + function setData($value) { $this->mOptions = $value; } + function getData() { return $this->mOptions; } + + function toStringControl() { + if (!$this->isRenderable()) return ""; + + if ($this->mId=="") $this->mId = $this->mName; + + $html = "\n\tmName\" id=\"$this->mId\""; + + if ($this->mTabindex!="") + $html .= " tabindex=\"$this->mTabindex\""; + + if ($this->mOnChange!="") + $html .= " onchange=\"$this->mOnChange\""; + + if ($this->mStyle!="") + $html .= " style=\"$this->mStyle\""; + + if ($this->mChecked || (($this->mValue == $this->mOptions) && ($this->mValue != null))) + $html .= " checked=\"true\""; + + if (!$this->isEnable()) + $html .= " disabled=\"disabled\""; + + $html .= " value=\"".htmlspecialchars($this->mOptions)."\""; + + $html .= "/>\n"; + + return $html; + } +} +?> \ No newline at end of file