X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/098a79f0819ebb89b7d48df4a6b154af4560f68e..9a23a8c0a51b7ec38a96f525484134f3cb85dc7e:/WEB-INF/lib/form/TextArea.class.php diff --git a/WEB-INF/lib/form/TextArea.class.php b/WEB-INF/lib/form/TextArea.class.php new file mode 100644 index 00000000..9cfd4315 --- /dev/null +++ b/WEB-INF/lib/form/TextArea.class.php @@ -0,0 +1,104 @@ +mName = $name; + $this->mValue = $value; + } + + function setColumns($value) { $this->mColumns = $value; } + function getColumns() { return $this->mColumns; } + + function setRows($value) { $this->mRows = $value; } + function getRows() { return $this->mRows; } + + function toStringControl() { + if (!$this->isRenderable()) return ""; + + if ($this->mId=="") $this->mId = $this->mName; + + $js_maxlen = ""; + + $html = "\n\tmName\" id=\"$this->mId\""; + + if ($this->mColumns!="") + $html .= " cols=\"$this->mColumns\""; + + if ($this->mRows!="") + $html .= " rows=\"$this->mRows\""; + + if ($this->mMaxLength!="") { + if ($this->mOnKeyPress) $this->mOnKeyPress .= ";"; + $this->mOnKeyPress .= "return validateMaxLenght_".$this->mName."(this, event);"; + $js_maxlen = $this->getExtraScript(); + $html .= " maxlength=\"$this->mMaxLength\""; + } + + if ($this->mStyle!="") + $html .= " style=\"$this->mStyle\""; + + if ($this->mOnKeyPress) { + $html .= " onkeypress=\"$this->mOnKeyPress\""; + } + + $html .= ">".htmlspecialchars($this->getValue()).""; + if ($js_maxlen) $html = $js_maxlen."\n".$html; + + return $html; + } + + function getExtraScript() { + $s = "\n"; + return $s; + } +} +?> \ No newline at end of file