From cb8e3de960b758147b34d8323054e7de70548619 Mon Sep 17 00:00:00 2001 From: anuko Date: Sun, 19 Feb 2017 22:14:28 +0000 Subject: [PATCH] Ongoing refactoring - renamed a variable. --- WEB-INF/lib/form/Calendar.class.php | 2 +- WEB-INF/lib/form/Checkbox.class.php | 6 +++--- WEB-INF/lib/form/CheckboxGroup.class.php | 16 ++++++++-------- WEB-INF/lib/form/Combobox.class.php | 8 ++++---- WEB-INF/lib/form/DateField.class.php | 6 +++--- WEB-INF/lib/form/FloatField.class.php | 8 ++++---- WEB-INF/lib/form/FormElement.class.php | 17 +++++++++-------- WEB-INF/lib/form/Hidden.class.php | 5 ++--- WEB-INF/lib/form/Submit.class.php | 6 +++--- WEB-INF/lib/form/Table.class.php | 6 +++--- WEB-INF/lib/form/TextArea.class.php | 5 ++--- WEB-INF/lib/form/TextField.class.php | 5 ++--- WEB-INF/lib/form/UploadFile.class.php | 5 ++--- WEB-INF/templates/footer.tpl | 2 +- 14 files changed, 47 insertions(+), 50 deletions(-) diff --git a/WEB-INF/lib/form/Calendar.class.php b/WEB-INF/lib/form/Calendar.class.php index 46fcd6eb..a64a0359 100644 --- a/WEB-INF/lib/form/Calendar.class.php +++ b/WEB-INF/lib/form/Calendar.class.php @@ -90,7 +90,7 @@ class Calendar extends FormElement { function toString($date="") { global $i18n; - $indate = $this->mValue; + $indate = $this->value; if (!$indate) $indate = strftime(DB_DATEFORMAT); if (!$this->isRenderable()) return ""; diff --git a/WEB-INF/lib/form/Checkbox.class.php b/WEB-INF/lib/form/Checkbox.class.php index 8ee4fea0..6822adf7 100644 --- a/WEB-INF/lib/form/Checkbox.class.php +++ b/WEB-INF/lib/form/Checkbox.class.php @@ -35,8 +35,8 @@ class Checkbox extends FormElement { function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setChecked($value) { $this->mChecked = $value; } @@ -62,7 +62,7 @@ class Checkbox extends FormElement { if ($this->mStyle!="") $html .= " style=\"$this->mStyle\""; - if ($this->mChecked || (($this->mValue == $this->mOptions) && ($this->mValue != null))) + if ($this->mChecked || (($this->value == $this->mOptions) && ($this->value != null))) $html .= " checked=\"true\""; if (!$this->isEnable()) diff --git a/WEB-INF/lib/form/CheckboxGroup.class.php b/WEB-INF/lib/form/CheckboxGroup.class.php index 759a0767..13f207d9 100644 --- a/WEB-INF/lib/form/CheckboxGroup.class.php +++ b/WEB-INF/lib/form/CheckboxGroup.class.php @@ -41,8 +41,8 @@ class CheckboxGroup extends FormElement { function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setChecked($value) { $this->mChecked = $value; } @@ -87,9 +87,9 @@ class CheckboxGroup extends FormElement { $optval = $optval[$this->mDataKeys[1]]; } $html = "name[]\" id=\"$this->id"."_".$i."\""; - if (is_array($this->mValue)) { - foreach ($this->mValue as $value) { - if (($value == $optkey) && ($value != null)) + if (is_array($this->value)) { + foreach ($this->value as $element) { + if (($element == $optkey) && ($element != null)) $html .= " checked=\"true\""; } } @@ -115,9 +115,9 @@ class CheckboxGroup extends FormElement { $optval = $optval[$this->mDataKeys[1]]; } $html = "name[]\" id=\"$this->id"."_".$i."\""; - if (is_array($this->mValue)) { - foreach ($this->mValue as $value) { - if (($value == $optkey) && ($value != null)) + if (is_array($this->value)) { + foreach ($this->value as $element) { + if (($element == $optkey) && ($element != null)) $html .= " checked=\"true\""; } } diff --git a/WEB-INF/lib/form/Combobox.class.php b/WEB-INF/lib/form/Combobox.class.php index 0e8ec06c..082765e8 100644 --- a/WEB-INF/lib/form/Combobox.class.php +++ b/WEB-INF/lib/form/Combobox.class.php @@ -48,8 +48,8 @@ class Combobox extends FormElement { function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setMultiple($value) { $this->mMultiple = $value; } @@ -95,7 +95,7 @@ class Combobox extends FormElement { if (is_array($this->mOptionsEmpty) && (count($this->mOptionsEmpty) > 0)) foreach ($this->mOptionsEmpty as $key=>$value) { $html .= "\n"; } if (is_array($this->mOptions) && (count($this->mOptions) > 0)) @@ -106,7 +106,7 @@ class Combobox extends FormElement { $value = $value[$this->mDataKeys[1]]; } $html .= "\n"; } diff --git a/WEB-INF/lib/form/DateField.class.php b/WEB-INF/lib/form/DateField.class.php index 24266a39..7075c42b 100644 --- a/WEB-INF/lib/form/DateField.class.php +++ b/WEB-INF/lib/form/DateField.class.php @@ -68,13 +68,13 @@ class DateField extends TextField { function setValueSafe($value) { if (isset($value) && (strlen($value) > 0)) { $this->mDateObj->parseVal($value, DB_DATEFORMAT); - $this->mValue = $this->mDateObj->toString($this->mDateFormat); //? + $this->value = $this->mDateObj->toString($this->mDateFormat); //? } } // get value for storing in session or database function getValueSafe() { - if (strlen($this->mValue)>0) { - $this->mDateObj->parseVal($this->mValue, $this->mDateFormat); //? + if (strlen($this->value)>0) { + $this->mDateObj->parseVal($this->value, $this->mDateFormat); //? return $this->mDateObj->toString(DB_DATEFORMAT); } else { return null; diff --git a/WEB-INF/lib/form/FloatField.class.php b/WEB-INF/lib/form/FloatField.class.php index 298e09bb..b5f8d0d4 100644 --- a/WEB-INF/lib/form/FloatField.class.php +++ b/WEB-INF/lib/form/FloatField.class.php @@ -54,19 +54,19 @@ class FloatField extends TextField { $value = sprintf('%'.$this->mFFormat.'f', $value); $value = str_replace('.', $this->mDelimiter, $value); } - $this->mValue = $value; + $this->value = $value; } function setValueSafe($value) { // '.' to ',' , apply delimiter if (strlen($value) > 0) - $this->mValue = str_replace('.', $this->mDelimiter, $value); + $this->value = str_replace('.', $this->mDelimiter, $value); } function getValueSafe() { // ',' to '.' - if (strlen($this->mValue) > 0) - return str_replace($this->mDelimiter, '.', $this->mValue); + if (strlen($this->value) > 0) + return str_replace($this->mDelimiter, '.', $this->value); return null; } } diff --git a/WEB-INF/lib/form/FormElement.class.php b/WEB-INF/lib/form/FormElement.class.php index f46e3bf2..209578dc 100644 --- a/WEB-INF/lib/form/FormElement.class.php +++ b/WEB-INF/lib/form/FormElement.class.php @@ -28,10 +28,11 @@ // FromElement is the base class for controls on forms. class FormElement { - var $id = ""; + var $id = ''; var $name; - var $form_name = ""; - var $mValue = ""; + var $form_name = ''; + var $value = ''; + // TODO: refactoring ongoing down from here. var $mSize = ""; var $mMaxLength = ""; var $mTabindex = ""; @@ -53,17 +54,17 @@ class FormElement { function getClass() { return $this->cClassName; } - function setName($name) { $this->name = $name; } + function setName($name) { $this->name = $name; } function getName() { return $this->name; } function setFormName($name) { $this->form_name = $name; } function getFormName() { return $this->form_name; } - function setValue($value) { $this->mValue = $value;} - function getValue() { return $this->mValue; } + function setValue($value) { $this->value = $value;} + function getValue() { return $this->value; } - function setValueSafe($value) { $this->mValue = $value;} - function getValueSafe() { return $this->mValue; } + function setValueSafe($value) { $this->value = $value;} + function getValueSafe() { return $this->value; } function setId($id) { $this->id = $id; } function getId() { return $this->id; } diff --git a/WEB-INF/lib/form/Hidden.class.php b/WEB-INF/lib/form/Hidden.class.php index 0105de15..cddb223a 100644 --- a/WEB-INF/lib/form/Hidden.class.php +++ b/WEB-INF/lib/form/Hidden.class.php @@ -29,13 +29,12 @@ import('form.FormElement'); class Hidden extends FormElement { - var $mValue; var $cClassName = "Hidden"; function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function toStringControl() { diff --git a/WEB-INF/lib/form/Submit.class.php b/WEB-INF/lib/form/Submit.class.php index bcfe3be2..c4a2c0d6 100644 --- a/WEB-INF/lib/form/Submit.class.php +++ b/WEB-INF/lib/form/Submit.class.php @@ -33,8 +33,8 @@ class Submit extends FormElement { function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function toStringControl() { @@ -49,7 +49,7 @@ class Submit extends FormElement { $html .= " disabled=\"true\""; } - $html .= " value=\"$this->mValue\""; + $html .= " value=\"$this->value\""; if ($this->mOnClick) { $html .= " onclick=\"".$this->mOnClick."\""; diff --git a/WEB-INF/lib/form/Table.class.php b/WEB-INF/lib/form/Table.class.php index 833bffac..44685d46 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -49,7 +49,7 @@ class Table extends FormElement { function __construct($name, $value='') { $this->name = $name; - $this->mValue = $value; + $this->value = $value; } function setKeyField($value) { @@ -160,8 +160,8 @@ class Table extends FormElement { if (0 == $col && strtolower(get_class($this->mColumns[$col]->getRenderer())) == 'checkboxcellrenderer') { // Checkbox for the row. Determine if selected. $selected = false; - if (is_array($this->mValue)) { - foreach ($this->mValue as $p) { + if (is_array($this->value)) { + foreach ($this->value as $p) { if ($p == $this->mData[$row][$this->mKeyField]) { $selected = true; break; diff --git a/WEB-INF/lib/form/TextArea.class.php b/WEB-INF/lib/form/TextArea.class.php index ecc2010b..6b3b5ee7 100644 --- a/WEB-INF/lib/form/TextArea.class.php +++ b/WEB-INF/lib/form/TextArea.class.php @@ -29,7 +29,6 @@ import('form.FormElement'); class TextArea extends FormElement { - var $mValue; var $mPassword = false; var $mColumns = ""; var $mRows = ""; @@ -37,8 +36,8 @@ class TextArea extends FormElement { function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setColumns($value) { $this->mColumns = $value; } diff --git a/WEB-INF/lib/form/TextField.class.php b/WEB-INF/lib/form/TextField.class.php index e1259d69..4766d911 100644 --- a/WEB-INF/lib/form/TextField.class.php +++ b/WEB-INF/lib/form/TextField.class.php @@ -29,14 +29,13 @@ import('form.FormElement'); class TextField extends FormElement { - var $mValue; var $mPassword = false; var $cClassName = "TextField"; function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setAsPassword($name) { $this->mPassword = $name; } diff --git a/WEB-INF/lib/form/UploadFile.class.php b/WEB-INF/lib/form/UploadFile.class.php index 98fbe0aa..97a2a8ca 100644 --- a/WEB-INF/lib/form/UploadFile.class.php +++ b/WEB-INF/lib/form/UploadFile.class.php @@ -29,14 +29,13 @@ import('form.FormElement'); class UploadFile extends FormElement { - var $mValue; var $cClassName = "UploadFile"; var $mMaxSize = 100000; // 100kb function __construct($name,$value="") { - $this->name = $name; - $this->mValue = $value; + $this->name = $name; + $this->value = $value; } function setMaxSize($value) { $this->mMaxSize = $value; } diff --git a/WEB-INF/templates/footer.tpl b/WEB-INF/templates/footer.tpl index 20116c55..fc9eb2b0 100644 --- a/WEB-INF/templates/footer.tpl +++ b/WEB-INF/templates/footer.tpl @@ -12,7 +12,7 @@
-
 Anuko Time Tracker 1.10.38.3594 | Copyright © Anuko | +  Anuko Time Tracker 1.10.38.3595 | Copyright © Anuko | {$i18n.footer.credits} | {$i18n.footer.license} | {$i18n.footer.improve} -- 2.20.1