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