X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/466c7825f8313f5e3a11c63383537c8bb302a932..076f64bf058fdda95d95428c95d3acfbbdf93448:/WEB-INF/lib/form/UploadFile.class.php?ds=sidebyside diff --git a/WEB-INF/lib/form/UploadFile.class.php b/WEB-INF/lib/form/UploadFile.class.php index 1055125d..50e8aad5 100644 --- a/WEB-INF/lib/form/UploadFile.class.php +++ b/WEB-INF/lib/form/UploadFile.class.php @@ -29,40 +29,23 @@ import('form.FormElement'); class UploadFile extends FormElement { - var $mValue; - var $cClassName = "UploadFile"; - var $mMaxSize = 100000; // 100kb - function __construct($name,$value="") - { - $this->mName = $name; - $this->mValue = $value; - } - - function setMaxSize($value) { $this->mMaxSize = $value; } - function getMaxSize() { return $this->mMaxSize; } - - function toStringControl() { - if (!$this->isRenderable()) return ""; - - if ($this->mId=="") $this->mId = $this->mName; - - $html = "\n\tmMaxSize."\"/>"; - $html .= "\n\tmName\" id=\"$this->mId\""; - - $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; - } + var $maxSize = 8388608; // 8MB default max size. + + function __construct($name) + { + $this->class = 'UploadFile'; + $this->name = $name; + } + + function setMaxSize($value) { $this->maxSize = $value; } + + function getHtml() { + + if ($this->id == '') $this->id = $this->name; + + $html = "\n\tmaxSize\">"; + $html .= "\n\tid\" name=\"$this->name\">"; + return $html; + } }