X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/ef3115fcba3b2589f2819538dc53e597822716d5..f36ac20c1ad9e4d0987240a7fd2e0438f492be9b:/src/BIFE/Generic.php?ds=sidebyside diff --git a/src/BIFE/Generic.php b/src/BIFE/Generic.php index 6b5258e..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,14 +105,15 @@ 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