X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/30470a2fe679c83c29259328c5ad60a32ce69d3d..aad5111d2e9f3329dc1002e897dd910a60946d6c:/WEB-INF/lib/form/Form.class.php diff --git a/WEB-INF/lib/form/Form.class.php b/WEB-INF/lib/form/Form.class.php index 14680db4..250f5313 100644 --- a/WEB-INF/lib/form/Form.class.php +++ b/WEB-INF/lib/form/Form.class.php @@ -38,14 +38,11 @@ class Form { var $name = ''; // TODO: refactoring ongoing down from here. - var $mMethod = "post"; - var $mEnctype = ""; var $mId = ""; var $error; var $debugFunction; var $mElements = array(); var $mRequest; -// var $mFormBean; function __construct($formid) { $this->name = $formid; @@ -54,11 +51,7 @@ class Form { function setRequest(&$request) { $this->mRequest = &$request; } - -/* function setFormBean(&$bean) { - $this->mFormBean = &$bean; - } -*/ + function &getElement($name) { return $this->mElements[$name]; } @@ -80,9 +73,6 @@ class Form { function setId($value) { $this->mId = $value; } function getId() { return $this->mId; } - function setMethod($value) { $this->mMethod = $value; } - function getMethod() { return $this->mMethod; } - function isSubmit() { if (!isset($this->mRequest)) return false; $result = false; @@ -259,19 +249,16 @@ class Form { if ($this->mId!="") $html .= " id=\"$this->mId\""; - if ($this->mMethod!="") - $html .= " method=\"$this->mMethod\""; + $html .= ' method="post"'; - // for upload forms + // Add enctype for file upload forms. foreach ($this->mElements as $elname=>$el) { - if (strtolower(get_class($this->mElements[$elname]))=="uploadfile") { - $this->mEnctype = "multipart/form-data"; + if (strtolower(get_class($this->mElements[$elname])) == 'uploadfile') { + $html .= ' enctype="multipart/form-data"'; + break; } } - - if ($this->mEnctype!="") - $html .= " enctype=\"$this->mEnctype\""; - + $html .= ">"; return $html; }