Some further refactoring in form classes.
[timetracker.git] / WEB-INF / lib / form / UploadFile.class.php
index 98fbe0a..cfb6712 100644 (file)
 import('form.FormElement');
        
 class UploadFile extends FormElement {
-    var $mValue;
-    var $cClassName            = "UploadFile";
-    var $mMaxSize              = 100000;       // 100kb
+    var $mMaxSize              = 100000;       // 100kb // TODO: refactor this.
 
-       function __construct($name,$value="")
-       {
-               $this->name                     = $name;
-               $this->mValue                   = $value;
-       }
-       
+  function __construct($name, $value = '')
+  {
+    $this->class = 'UploadFile';
+    $this->name = $name;
+    $this->value = $value;
+  }
+
+// TODO: refactoring ongoing down from here.
        function setMaxSize($value)     { $this->mMaxSize = $value;     }
        function getMaxSize()   { return $this->mMaxSize; }
        
-       function toStringControl()      {
-               if (!$this->isRenderable()) return "";
-           
-           if ($this->id=="") $this->id = $this->name;
+       function getHtml() {
+
+            if ($this->id=="") $this->id = $this->name;
            
                $html = "\n\t<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"".$this->mMaxSize."\"/>";
                $html .= "\n\t<input";