More refactoring in Form.class.php.
authoranuko <support@anuko.com>
Thu, 16 Feb 2017 21:37:42 +0000 (21:37 +0000)
committeranuko <support@anuko.com>
Thu, 16 Feb 2017 21:37:42 +0000 (21:37 +0000)
WEB-INF/lib/form/Form.class.php
WEB-INF/templates/footer.tpl

index 8bf3eca..ab59beb 100644 (file)
@@ -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"]);
index 6714afe..86455bf 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.10.38.3587 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.10.38.3588 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>