1: <?php
2:
3: /**
4: * This file contains the cHTMLIFrame 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: * cHTMLIFrame class represents an iframe.
21: *
22: * @package Core
23: * @subpackage GUI_HTML
24: */
25: class cHTMLIFrame extends cHTML {
26:
27: /**
28: * Creates an HTML iframe element.
29: */
30: public function __construct() {
31: parent::__construct();
32: $this->_contentlessTag = false;
33: $this->_tag = 'iframe';
34: }
35:
36: /**
37: * Sets this frame's source
38: *
39: * @param string|object $content
40: * String with the content or an object to render.
41: * @return cHTMLIFrame
42: * $this for chaining
43: */
44: public function setSrc($src) {
45: return $this->updateAttribute('src', $src);
46: }
47:
48: /**
49: * Sets this frame's width
50: *
51: * @param string $width
52: * Width of the item
53: * @return cHTMLIFrame
54: * $this for chaining
55: */
56: public function setWidth($width) {
57: return $this->updateAttribute('width', $width);
58: }
59:
60: /**
61: * Sets this frame's height
62: *
63: * @param string $height
64: * Height of the item
65: * @return cHTMLIFrame
66: * $this for chaining
67: */
68: public function setHeight($height) {
69: return $this->updateAttribute('height', $height);
70: }
71:
72: /**
73: * Sets wether this iframe should have a border or not
74: *
75: * @param string $border
76: * If 1 or true, this frame will have a border
77: * @return cHTMLIFrame
78: * $this for chaining
79: */
80: public function setBorder($border) {
81: return $this->updateAttribute('frameborder', intval($border));
82: }
83:
84: }
85: