]> wagnertech.de Git - timetracker.git/commitdiff
A bit more refactoring in forms to make them leaner.
authoranuko <support@anuko.com>
Thu, 16 Feb 2017 20:56:26 +0000 (20:56 +0000)
committeranuko <support@anuko.com>
Thu, 16 Feb 2017 20:56:26 +0000 (20:56 +0000)
WEB-INF/lib/form/ActionForm.class.php
WEB-INF/lib/form/Form.class.php
WEB-INF/templates/footer.tpl

index 186f968a93642440d824db419d3d4db144912ce0..fa70e15ff1e292aaa8c8fcc68e6a1b935ccabe32 100644 (file)
@@ -38,7 +38,6 @@ class ActionForm {
 
     function __construct($name, &$form, $request=null) {
        $this->setName($name);
-       $form->setRequest($request);
                $this->setForm($form);
                //if ($request) $this->initAttributes($request);
                $this->initAttributes($request);
@@ -73,7 +72,6 @@ class ActionForm {
      * @param object $request
      */
     function initAttributes(&$request) {
-        //$submit_flag = $this->isSubmit();
         $submit_flag = (is_object($request) && ($request->isPost()));
                
         if ($submit_flag) {
@@ -165,14 +163,6 @@ class ActionForm {
         print_r($this->mValues);
     }
     
-    function isSubmit() {
-        $res = false;
-        if (is_object($this->mForm)) {
-            $res = $this->mForm->isSubmit();
-        }
-        return $res;
-    }
-    
     function saveBean() {
        if ($this->mForm) {
                $elements = $this->mForm->getElements();
index b357fe5ea4de72c3813e6fd669a3ebf96cd8ff63..b37903cdd41c60a0ac7e589a6745b719c782b8ad 100644 (file)
 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;
+  }
+
+  // TODO: refactoring ongoing down from here.
 
     function &getElement($name) {
        return $this->elements[$name];
@@ -65,22 +60,7 @@ class Form {
        // onsubmit
        // onreset
     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;
-    }
-       
+
        //// INPUT element
        // type = TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON
        // name
index 68066f59dffe2afc4de87f15626fc0119de692dd..fe95f10579da2587d19f1b420b8e2ad09aaf18db 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.3585 | 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.3586 | 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>