Ongoing refactoring - renamed a variable.
[timetracker.git] / WEB-INF / lib / form / TextArea.class.php
index 9cfd431..6b3b5ee 100644 (file)
 import('form.FormElement');
        
 class TextArea extends FormElement {
-    var $mValue;
     var $mPassword     = false;
     var $mColumns      = "";
     var $mRows         = "";
     var $cClassName            = "TextArea";
 
-       function TextArea($name,$value="")
+       function __construct($name,$value="")
        {
-               $this->mName                    = $name;
-               $this->mValue                   = $value;
+               $this->name = $name;
+               $this->value = $value;
        }
        
        function setColumns($value)     { $this->mColumns = $value;     }
@@ -50,12 +49,12 @@ class TextArea extends FormElement {
        function toStringControl()      {
                if (!$this->isRenderable()) return "";
            
-           if ($this->mId=="") $this->mId = $this->mName;
+           if ($this->id=="") $this->id = $this->mName;
            
            $js_maxlen = "";
            
                $html = "\n\t<textarea";
-               $html .= " name=\"$this->mName\" id=\"$this->mId\"";
+               $html .= " name=\"$this->name\" id=\"$this->id\"";
                
                if ($this->mColumns!="")
                  $html .= " cols=\"$this->mColumns\"";
@@ -65,7 +64,7 @@ class TextArea extends FormElement {
                   
                if ($this->mMaxLength!="") {
                        if ($this->mOnKeyPress) $this->mOnKeyPress .= ";";
-                       $this->mOnKeyPress .= "return validateMaxLenght_".$this->mName."(this, event);";
+                       $this->mOnKeyPress .= "return validateMaxLenght_".$this->name."(this, event);";
                        $js_maxlen = $this->getExtraScript();
                        $html .= " maxlength=\"$this->mMaxLength\"";
                }
@@ -86,7 +85,7 @@ class TextArea extends FormElement {
        function getExtraScript() {
                $s = "<script>\n";
                $s .= "var isNS4 = (navigator.appName==\"Netscape\")?1:0;\n";
-               $s .= "function validateMaxLenght_".$this->mName."(element, event) {\n";
+               $s .= "function validateMaxLenght_".$this->name."(element, event) {\n";
                $s .= "\tmaxlength=".$this->mMaxLength.";\n";
                $s .= "\tvar iKey = (!isNS4?event.keyCode:event.which);\n";
                //$s .= "alert(iKey);";
@@ -101,4 +100,3 @@ class TextArea extends FormElement {
                return $s;
        }
 }
-?>
\ No newline at end of file