PATH:
home
/
letacommog
/
letaweb
/
protected
/
extensions
/
yiibooster
/
widgets
<?php /** *## TbTabView class file. * * @author Joe Blocher <yii@myticket.at> * @copyright Copyright © Joe Blocher 2012 * @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php) */ Yii::import('booster.widgets.TbTabs'); /** *## Class TbTabView * * Use TbTabView as replacement for Yii CTabView * * @package booster.widgets.grouping */ class TbTabView extends TbTabs { /** * @var array * * Additional data submitted to the views */ public $viewData; /** *### .normalizeTabs() * * Override from TbTabs * * @param array $tabs the tab configuration * @param array $panes a reference to the panes array * @param integer $i the current index * * @return array the items */ protected function normalizeTabs($tabs, &$panes, &$i = 0) { $id = $this->getId(); $items = array(); //---------------- new ------------------- //Check if has an active item $hasActiveItem = false; foreach ($tabs as $tab) { $hasActiveItem = isset($tab['active']) ? $tab['active'] : false; if ($hasActiveItem) { break; } } //---------------- end new ------------------- foreach ($tabs as $tab) { $item = $tab; if (isset($item['visible']) && $item['visible'] === false) { continue; } //---------------- new ------------------- //check first active if (!$hasActiveItem && $i == 0) { $item['active'] = true; } //title -> label if (isset($item['title'])) { if (!isset($item['label'])) { $item['label'] = $item['title']; } unset($item['title']); } //------ end new ---------------- if (!isset($item['itemOptions'])) { $item['itemOptions'] = array(); } $item['linkOptions']['data-toggle'] = 'tab'; if (isset($tab['items'])) { $item['items'] = $this->normalizeTabs($item['items'], $panes, $i); } else { if (!isset($item['id'])) { $item['id'] = $id . '_tab_' . ($i + 1); } $item['url'] = '#' . $item['id']; //if (!isset($item['content'])) removed // $item['content'] = ''; //--------------- new --------------- if (!isset($item['content'])) { if (isset($item['view'])) { if (isset($item['data'])) { if (is_array($this->viewData)) { $data = array_merge($this->viewData, $item['data']); } else { $data = $item['data']; } unset($item['data']); } else { $data = $this->viewData; } $item['content'] = $this->getController()->renderPartial($item['view'], $data, true); unset($item['view']); } else { $item['content'] = ''; } } //--------------- end new --------------- $content = $item['content']; unset($item['content']); if (!isset($item['paneOptions'])) { $item['paneOptions'] = array(); } $paneOptions = $item['paneOptions']; unset($item['paneOptions']); $paneOptions['id'] = $item['id']; $classes = array('tab-pane fade'); if (isset($item['active']) && $item['active']) { $classes[] = 'active in'; } $classes = implode(' ', $classes); if (isset($paneOptions['class'])) { $paneOptions['class'] .= ' ' . $classes; } else { $paneOptions['class'] = $classes; } $panes[] = CHtml::tag('div', $paneOptions, $content); $i++; // increment the tab-index } $items[] = $item; } return $items; } }
[+]
..
[-] TbTabView.php
[edit]
[-] TbNavbar.php
[edit]
[-] TbHighCharts.php
[edit]
[-] TbPager.php
[edit]
[-] TbLabel.php
[edit]
[-] TbActiveForm.php
[edit]
[-] TbPanel.php
[edit]
[-] TbJsonButtonColumn.php
[edit]
[-] TbModalManager.php
[edit]
[-] TbToggleColumn.php
[edit]
[-] TbUiLayout.php
[edit]
[-] TbBaseMenu.php
[edit]
[-] widgets.md
[edit]
[-] TbEditableDetailView.php
[edit]
[-] TbButtonGroup.php
[edit]
[-] TbEditable.php
[edit]
[-] TbFileUpload.php
[edit]
[-] TbEditableField.php
[edit]
[-] TbTags.php
[edit]
[-] TbFormButtonElement.php
[edit]
[-] TbFormInputElement.php
[edit]
[-] TbJsonPager.php
[edit]
[-] TbCollapse.php
[edit]
[-] TbBulkActions.php
[edit]
[-] TbRelationalColumn.php
[edit]
[-] TbTabs.php
[edit]
[-] TbModal.php
[edit]
[-] TbExtendedGridView.php
[edit]
[-] TbJumbotron.php
[edit]
[-] TbImageGallery.php
[edit]
[-] TbWidget.php
[edit]
[-] TbMenu.php
[edit]
[-] TbProgress.php
[edit]
[-] TbButtonColumn.php
[edit]
[-] TbJsonToggleColumn.php
[edit]
[-] TbJsonPickerColumn.php
[edit]
[-] TbColorPicker.php
[edit]
[-] TbButtonGroupColumn.php
[edit]
[-] TbSwitch.php
[edit]
[-] TbHeroUnit.php
[edit]
[-] TbDatePicker.php
[edit]
[-] TbJsonCheckBoxColumn.php
[edit]
[-] TbButton.php
[edit]
[-] TbTypeahead.php
[edit]
[-] TbForm.php
[edit]
[-] TbPassfield.php
[edit]
[-] TbEditableColumn.php
[edit]
[-] TbMarkdownEditorJs.php
[edit]
[-] TbPopoverColumn.php
[edit]
[-] TbMarkdownEditor.php
[edit]
[-] TbAlert.php
[edit]
[-] TbGroupGridView.php
[edit]
[-] TbBaseInputWidget.php
[edit]
[-] TbWizard.php
[edit]
[-] TbGroupButtonColumn.php
[edit]
[-] TbExtendedFilter.php
[edit]
[-] TbGoogleVisualizationChart.php
[edit]
[-] TbHtml5Editor.php
[edit]
[-] TbGridView.php
[edit]
[-] TbListView.php
[edit]
[-] TbTimePicker.php
[edit]
[-] TbJsonGridView.php
[edit]
[-] TbCKEditor.php
[edit]
[-] TbTotalSumColumn.php
[edit]
[-] TbDateRangePicker.php
[edit]
[-] TbBadge.php
[edit]
[-] TbDropdown.php
[edit]
[-] TbBreadcrumbs.php
[edit]
[-] TbJsonGridColumn.php
[edit]
[-] TbDateTimePicker.php
[edit]
[-] TbDataColumn.php
[edit]
[-] TbCarousel.php
[edit]
[-] TbJsonDataColumn.php
[edit]
[-] TbRedactorJs.php
[edit]
[-] TbThumbnails.php
[edit]
[-] TbScrollSpy.php
[edit]
[-] TbDetailView.php
[edit]
[+]
input
[-] TbSelect2.php
[edit]
[-] TbImageColumn.php
[edit]