2 /*=====================================================================*
3 || ###################################################################
4 || # Blue Static ISSO Framework [#]issoversion[#]
5 || # Copyright ©2002-[#]year[#] Blue Static
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
23 * Printer Table Element (PrinterTableElement.php)
28 require_once('ISSO/PrinterRootElementTable.php');
29 require_once('ISSO/PrinterBaseElement.php');
32 * Printer Table Element
34 * This represents a table row that holds elements.
37 * @copyright Copyright (c)2002 - [#]year[#], Blue Static
42 class BSPrinterTableElement
extends BSPrinterElement
46 * @var BSPrinterRootElementTable
54 private $cssClass = ':swap:';
57 * Array of child nodes
60 private $children = array();
65 function __construct(BSPrinterRootElementTable
$table)
67 $this->parent
= $table;
70 // ###################################################################
72 * Sets the CSS class to use. Use ":swap:" to alternate
74 * @param string CSS class
76 public function setCssClass($class)
78 $this->cssClass
= $class;
81 // ###################################################################
83 * Sets the parent element
85 public function setParent(BSPrinterElement
$parent)
87 trigger_error('Cannot set the parent element on a BSPrinterRootElement');
90 // ###################################################################
92 * Gets the parent element (none exist as this is the root element)
94 public function getParent()
99 // ###################################################################
101 * Returns the number of columns in this element
103 * @return integer Column count
105 public function numberOfColumns()
107 return sizeof($this->children
);
110 // ###################################################################
112 * Returns the HTML for all printed children elements
114 * @return string Printed HTML
116 protected function _paintChildren()
120 foreach ($this->children
AS $child)
122 $builder .= "\n<td>" . $child->paint() . "</td>\n";
128 // ###################################################################
130 * Paints the entire table row
132 * @return string Table row HTML
134 public function paint()
136 return "<tr>" . $this->_paintChildren() . "</tr>";
140 /*=====================================================================*
141 || ###################################################################
144 || ###################################################################
145 \*=====================================================================*/