addChild(new BSPrinterLabelElement($label)); $elm = new BSPrinterBaseElement('checkbox', $name, $value); $elm->setActive($checked); $tr->addChild($elm); return $tr; } // ################################################################### /** * Sets the CSS class to use. Use ":swap:" to alternate * * @param string CSS class */ public function setCssClass($class) { $this->cssClass = $class; } // ################################################################### /** * Returns the number of columns in this element * * @return integer Column count */ public function numberOfColumns() { return sizeof($this->children); } // ################################################################### /** * Adds a child node to the element * * @param BSPrinterElement A child element * * @return BSPrinterTableElement Returns the current object */ public function addChild(BSPrinterElement $child) { $this->children[] = $child; return $this; } // ################################################################### /** * Returns the HTML for all printed children elements * * @return string Printed HTML */ protected function _paintChildren() { $builder = ''; foreach ($this->children AS $child) { $builder .= "\n" . $child->paint() . "\n"; } return $builder; } // ################################################################### /** * Paints the entire table row * * @return string Table row HTML */ public function paint() { return "" . $this->_paintChildren() . ""; } } /*=====================================================================* || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>