X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2Fform%2FForm.class.php;fp=WEB-INF%2Flib%2Fform%2FForm.class.php;h=ab59bebfb7e58aa4873ebecea5ecc26cbab8f6c3;hb=94a45188ff1dea301c6dec7714310e9198e0cadf;hp=8bf3ecaba9335e9eb165d0f709a52d99d8d7c534;hpb=e320f1d51ffa712689c6cb2877208464395aebb2;p=timetracker.git diff --git a/WEB-INF/lib/form/Form.class.php b/WEB-INF/lib/form/Form.class.php index 8bf3ecab..ab59bebf 100644 --- a/WEB-INF/lib/form/Form.class.php +++ b/WEB-INF/lib/form/Form.class.php @@ -51,36 +51,20 @@ class Form { } function getName() { return $this->name; } - - // TODO: refactoring ongoing down from here. - + // addInput - adds an input object to the form. + function addInput($arguments) { + switch($arguments['type']) { + case 'text': + import('form.TextField'); + $el = new TextField($arguments['name']); + $el->setMaxLength(@$arguments['maxlength']); + if (isset($arguments['aspassword'])) $el->setAsPassword($arguments['aspassword']); + break; - //// INPUT element - // type = TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON - // name - // value - // checked - for type radio and checkbox - // size - width pixels or chars - // maxlength - // src - for type image - // tabindex - support A, AREA, BUTTON, INPUT, OBJECT, SELECT, and TEXTAREA - // accesskey - support A, AREA, BUTTON, INPUT, LABEL, and LEGEND, and TEXTAREA - // onfocus - // onblur - // onselect - INPUT and TEXTAREA - // onchange - function addInput($arguments) { - switch($arguments["type"]) { - - case "textfield": - case "text": - import('form.TextField'); - $el = new TextField($arguments["name"]); - $el->setMaxLength(@$arguments["maxlength"]); - if (isset($arguments["aspassword"])) $el->setAsPassword($arguments["aspassword"]); - break; - +// TODO: refactoring ongoing down from here. +// aspassword - change this name to something better? Perhaps. +// Change $arguments to something better too (maybe). $args or $params? case "datefield": import('form.DateField'); $el = new DateField($arguments["name"]);