X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/6e59f47d1baf9e3d420b4a368dcc005d54b6e599..6578f26181e52e55c0e5451dfb1b802673289b9f:/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 833bffac..e5aed81d 100644 --- a/WEB-INF/lib/form/Table.class.php +++ b/WEB-INF/lib/form/Table.class.php @@ -34,6 +34,7 @@ class Table extends FormElement { var $mColumns = array(); // array of columns in table var $mData = null; // array of rows with data for column cells var $mHeaders = array(); // column headers + var $mFooters = array(); // column footers var $mInteractive = true; // adds a clickable checkbox column to table var $mIAScript = null; // sctipt to execute when a checkbox is clicked var $mKeyField = ''; // identifies a column used as key to access row data @@ -41,15 +42,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->mValue = $value; } function setKeyField($value) { @@ -89,17 +89,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)"); @@ -111,11 +111,11 @@ class Table extends FormElement { foreach ($this->mColumns as $column) { $this->mColumnFields[] = $column->getField(); $this->mHeaders[] = $column->getHeader(); + $this->mFooters[] = $column->getFooter(); } } - function toStringControl() { - if (!$this->isRenderable()) return ""; + function getHtml() { if (!$this->mProccessed) $this->_process(); $html = ""; @@ -133,7 +133,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 .= "