Small scale refactoring - renamed a variable.
authoranuko <support@anuko.com>
Thu, 16 Feb 2017 20:23:41 +0000 (20:23 +0000)
committeranuko <support@anuko.com>
Thu, 16 Feb 2017 20:23:41 +0000 (20:23 +0000)
WEB-INF/lib/form/ActionForm.class.php
WEB-INF/lib/form/Form.class.php
WEB-INF/templates/footer.tpl

index be77649..186f968 100644 (file)
@@ -53,7 +53,7 @@ class ActionForm {
     
     function &getFormElement($name) {
        if ($this->mForm!=null) {
-                       return  $this->mForm->mElements[$name];
+            return  $this->mForm->elements[$name];
        }
        return null;
     }
@@ -80,9 +80,9 @@ class ActionForm {
                // fill ActionForm and Form from Request
 
                foreach ($this->mVariables as $name) {
-                       if ($this->mForm->mElements[$name] && $request->getParameter($name)) {
-                           $this->mForm->mElements[$name]->setValue($request->getParameter($name));
-                           $this->mValues[$name] = $this->mForm->mElements[$name]->getValue();
+                       if ($this->mForm->elements[$name] && $request->getParameter($name)) {
+                           $this->mForm->elements[$name]->setValue($request->getParameter($name));
+                           $this->mValues[$name] = $this->mForm->elements[$name]->getValue();
                        }
                }
         } else {
@@ -94,8 +94,8 @@ class ActionForm {
         if ($this->mForm) {
                $elements = $this->mForm->getElements();
                        foreach ($elements as $name=>$el) {
-                       if ($this->mForm->mElements[$name] && isset($this->mValues[$name])) {
-                                   $this->mForm->mElements[$name]->setValue($this->mValues[$name]);
+                       if ($this->mForm->elements[$name] && isset($this->mValues[$name])) {
+                                   $this->mForm->elements[$name]->setValue($this->mValues[$name]);
                    }
                }
                $this->mInitForm = true;
@@ -121,12 +121,12 @@ class ActionForm {
        
         $this->mValues[$name] = $value;
         if ($this->mForm) {
-               if (isset($this->mForm->mElements[$name])) {
-                       if ($this->mForm->mElements[$name]->cClassName=="DateField") {
+               if (isset($this->mForm->elements[$name])) {
+                       if ($this->mForm->elements[$name]->cClassName=="DateField") {
                                $dt = new DateAndTime($user->date_format, $value);
                                        $value = $dt->toString(DB_DATEFORMAT);
                        }
-                       $this->mForm->mElements[$name]->setValueSafe($value);
+                       $this->mForm->elements[$name]->setValueSafe($value);
                }
         }
     }
@@ -150,12 +150,12 @@ class ActionForm {
         if (is_array($this->mValues))
         foreach ($this->mValues as $name=>$value) {
                if ($this->mForm) {
-                       if (isset($this->mForm->mElements[$name])) {
-                               if ($this->mForm->mElements[$name]->cClassName=="DateField") {
+                       if (isset($this->mForm->elements[$name])) {
+                               if ($this->mForm->elements[$name]->cClassName=="DateField") {
                                        $dt = new DateAndTime($user->date_format, $value);
                                                $value = $dt->toString(DB_DATEFORMAT);
                                }
-                               $this->mForm->mElements[$name]->setValueSafe($value);
+                               $this->mForm->elements[$name]->setValueSafe($value);
                        }
                }
         }
@@ -199,8 +199,8 @@ class ActionForm {
                        if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]);
                        $el->setValueSafe(@$_SESSION[$this->mSessionCell . "_" .$el->getName()]);
                        
-                               if ($this->mForm && !isset($this->mForm->mElements[$ref_el["name"]])) {
-                                       $this->mForm->mElements[$ref_el["name"]] = &$el;
+                               if ($this->mForm && !isset($this->mForm->elements[$ref_el["name"]])) {
+                                       $this->mForm->elements[$ref_el["name"]] = &$el;
                                }
                        $this->mValues[$el->getName()] = $el->getValue();
                }
index a45b55a..b357fe5 100644 (file)
@@ -38,7 +38,7 @@ class Form {
   var $name = '';
   // TODO: refactoring ongoing down from here.
 
-       var $mElements = array();
+       var $elements = array();
        var $mRequest;
     
     function __construct($formName) {
@@ -50,11 +50,11 @@ class Form {
     }
 
     function &getElement($name) {
-       return $this->mElements[$name];
+       return $this->elements[$name];
     }
     
     function &getElements() {
-       return $this->mElements;
+       return $this->elements;
     }
     
        //// FORM element
@@ -69,7 +69,7 @@ class Form {
     function isSubmit()        {
        if (!isset($this->mRequest)) return false;
         $result = false;
-           foreach ($this->mElements as $el) {
+           foreach ($this->elements as $el) {
                if (strtolower(get_class($el))=="submit") {
                    $name = $el->getName();
                    $value = $this->mRequest->getAttribute($name);
@@ -195,7 +195,7 @@ class Form {
                        if (isset($arguments["onchange"])) $el->setOnChange($arguments["onchange"]);
                        if (isset($arguments["onclick"])) $el->setOnClick($arguments["onclick"]);
                        
-                       $this->mElements[$arguments["name"]] = &$el;
+                       $this->elements[$arguments["name"]] = &$el;
                }
        }
        
@@ -204,7 +204,7 @@ class Form {
                        if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]);
                
                        $el->setFormName($this->name);
-                       $this->mElements[$el->getName()] = &$el;
+                       $this->elements[$el->getName()] = &$el;
                }
        }
        
@@ -215,8 +215,8 @@ class Form {
         $html .= ' method="post"';
         
         // Add enctype for file upload forms.
-        foreach ($this->mElements as $elname=>$el) {
-            if (strtolower(get_class($this->mElements[$elname])) == 'uploadfile') {
+        foreach ($this->elements as $elname=>$el) {
+            if (strtolower(get_class($this->elements[$elname])) == 'uploadfile') {
                 $html .= ' enctype="multipart/form-data"';
                 break;
             }
@@ -228,9 +228,9 @@ class Form {
     
     function toStringCloseTag() {
        $html = "\n";
-       foreach ($this->mElements as $elname=>$el) {
-            if (strtolower(get_class($this->mElements[$elname]))=="hidden") {
-               $html .= $this->mElements[$elname]->toStringControl()."\n";
+       foreach ($this->elements as $elname=>$el) {
+            if (strtolower(get_class($this->elements[$elname]))=="hidden") {
+               $html .= $this->elements[$elname]->toStringControl()."\n";
             }
         }
         $html .= "</form>";
@@ -242,21 +242,21 @@ class Form {
         $vars['open'] = $this->toStringOpenTag();
         $vars['close'] = $this->toStringCloseTag();
         
-        foreach ($this->mElements as $elname=>$el) {
-            if (is_object($this->mElements[$elname])) 
-                $vars[$elname] = $this->mElements[$elname]->toArray();
+        foreach ($this->elements as $elname=>$el) {
+            if (is_object($this->elements[$elname])) 
+                $vars[$elname] = $this->elements[$elname]->toArray();
         }
 //print_r($vars);
         return $vars;
     }
     
     function getValueByElement($elname) {
-       return $this->mElements[$elname]->getValue();
+       return $this->elements[$elname]->getValue();
     }
     
     function setValueByElement($elname, $value) {
-       if (isset($this->mElements[$elname])) {
-               $this->mElements[$elname]->setValue($value);
+       if (isset($this->elements[$elname])) {
+               $this->elements[$elname]->setValue($value);
        }
     }
 }
index 8ee5f96..68066f5 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.3584 | 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.3585 | 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>