X-Git-Url: https://git.llucax.com/software/bife/bife-all.git/blobdiff_plain/83c0aaf19ae9241ba9f30da47013479ee761685e..93ebb6cfe68748103b065768c7cb530ebefc7543:/src/BIFE/Page.php?ds=sidebyside diff --git a/src/BIFE/Page.php b/src/BIFE/Page.php index 0d6455c..7f8fa30 100644 --- a/src/BIFE/Page.php +++ b/src/BIFE/Page.php @@ -27,7 +27,7 @@ // // +X2C includes -require_once 'BIFE/Generic.php'; +require_once 'BIFE/Root.php'; // ~X2C // +X2C Class 14 :Page @@ -36,7 +36,15 @@ require_once 'BIFE/Generic.php'; * * @access public */ -class BIFE_Page extends BIFE_Generic { +class BIFE_Page extends BIFE_Root { + /** + * Attributes. + * + * @var array $attrs + * @access protected + */ + var $attrs; + // ~X2C // +X2C Operation 15 @@ -66,6 +74,46 @@ class BIFE_Page extends BIFE_Generic { function __construct($attrs) // ~X2C { parent::__construct($attrs); + $this->attrs = $attrs; + } + // -X2C + + // +X2C Operation 93 + /** + * Adds contents to the container. + * + * @param mixed &$contents Contents to add. + * + * @return void + * @access public + */ + function addContents(&$contents) // ~X2C + { + if (is_string($contents)) { + $contents = trim($contents); + } + if ($contents) { + parent::addContents($contents); + } + } + // -X2C + + // +X2C Operation 90 + /** + * Returns the rendered widget as a string. + * + * @param HTML_Template_Sigma &$template Template to use to render the widget. + * + * @return string + * @access public + */ + function render(&$template) // ~X2C + { + $contents = parent::render($template); + $template->loadTemplateFile('bife_page.html'); + $template->setVariable($this->attrs); + $template->setVariable('CONTENTS', $contents); + return $template->get(); } // -X2C