2 // vim: set expandtab tabstop=4 softtabstop=4 shiftwidth=4:
3 // +--------------------------------------------------------------------+
4 // | BIFE - Buil It FastEr |
5 // +--------------------------------------------------------------------+
6 // | This file is part of BIFE. |
8 // | BIFE is free software; you can redistribute it and/or modify it |
9 // | under the terms of the GNU General Public License as published by |
10 // | the Free Software Foundation; either version 2 of the License, or |
11 // | (at your option) any later version. |
13 // | BIFE is distributed in the hope that it will be useful, but |
14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 // | General Public License for more details. |
18 // | You should have received a copy of the GNU General Public License |
19 // | along with Hooks; if not, write to the Free Software Foundation, |
20 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 // +--------------------------------------------------------------------+
22 // | Created: Wed May 17 18:16:54 ART 2003 |
23 // | Authors: Leandro Lucarella <luca@lugmen.org.ar> |
24 // +--------------------------------------------------------------------+
31 require_once 'BIFE/Container.php';
34 // +X2C Class 7 :Generic
36 * This is a generic and simple BIFE_Container implementation.
41 class BIFE_Generic extends BIFE_Container {
56 * @param array $attrs Attributes.
61 function BIFE_Generic($attrs) // ~X2C
63 $this->__construct($attrs);
71 * @param array $attrs Attributes.
76 function __construct($attrs) // ~X2C
78 parent::__construct();
79 $this->attrs = $attrs;
85 * Add contents to the widget.
87 * @param mixed &$contents Contents to add.
92 function addContents(&$contents) // ~X2C
94 if (is_string($contents)) {
95 $contents = trim($contents);
97 parent::addContents($contents);
103 * Renders the widget.
105 * @param HTML_Template_Sigma &$template Template to use to render the widget.
110 function render(&$template) // ~X2C
112 $template->loadTemplateFile(get_class($this).'.html');
113 $template->setVariable($this->attrs);
114 $template->setVariable('CONTENTS', parent::render($template));
115 return $template->get();
119 } // -X2C Class :Generic