1: <?php
2: /**
3: * This file contains the cHTMLContentElement class.
4: *
5: * @package Core
6: * @subpackage GUI_HTML
7: * @version SVN Revision $Rev:$
8: *
9: * @author Simon Sprankel
10: * @copyright four for business AG <www.4fb.de>
11: * @license http://www.contenido.org/license/LIZENZ.txt
12: * @link http://www.4fb.de
13: * @link http://www.contenido.org
14: */
15:
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17:
18: /**
19: * cHTMLContentElement class represents an element which can contain content.
20: *
21: * @package Core
22: * @subpackage GUI_HTML
23: */
24: class cHTMLContentElement extends cHTML {
25:
26: /**
27: * Constructor.
28: *
29: * @param mixed $content String or object with the contents
30: * @param string $class the class of this element
31: * @param string $id the ID of this element
32: */
33: public function __construct($content = '', $class = '', $id = '') {
34: parent::__construct();
35: $this->setContent($content);
36: $this->_contentlessTag = false;
37: $this->setClass($class);
38: $this->setID($id);
39: }
40:
41: /**
42: * Sets the element's content
43: *
44: * @param string|object|array $content String with the content or a cHTML
45: * object to render or an array of strings / objects.
46: * @return cHTMLContentElement $this
47: */
48: public function setContent($content) {
49: return $this->_setContent($content);
50: }
51:
52: /**
53: * Appends code / objects to the content.
54: *
55: * @param string|object|array $content String with the content or a cHTML
56: * object to render or an array of strings / objects.
57: * @return cHTMLContentElement $this
58: */
59: public function appendContent($content) {
60: return $this->_appendContent($content);
61: }
62:
63: }
64: