From: anuko Date: Thu, 16 Feb 2017 21:37:42 +0000 (+0000) Subject: More refactoring in Form.class.php. X-Git-Tag: timetracker_1.19-1~1565 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/commitdiff_plain/94a45188ff1dea301c6dec7714310e9198e0cadf?ds=inline More refactoring in Form.class.php. --- 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"]); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 6714afef..86455bf2 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.10.38.3587 | Copyright © Anuko | +  Anuko Time Tracker 1.10.38.3588 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve}