src/Ease/TWB/Tabs.php
public function finalize()
    {
        if (is_null($this->activeTab)) {
            $this->activeTab = current(array_keys($this->tabs));
        }
        $tabsUl = $this->addItem(new \Ease\Html\UlTag(null,
                ['class' => 'nav nav-tabs', 'id' => $this->partName]));
        foreach ($this->tabs as $tabName => $tab) {
            $tabProperties = ['data-toggle' => 'tab'];
            if (key($tab) == 'ajax') {
                $tabProperties['data-url'] = current($tab);
            }
            $anchor = '#'.\Ease\Brick::lettersOnly( str_replace(['(',')'],'',$this->partName.$tabName));
            if ($tabName == $this->activeTab) {
                $tabsUl->addItem(new \Ease\Html\LiTag(new \Ease\Html\ATag($anchor,
                            $tabName, $tabProperties), ['class' => 'active']));
            } else {
                $tabsUl->addItem(new \Ease\Html\LiTag(new \Ease\Html\ATag($anchor,
                            $tabName, $tabProperties)));
            }
        }
        $tabDiv = $this->addItem(new \Ease\Html\DivTag(null,
                ['id' => $this->partName.'body', 'class' => 'tab-content']));
        foreach ($this->tabs as $tabName => $tab) {
            switch (key($tab)) {
                case 'static':
                    $tabContent = current($tab);
                    break;
                case 'ajax':
                    $tabContent = '';
                    break;
            }

            if ($tabName == $this->activeTab) {
                $tabDiv->addItem(new \Ease\Html\DivTag($tabContent,
                        ['id' => $this->partName.\Ease\Brick::lettersOnly($tabName),
                        'class' => 'tab-pane active',]));
            } else {
                $tabDiv->addItem(new \Ease\Html\DivTag($tabContent,
                        ['id' => $this->partName.\Ease\Brick::lettersOnly($tabName),
                        'class' => 'tab-pane',]));
            }
        }
        Part::twBootstrapize();


        if (key($this->tabs[$this->activeTab]) == 'ajax') {
            \Ease\Shared::webPage()->addJavaScript('
// load first tab content
$(\'#'.$this->partName.$this->activeTab.'\').load($(\'.active a\').attr("data-url"),function(result){
  $(\'.active a\').tab(\'show\');
});
');
        } else {
            \Ease\Shared::webPage()->addJavaScript(
                '
        $(\'#'.$this->partName.' a[href="#'.\Ease\Brick::lettersOnly($this->activeTab).'"]\').tab(\'show\');
', null, true
            );
        }
    }
public function finalize()
    {
        if (is_null($this->activeTab)) {
            $this->activeTab = current(array_keys($this->tabs));
        }
        $tabsUl = $this->addItem(new \Ease\Html\UlTag(null,
                ['class' => 'nav nav-tabs', 'id' => $this->partName]));
        foreach ($this->tabs as $tabName => $tab) {
            $tabProperties = ['data-toggle' => 'tab'];
            if (key($tab) == 'ajax') {
                $tabProperties['data-url'] = current($tab);
            }
            $anchor = '#'.\Ease\Brick::lettersOnly( str_replace(['(',')'],'',$this->partName.$tabName));
            if ($tabName == $this->activeTab) {
                $tabsUl->addItem(new \Ease\Html\LiTag(new \Ease\Html\ATag($anchor,
                            $tabName, $tabProperties), ['class' => 'active']));
            } else {
                $tabsUl->addItem(new \Ease\Html\LiTag(new \Ease\Html\ATag($anchor,
                            $tabName, $tabProperties)));
            }
        }
        $tabDiv = $this->addItem(new \Ease\Html\DivTag(null,
                ['id' => $this->partName.'body', 'class' => 'tab-content']));
        foreach ($this->tabs as $tabName => $tab) {
            switch (key($tab)) {
                case 'static':
                    $tabContent = current($tab);
                    break;
                case 'ajax':
                    $tabContent = '';
                    break;
            }

            if ($tabName == $this->activeTab) {
                $tabDiv->addItem(new \Ease\Html\DivTag($tabContent,
                        ['id' => $this->partName.\Ease\Brick::lettersOnly($tabName),
                        'class' => 'tab-pane active',]));
            } else {
                $tabDiv->addItem(new \Ease\Html\DivTag($tabContent,
                        ['id' => $this->partName.\Ease\Brick::lettersOnly($tabName),
                        'class' => 'tab-pane',]));
            }
        }
        Part::twBootstrapize();


        if (key($this->tabs[$this->activeTab]) == 'ajax') {
            \Ease\Shared::webPage()->addJavaScript('
// load first tab content
$(\'#'.$this->partName.$this->activeTab.'\').load($(\'.active a\').attr("data-url"),function(result){
  $(\'.active a\').tab(\'show\');
});
');
        } else {
            \Ease\Shared::webPage()->addJavaScript(
                '
        $(\'#'.$this->partName.' a[href="#'.\Ease\Brick::lettersOnly($this->activeTab).'"]\').tab(\'show\');
', null, true
            );
        }
    }
Vložení skriptu a divů do stránky.