X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/6b3b1dd0cad8c4342008f139922e1ed26924bf2a..93ebb6cfe68748103b065768c7cb530ebefc7543:/src/BIFE/Generic.php?ds=sidebyside diff --git a/src/BIFE/Generic.php b/src/BIFE/Generic.php index a9baaf4..c98bc49 100644 --- a/src/BIFE/Generic.php +++ b/src/BIFE/Generic.php @@ -26,7 +26,6 @@ // $Id$ // - // +X2C includes require_once 'BIFE/Container.php'; // ~X2C @@ -43,16 +42,10 @@ class BIFE_Generic extends BIFE_Container { * Attribute list. * * @var array $attrs - * @access public + * @access protected */ var $attrs; - /** - * @var string $contents - * @access public - */ - var $contents; - // ~X2C // +X2C Operation 10 @@ -66,23 +59,43 @@ class BIFE_Generic extends BIFE_Container { */ function BIFE_Generic($attrs) // ~X2C { - $this->attrs = $attrs; - $this->contents = ''; + $this->__construct($attrs); + } + // -X2C + + // +X2C Operation 51 + /** + * Constructor. + * + * @param array $attrs Attributes. + * + * @return void + * @access public + */ + function __construct($attrs) // ~X2C + { + parent::__construct(); + $this->attrs = $attrs; } // -X2C // +X2C Operation 11 /** - * Add contents to the widget. + * Add contents to the container. * - * @param string $contents Contents to add. + * @param mixed &$contents Contents to add. * * @return void * @access public */ - function addContents($contents) // ~X2C + function addContents(&$contents) // ~X2C { - $this->contents .= trim($contents); + if (is_string($contents)) { + $contents = trim($contents); + } + if ($contents) { + parent::addContents($contents); + } } // -X2C @@ -92,18 +105,19 @@ class BIFE_Generic extends BIFE_Container { * * @param HTML_Template_Sigma &$template Template to use to render the widget. * - * @return void + * @return string * @access public */ function render(&$template) // ~X2C { + $contents = parent::render($template); $template->loadTemplateFile(get_class($this).'.html'); $template->setVariable($this->attrs); - $template->setVariable('CONTENTS', $this->contents); + $template->setVariable('CONTENTS', $contents); return $template->get(); } // -X2C } // -X2C Class :Generic -?> +?> \ No newline at end of file