X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/timetracker.git/blobdiff_plain/a54eb1d17cccdf772ee46a2c1447b580cd532368..6d39778a39a1ac2441b00150ca8ecdb049d655fe:/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 fa58b786..1e692c31 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 @@ -52,11 +53,11 @@ class Table extends FormElement { } function setKeyField($value) { - $this->mKeyField = $value; + $this->mKeyField = $value; } function setData($data) { - if (is_array($data) && isset($data[0]) && is_array($data[0])) + if (is_array($data) && isset($data[0]) && is_array($data[0])) $this->mData = &$data; } @@ -110,6 +111,7 @@ class Table extends FormElement { foreach ($this->mColumns as $column) { $this->mColumnFields[] = $column->getField(); $this->mHeaders[] = $column->getHeader(); + $this->mFooters[] = $column->getFooter(); } } @@ -176,6 +178,27 @@ class Table extends FormElement { $html .= "\n"; } + // Print footers. + if (($this->mInteractive && (count($this->mFooters) > 1)) || (!$this->mInteractive && (count($this->mFooters) > 0))) { + $html .= "