A bit of refactoring.
authoranuko <support@anuko.com>
Sun, 7 Jan 2018 19:08:10 +0000 (19:08 +0000)
committeranuko <support@anuko.com>
Sun, 7 Jan 2018 19:08:10 +0000 (19:08 +0000)
WEB-INF/lib/form/Form.class.php
WEB-INF/lib/form/Submit.class.php
WEB-INF/templates/footer.tpl

index cb2f520..a67c0c3 100644 (file)
@@ -87,6 +87,16 @@ class Form {
         $el = new Checkbox($params['name']);
         break;
 
+      case 'hidden':
+        import('form.Hidden');
+        $el = new Hidden($params['name']);
+        break;
+
+      case 'submit':
+        import('form.Submit');
+        $el = new Submit($params['name']);
+        break;
+
 // TODO: refactoring ongoing down from here.
                        case "checkboxgroup":
                            import('form.CheckboxGroup');
@@ -104,17 +114,7 @@ class Form {
                            $el->setDataDefault(@$params["empty"]);
                            if (isset($params["datakeys"])) $el->setDataKeys($params["datakeys"]);
                            break;
-                           
-                       case "hidden":
-                           import('form.Hidden');
-                           $el = new Hidden($params["name"]);
-                           break;
-                        
-                       case "submit":
-                           import('form.Submit');
-                           $el = new Submit($params["name"]);
-                           break;
-                           
+
                        case "calendar":
                            import('form.Calendar');
                            $el = new Calendar($params["name"]);
index 35eb6df..5f8da37 100644 (file)
 // +----------------------------------------------------------------------+
 
 import('form.FormElement');
-       
+
 class Submit extends FormElement {
 
-  function __construct($name)
-  {
+  function __construct($name) {
     $this->class = 'Submit';
     $this->name = $name;
   }
 
   function getHtml() {
-           
-           if ($this->id=="") $this->id = $this->name;
-           
-               $html = "\n\t<input";
-               $html .= " type=\"submit\" name=\"$this->name\" id=\"$this->id\"";
-               
-               if (!$this->isEnabled()) {
-                       $html .= " disabled=\"true\"";
-               }
-               
-               $html .= " value=\"$this->value\"";
-               
-               if ($this->on_click) {
-                    $html .= " onclick=\"".$this->on_click."\"";
-               }
-               
-               $html .= ">";
-               
-               return $html;
-       }
+    if (empty($this->id))
+      $this->id = $this->name;
+
+    // Output HTML.
+    $html = "\n\t<input type=\"submit\" name=\"$this->name\" id=\"$this->id\"";
+    $html .= " value=\"$this->value\"";
+    if ($this->on_click) $html .= " onclick=\"".$this->on_click."\"";
+    if (!$this->isEnabled()) $html .= " disabled";
+    $html .= ">";
+
+    return $html;
+  }
 }
index 3d14fea..1772b10 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.13.8.3727 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.13.8.3728 | 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>