11 Yii::import(
'booster.widgets.TbMenu');
82 <li class="previous first" style="display:none;"><a href="#">First</a></li>
83 <li class="previous"><a href="#">Previous</a></li>
84 <li class="next last" style="display:none;"><a href="#">Last</a></li>
85 <li class="next"><a href="#">Next</a></li>
95 if (!isset($this->htmlOptions[
'id'])) {
96 $this->htmlOptions[
'id'] = $this->getId();
101 $validPlacements = array(
102 self::PLACEMENT_ABOVE,
103 self::PLACEMENT_BELOW,
104 self::PLACEMENT_LEFT,
105 self::PLACEMENT_RIGHT
108 if (isset($this->placement) && in_array($this->placement, $validPlacements)) {
112 if (!empty($classes)) {
113 $classes = implode(
' ', $classes);
114 if (isset($this->htmlOptions[
'class'])) {
115 $this->htmlOptions[
'class'] .=
' ' . $classes;
117 $this->htmlOptions[
'class'] = $classes;
127 public function run()
134 if ($this->addTabsNavBar) {
135 echo
'<div class="navbar"><div class="navbar-inner">';
137 $this->controller->widget(
138 'booster.widgets.TbMenu',
140 'stacked' => $this->stacked,
141 'type' => $this->type,
142 'encodeLabel' => $this->encodeLabel,
146 if ($this->addTabsNavBar) {
149 $tabs = ob_get_clean();
152 echo
'<div class="tab-content">';
153 echo implode(
'', $content);
156 $content = ob_get_clean();
158 echo CHtml::openTag(
'div', $this->htmlOptions);
159 echo $this->placement === self::PLACEMENT_BELOW ? $content .
$tabs :
$tabs . $content;
163 $cs = Yii::app()->getClientScript();
165 $cs->registerPackage(
'bootstrap.wizard');
168 if ($this->type && !isset($this->options[
'class'])) {
172 $options = CJavaScript::encode($this->options);
174 $cs->registerScript(__CLASS__ .
'#' . $id,
"jQuery('#{$id}').bootstrapWizard({$options});");
176 foreach ($this->events as $name => $handler) {
177 $handler = CJavaScript::encode($handler);
178 $cs->registerScript(__CLASS__ .
'#' . $id .
'_' . $name,
"jQuery('#{$id}').on('{$name}', {$handler});");
195 $id = $this->getId();
198 foreach (
$tabs as $tab) {
201 if (isset($item[
'visible']) && $item[
'visible'] ===
false) {
205 if (!isset($item[
'itemOptions'])) {
206 $item[
'itemOptions'] = array();
209 $item[
'linkOptions'][
'data-toggle'] =
'tab';
211 if (isset($tab[
'items'])) {
214 if (!isset($item[
'id'])) {
215 $item[
'id'] = $id .
'_tab_' . (
$i + 1);
218 $item[
'url'] =
'#' . $item[
'id'];
220 if (!isset($item[
'content'])) {
221 $item[
'content'] =
'';
224 $content = $item[
'content'];
225 unset($item[
'content']);
227 if (!isset($item[
'paneOptions'])) {
228 $item[
'paneOptions'] = array();
231 $paneOptions = $item[
'paneOptions'];
232 unset($item[
'paneOptions']);
234 $paneOptions[
'id'] = $item[
'id'];
236 $classes = array(
'tab-pane fade');
238 if (isset($item[
'active']) && $item[
'active']) {
239 $classes[] =
'active in';
242 $classes = implode(
' ', $classes);
243 if (isset($paneOptions[
'class'])) {
244 $paneOptions[
'class'] .=
' ' . $classes;
246 $paneOptions[
'class'] = $classes;
249 $panes[] = CHtml::tag(
'div', $paneOptions, $content);