X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/8e115dc0b3f4ee266a09f762084e3495726ac6dd..e320f1d51ffa712689c6cb2877208464395aebb2:/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 b357fe5e..8bf3ecab 100644 --- a/WEB-INF/lib/form/Form.class.php +++ b/WEB-INF/lib/form/Form.class.php @@ -36,51 +36,26 @@ class Form { var $name = ''; - // TODO: refactoring ongoing down from here. + var $elements = array(); - var $elements = array(); - var $mRequest; - - function __construct($formName) { - $this->name = $formName; - } - - function setRequest(&$request) { - $this->mRequest = &$request; - } + function __construct($formName) { + $this->name = $formName; + } - function &getElement($name) { - return $this->elements[$name]; - } - - function &getElements() { - return $this->elements; - } - - //// FORM element - // action - // method - GET, POST - // enctype - enctype="multipart/form-data" - // name - // onsubmit - // onreset - function getName() { return $this->name; } + function getElement($name) { + return $this->elements[$name]; + } + + function getElements() { + return $this->elements; + } + + function getName() { return $this->name; } - function isSubmit() { - if (!isset($this->mRequest)) return false; - $result = false; - foreach ($this->elements as $el) { - if (strtolower(get_class($el))=="submit") { - $name = $el->getName(); - $value = $this->mRequest->getAttribute($name); - if($value) { - $result = true; - } - } - } - return $result; - } - + // TODO: refactoring ongoing down from here. + + + //// INPUT element // type = TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON // name