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: * @return void
33: */
34: public function __construct($content = '', $class = '', $id = '') {
35: parent::__construct();
36: $this->setContent($content);
37: $this->_contentlessTag = false;
38: $this->setClass($class);
39: $this->setID($id);
40: }
41:
42: /**
43: * Sets the element's content
44: *
45: * @param string|object|array $content String with the content or a cHTML
46: * object to render or an array of strings / objects.
47: * @return cHTMLContentElement $this
48: */
49: public function setContent($content) {
50: return $this->_setContent($content);
51: }
52:
53: /**
54: * Appends code / objects to the content.
55: *
56: * @param string|object|array $content String with the content or a cHTML
57: * object to render or an array of strings / objects.
58: * @return cHTMLContentElement $this
59: */
60: public function appendContent($content) {
61: return $this->_appendContent($content);
62: }
63:
64: }
65: