From 4f4df95a604a5c11fe7ba793b18f025b13ef1fb6 Mon Sep 17 00:00:00 2001 From: anuko Date: Thu, 16 Feb 2017 20:01:22 +0000 Subject: [PATCH] Resumed refactoring forms, hopefully without breaking reports this time. --- WEB-INF/lib/form/ActionForm.class.php | 1 - WEB-INF/lib/form/Form.class.php | 31 +-------------------------- WEB-INF/templates/footer.tpl | 2 +- 3 files changed, 2 insertions(+), 32 deletions(-) diff --git a/WEB-INF/lib/form/ActionForm.class.php b/WEB-INF/lib/form/ActionForm.class.php index 739cc3aa..be77649e 100644 --- a/WEB-INF/lib/form/ActionForm.class.php +++ b/WEB-INF/lib/form/ActionForm.class.php @@ -222,4 +222,3 @@ class ActionForm { return (isset($_SESSION[$this->mSessionCell . "session_store_elements"]) ? true : false); } } - diff --git a/WEB-INF/lib/form/Form.class.php b/WEB-INF/lib/form/Form.class.php index 0fcbd620..a45b55a3 100644 --- a/WEB-INF/lib/form/Form.class.php +++ b/WEB-INF/lib/form/Form.class.php @@ -38,9 +38,7 @@ class Form { var $name = ''; // TODO: refactoring ongoing down from here. - var $error; - var $debugFunction; - var $mElements = array(); + var $mElements = array(); var $mRequest; function __construct($formName) { @@ -83,15 +81,6 @@ class Form { return $result; } - function OutputError($error,$scope="") - { - $this->error=(strcmp($scope,"") ? $scope.": ".$error : $error); - if(strcmp($function=$this->debugFunction,"") - && strcmp($this->error,"")) - $function($this->error); - return($this->error); - } - //// INPUT element // type = TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON // name @@ -107,18 +96,6 @@ class Form { // onselect - INPUT and TEXTAREA // onchange function addInput($arguments) { - if(strcmp(gettype($arguments),"array")) - $this->OutputError("arguments must be array","AddInput"); - - if(!isset($arguments["type"]) || !strcmp($arguments["type"],"")) - return($this->OutputError("Type not defined","AddInput")); - - if(!isset($arguments["name"]) || !strcmp($arguments["name"],"")) - return($this->OutputError("Name of element not defined","AddInput")); - - if (isset($this->mElements[$arguments["name"]])) - return($this->OutputError("it was specified '".$arguments["name"]."' name of an already defined input","AddInput")); - switch($arguments["type"]) { case "textfield": @@ -201,9 +178,6 @@ class Form { $el = new UploadFile($arguments["name"]); if (isset($arguments["maxsize"])) $el->setMaxSize($arguments["maxsize"]); break; - - default: - return($this->OutputError("Type not found for input element","AddInput")); } if ($el!=null) { $el->setFormName($this->name); @@ -227,9 +201,6 @@ class Form { function addInputElement(&$el) { if ($el && is_object($el)) { - if (!$el->getName()) - return($this->OutputError("no name in element","addInputElement")); - if (isset($GLOBALS["I18N"])) $el->setLocalization($GLOBALS["I18N"]); $el->setFormName($this->name); diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 2d4ac1d3..8ee5f962 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.10.38.3583 | Copyright © Anuko | +  Anuko Time Tracker 1.10.38.3584 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1