X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FUploadFile.class.php;h=cfb671209e6046ca1e441bb8f5a6b3ba88484d5b;hb=e1703495130c8ed88fe210f50a2a6b453b3c566b;hp=1055125df6a3576220e9e1a12ce9d7a9837bbd11;hpb=466c7825f8313f5e3a11c63383537c8bb302a932;p=timetracker.git diff --git a/WEB-INF/lib/form/UploadFile.class.php b/WEB-INF/lib/form/UploadFile.class.php index 1055125d..cfb67120 100644 --- a/WEB-INF/lib/form/UploadFile.class.php +++ b/WEB-INF/lib/form/UploadFile.class.php @@ -29,40 +29,30 @@ 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->mName = $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->mId=="") $this->mId = $this->mName; + function getHtml() { + + if ($this->id=="") $this->id = $this->name; $html = "\n\tmMaxSize."\"/>"; $html .= "\n\tmName\" id=\"$this->mId\""; + $html .= " name=\"$this->name\" id=\"$this->id\""; $html .= " type=\"file\""; $html .= ">"; - - // only IE - /*$html = "mName."\" id=\"".$this->mId."\" style=\"display: none;\">\n"; - $html .= "mName."file\">\n"; - $html .= "mName.".click();".$this->mName."file.value=".$this->mName.".value;".$this->mName.".disabled=true;\""; - $html .= " value=\"".$this->getValue()."\">\n"; - $html .= "mMaxSize."\"/>";*/ - - - return $html; + + return $html; } }