Example #1
0
 /**
  * {@inheritdoc}
  */
 protected function _beforeToHtml()
 {
     if ($activeTab = $this->getRequest()->getParam('active_tab')) {
         $this->setActiveTab($activeTab);
     } elseif ($activeTabId = $this->_authSession->getActiveTabId()) {
         $this->_setActiveTab($activeTabId);
     }
     $_new = [];
     foreach ($this->_tabs as $key => $tab) {
         foreach ($this->_tabs as $k => $t) {
             if ($t->getAfter() == $key) {
                 $_new[$key] = $tab;
                 $_new[$k] = $t;
             } else {
                 if (!$tab->getAfter() || !in_array($tab->getAfter(), array_keys($this->_tabs))) {
                     $_new[$key] = $tab;
                 }
             }
         }
     }
     $this->_tabs = $_new;
     unset($_new);
     $this->assign('tabs', $this->_tabs);
     return parent::_beforeToHtml();
 }