X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/cb8e3de960b758147b34d8323054e7de70548619..a54eb1d17cccdf772ee46a2c1447b580cd532368:/WEB-INF/lib/form/Table.class.php diff --git a/WEB-INF/lib/form/Table.class.php b/WEB-INF/lib/form/Table.class.php index 44685d46..fa58b786 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -41,15 +41,14 @@ class Table extends FormElement { var $mBgColor = '#ffffff'; var $mBgColorOver = '#eeeeff'; var $mWidth = ''; - var $cClassName = 'Table'; var $mTableOptions = array(); var $mRowOptions = array(); var $mHeaderOptions = array(); var $mProccessed = false; - function __construct($name, $value='') { + function __construct($name) { + $this->class = 'Table'; $this->name = $name; - $this->value = $value; } function setKeyField($value) { @@ -89,17 +88,17 @@ class Table extends FormElement { return @$this->mData[$rowindex][$this->mColumnFields[$colindex]]; } - function getValueAtName($rowindex,$fieldname) { + function getValueAtName($rowindex, $fieldname) { if (!$this->mProccessed) $this->_process(); return @$this->mData[$rowindex][$fieldname]; } function _process() { - $this->mProccessed = true; + $this->mProccessed = true; - if ($this->mInteractive) { + if ($this->mInteractive) { // Add a column of clickable checkboxes. - $column = new TableColumn("","getName()."_all\" onclick=\"setAll(this.checked)\">"); + $column = new TableColumn("","name."_all\" onclick=\"setAll(this.checked)\">"); import('form.CheckboxCellRenderer'); $cb = new CheckboxCellRenderer(); if ($this->getIAScript()) $cb->setOnChangeAdd($this->getIAScript()."(this)"); @@ -114,8 +113,7 @@ class Table extends FormElement { } } - function toStringControl() { - if (!$this->isRenderable()) return ""; + function getHtml() { if (!$this->mProccessed) $this->_process(); $html = ""; @@ -133,7 +131,7 @@ class Table extends FormElement { $html .= ">\n"; // Print headers. - if (($this->mInteractive && (count($this->mHeaders) > 1)) || (!$this->mInteractive && (count($this->mHeaders) > 0))) { + if (($this->mInteractive && (count($this->mHeaders) > 1)) || (!$this->mInteractive && (count($this->mHeaders) > 0))) { $html .= "mRowOptions) > 0) { foreach ($this->mRowOptions as $k=>$v) { @@ -191,7 +189,7 @@ class Table extends FormElement { // setAll - checks / unchecks all checkboxes in the table. $html .= "function setAll(value) {\n"; $html .= "\tfor (var i = 0; i < ".$this->getFormName().".elements.length; i++) {\n"; - $html .= "\t\tif ((".$this->getFormName().".elements[i].type=='checkbox') && (".$this->getFormName().".elements[i].name=='".$this->getName()."[]')) {\n"; + $html .= "\t\tif ((".$this->getFormName().".elements[i].type=='checkbox') && (".$this->getFormName().".elements[i].name=='".$this->name."[]')) {\n"; $html .= "\t\t\t".$this->getFormName().".elements[i].checked=value;\n"; if ($this->getIAScript()) { $html .= "\t\t\t".$this->getIAScript()."(".$this->getFormName().".elements[i]);\n";