-
Notifications
You must be signed in to change notification settings - Fork 33
/
EBootstrapTabContent.php
56 lines (47 loc) · 1.07 KB
/
EBootstrapTabContent.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/**
* Render a tab page
* The pages must be enclosed by one {@link EBootstrapTabContentWrapper} widget
*
* @author Tim Helfensdörfer <[email protected]>
* @version 0.3.0
* @package bootstrap.widgets.tabs
*/
class EBootstrapTabContent extends EBootstrapWidget {
/**
* ID of the widget
*
* The ID is important and has to match the id in the url of the {@link EBootstrapTabNavigation}
*/
public $id = null;
/**
* If this page should be active
*
* Only one page should be active
*/
public $active = false;
/**
* Init the widget
*
* Render header
*/
public function init() {
parent::init();
EBootstrap::mergeClass($this->htmlOptions, array('tab-pane'));
if ($this->active) {
EBootstrap::mergeClass($this->htmlOptions, array('active'));
}
if (is_null($this->id))
$this->id = $this->getId();
$this->htmlOptions['id'] = $this->id;
echo EBootstrap::openTag('div', $this->htmlOptions);
}
/**
* Render the footer of the widget
*/
public function run() {
parent::run();
echo EBootstrap::closeTag('div');
}
}
?>