_action) { $params = $this->getRestParams(); $paramsCount = count($params); if ($paramsCount == 0 && $defaultAlias = $this->_getDataObj()->getFirstCategoryAlias()) { $url = BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL . '/' . $defaultAlias; $this->redirect($url); } else if ($paramsCount == 1 && ($categoryId = $this->_getDataObj()->getCategoryDataByAlias($params[0])) && ($categoryId != AbstractObj::CATEGORY_ID_RFP) ) { $this->_getDataObj()->addFilter(['categoryId' => $categoryId]); $this->_getDataObj()->addFilter(['vendorId' => $this->_doc->getAuth()->getData('vendorId')]); } else { $this->_doc->display404(); } } return $this; } protected function _addListItem() { $this->_initListRedirection(); $item = $this->_getListItem(); $item['categoryId'] = $this->_getDataObj()->getFilter('categoryId'); $this->_initListPageNumber($item); $this->_addLinksItem(); $this->_addItem($item); if (Qs_Device::isMobile()) { $this->_doc->addScript('js/app/library/tabs.js'); $this->_doc->addInitObject('app.library.Tabs'); } return $this; } protected function _doList() { $this->_addTabsItem(); $this->_addFilterItem(); $this->_addListItem(); $this->_postList(); return $this; } protected function _addTabsItem() { $item = []; $item['tpl'] = $this->getTemplate('categories-tabs.tpl'); $item['categories'] = $this->_getLibraryCategories4Tabs(); $item['url'] = BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL; $item['current'] = $this->_getDataObj()->getCategoryAliasById($this->_getDataObj()->getFilter('categoryId')); $item['scrollToTabs'] = Qs_Device::isMobile(); $this->_addItem($item); return $this; } protected function _getLibraryCategories4Tabs() { $categories = $this->_getDataObj()->getDLibraryCategory4Select( ['alias', 'title'], 'id != ' . AbstractObj::CATEGORY_ID_RFP, 'sorter'); return $categories; } }