X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/ef3115fcba3b2589f2819538dc53e597822716d5..83c0aaf19ae9241ba9f30da47013479ee761685e:/src/BIFE/Generic.php?ds=inline diff --git a/src/BIFE/Generic.php b/src/BIFE/Generic.php index 6b5258e..1cca645 100644 --- a/src/BIFE/Generic.php +++ b/src/BIFE/Generic.php @@ -47,12 +47,6 @@ class BIFE_Generic extends BIFE_Container { */ var $attrs; - /** - * @var string $contents - * @access public - */ - var $contents; - // ~X2C // +X2C Operation 10 @@ -66,8 +60,23 @@ 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 @@ -75,14 +84,17 @@ class BIFE_Generic extends BIFE_Container { /** * Add contents to the widget. * - * @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); + } + parent::addContents($contents); } // -X2C @@ -92,18 +104,18 @@ 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 { $template->loadTemplateFile(get_class($this).'.html'); $template->setVariable($this->attrs); - $template->setVariable('CONTENTS', $this->contents); + $template->setVariable('CONTENTS', parent::render($template)); return $template->get(); } // -X2C } // -X2C Class :Generic -?> \ No newline at end of file +?>