object. This can have a parent or not: if it does, * then it will be painted as a child, otherwise it will act as a root. * * @author Blue Static * @copyright Copyright (c)2002 - [#]year[#], Blue Static * @version $Revision$ * @package ISSO * */ class BSPrinterRootElementForm extends BSPrinterRootElement { /** * The form's action (or the controller to respond to) * @var string */ private $controller; /** * Method to use * @var string */ private $action; /** * The form's name * @var string */ private $name; /** * This form is upload-ready * @var bool */ private $upload; // ################################################################### /** * Constructor */ public function __construct($controller, $action, $name = 'issoform') { $this->controller = $controller; $this->action = $action; $this->name = $name; } // ################################################################### /** * Should this form be used for upload? * * @param bool Upload? */ public function setUpload($upload) { $this->upload = $upload; } // ################################################################### /** * Adds a table row into the child list * * @param BSPrinterElement Table element */ public function addChild(BSPrinterElement $tr) { $this->children[] = $tr; } // ################################################################### /** * 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(); } return $builder; } // ################################################################### /** * Paints the * * @return string Table HTML code */ public function paint() { if (BSRegister::GetType('Router') AND (!defined('ISSO_ROUTER_NO_REWRITE') OR !constant('ISSO_ROUTER_NO_REWRITE'))) { $action = $this->controller . "." . $this->action; } else if (BSRegister::GetType('Router')) { $action = 'index.php?controller=' . $this->controller . '&action=' . $this->action; } else { $action = $this->controller; array_push($this->children, new BSPrinterBaseElement('hidden', 'action', $this->action)); } return "\nname . "\" action=\"$action\" method=\"post\"" . ($this->upload ? ' enctype="mime/multi-part"' : '') . ">\n" . $this->_paintChildren() . "\n"; } } /*=====================================================================* || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### \*=====================================================================*/ ?>