X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/6b3b1dd0cad8c4342008f139922e1ed26924bf2a..2ca13aad316873633c3fd9ba59ee2f5579d90272:/src/BIFE/Generic.php diff --git a/src/BIFE/Generic.php b/src/BIFE/Generic.php index a9baaf4..1e9e06d 100644 --- a/src/BIFE/Generic.php +++ b/src/BIFE/Generic.php @@ -26,7 +26,6 @@ // $Id$ // - // +X2C includes require_once 'BIFE/Container.php'; // ~X2C @@ -39,23 +38,24 @@ require_once 'BIFE/Container.php'; * @abstract */ class BIFE_Generic extends BIFE_Container { - /** - * Attribute list. - * - * @var array $attrs - * @access public - */ - var $attrs; + // ~X2C + // +X2C Operation 10 /** - * @var string $contents + * Constructor. + * + * @param array $attrs Attributes. + * + * @return void * @access public */ - var $contents; - - // ~X2C + function BIFE_Generic($attrs) // ~X2C + { + $this->__construct($attrs); + } + // -X2C - // +X2C Operation 10 + // +X2C Operation 51 /** * Constructor. * @@ -64,25 +64,29 @@ class BIFE_Generic extends BIFE_Container { * @return void * @access public */ - function BIFE_Generic($attrs) // ~X2C + function __construct($attrs) // ~X2C { - $this->attrs = $attrs; - $this->contents = ''; + parent::__construct($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,15 +96,14 @@ 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); - return $template->get(); + $this->attrs['CONTENTS'] = parent::render($template); + $template->group = ''; + return $template->parse(get_class($this), $this->attrs); } // -X2C