From 8368d1ed9b3acdd13dc8ef325161661186935435 Mon Sep 17 00:00:00 2001 From: anuko Date: Mon, 20 Feb 2017 00:33:01 +0000 Subject: [PATCH] Refactoring - removedunused stuff and some renaming. --- WEB-INF/lib/form/Checkbox.class.php | 4 ++-- WEB-INF/lib/form/Combobox.class.php | 4 ++-- WEB-INF/lib/form/DateField.class.php | 4 ++-- WEB-INF/lib/form/FormElement.class.php | 18 ++++++++---------- WEB-INF/lib/form/TextField.class.php | 4 ++-- WEB-INF/templates/footer.tpl | 2 +- 6 files changed, 17 insertions(+), 19 deletions(-) diff --git a/WEB-INF/lib/form/Checkbox.class.php b/WEB-INF/lib/form/Checkbox.class.php index 428d4289..d79e5fe7 100644 --- a/WEB-INF/lib/form/Checkbox.class.php +++ b/WEB-INF/lib/form/Checkbox.class.php @@ -53,8 +53,8 @@ class Checkbox extends FormElement { $html = "\n\tname\" id=\"$this->id\""; - if ($this->mOnChange!="") - $html .= " onchange=\"$this->mOnChange\""; + if ($this->on_change!="") + $html .= " onchange=\"$this->on_change\""; if ($this->mStyle!="") $html .= " style=\"$this->mStyle\""; diff --git a/WEB-INF/lib/form/Combobox.class.php b/WEB-INF/lib/form/Combobox.class.php index a421b66a..78bd9962 100644 --- a/WEB-INF/lib/form/Combobox.class.php +++ b/WEB-INF/lib/form/Combobox.class.php @@ -79,8 +79,8 @@ class Combobox extends FormElement { if ($this->mMultiple) $html .= " multiple"; - if ($this->mOnChange!="") - $html .= " onchange=\"$this->mOnChange\""; + if ($this->on_change!="") + $html .= " onchange=\"$this->on_change\""; if ($this->mStyle!="") $html .= " style=\"$this->mStyle\""; diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index cf1bb08f..0ed220d9 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -403,8 +403,8 @@ class DateField extends TextField { $html .= " maxlength=\"50\""; - if ($this->mOnChange!="") - $html .= " onchange=\"$this->mOnChange\""; + if ($this->on_change!="") + $html .= " onchange=\"$this->on_change\""; if ($this->mOnClick!="") $html .= " onclick=\"$this->mOnClick\""; diff --git a/WEB-INF/lib/form/FormElement.class.php b/WEB-INF/lib/form/FormElement.class.php index 6bdca866..7bd28ab5 100644 --- a/WEB-INF/lib/form/FormElement.class.php +++ b/WEB-INF/lib/form/FormElement.class.php @@ -28,15 +28,14 @@ // FromElement is the base class for controls on forms. class FormElement { - var $id = ''; - var $name; - var $form_name = ''; - var $value = ''; - var $size = ''; - var $max_length = ''; + var $id = ''; // Control id. + var $name; // Control name. + var $form_name = ''; // Form name the control is in. + var $value = ''; // Value of the control. + var $size = ''; // Control size. + var $max_length = ''; // Max lenght of text in control. + var $on_change = ''; // What happens when value of control changes. // TODO: refactoring ongoing down from here. - var $mOnSelect = ""; - var $mOnChange = ""; var $mOnClick = ""; var $mOnKeyPress = ""; var $mOnFocus = ""; @@ -85,9 +84,8 @@ class FormElement { function setEnable($flag) { $this->mEnabled = $flag; } function isEnable() { return $this->mEnabled; } - function setOnChange($str) { $this->mOnChange = $str; } + function setOnChange($str) { $this->on_change = $str; } function setOnClick($str) { $this->mOnClick = $str; } - function setOnSelect($str) { $this->mOnSelect = $str; } function setLocalization($i18n) { $this->mI18n = $i18n; diff --git a/WEB-INF/lib/form/TextField.class.php b/WEB-INF/lib/form/TextField.class.php index 88fb434c..82d6af20 100644 --- a/WEB-INF/lib/form/TextField.class.php +++ b/WEB-INF/lib/form/TextField.class.php @@ -63,8 +63,8 @@ class TextField extends FormElement { if ($this->max_length!="") $html .= " maxlength=\"$this->max_length\""; - if ($this->mOnChange!="") - $html .= " onchange=\"$this->mOnChange\""; + if ($this->on_change!="") + $html .= " onchange=\"$this->on_change\""; $html .= " value=\"".htmlspecialchars($this->getValue())."\""; $html .= ">"; diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index dbfde959..1499b221 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.10.38.3598 | Copyright © Anuko | +  Anuko Time Tracker 1.10.38.3599 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1