import('form.FormElement');
class Checkbox extends FormElement {
- var $mChecked = false;
+ var $checked = false;
var $mOptions = null;
function __construct($name, $value = '') {
$this->value = $value;
}
- function setChecked($value) { $this->mChecked = $value; }
- function isChecked() { return $this->mChecked; }
+ function setChecked($value) { $this->checked = $value; }
+ function isChecked() { return $this->checked; }
function setData($value) { $this->mOptions = $value; }
function getData() { return $this->mOptions; }
-
- function getHtml() {
- if ($this->id=="") $this->id = $this->name;
-
- $html = "\n\t<input type=\"checkbox\"";
- $html .= " name=\"$this->name\" id=\"$this->id\"";
+ function getHtml() {
+ if ($this->id == '') $this->id = $this->name;
+
+ $html = "\n\t<input type=\"checkbox\"";
+ $html.= " id=\"$this->id\" name=\"$this->name\"";
+
+ if ($this->checked || (($this->value == $this->mOptions) && ($this->value != null)))
+ $html.= " checked=\"true\"";
if ($this->on_change!="")
$html .= " onchange=\"$this->on_change\"";
if ($this->style!="")
$html .= " style=\"$this->style\"";
- if ($this->mChecked || (($this->value == $this->mOptions) && ($this->value != null)))
- $html .= " checked=\"true\"";
+
if (!$this->isEnabled())
$html .= " disabled=\"disabled\"";
// | https://www.anuko.com/time_tracker/credits.htm
// +----------------------------------------------------------------------+
-// +----------------------------------------------------------------------+
-// |
-// | Class generates elements of specification HTML 4.01
-// | http://www.w3.org/TR/1999/REC-html401-19991224
-// |
-// +----------------------------------------------------------------------+
-
+// Form class is a container for HTML forms we use in the application.
+// It contains an array of $elements - which are individual input controls
+// belonging to a form.
class Form {
var $name = ''; // Form name.
var $elements = array(); // An array of input controls in form.
case 'checkbox':
import('form.Checkbox');
$el = new Checkbox($params['name']);
+ if (isset($params['checked'])) $el->setChecked(true);
+
// TODO: refactoring ongoing down from here.
- if (@$params["checked"]) $el->setChecked(true);
$el->setData(@$params["data"]);
break;
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.10.38.3618 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.10.38.3619 | Copyright © <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>