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