_restParams) > 1 || ($this->_restParams[0] && !ctype_digit($this->_restParams[0]))) { $this->_doc->display404(); } $categoryId = $this->_restAlias; /** @var $dataObj App_Faq_Obj */ $dataObj = $this->_getDataObj(); if (null == $categoryId) { $categoryId = $dataObj->getNotEmptyCategory(); if ($categoryId != 0) { Qs_Http::redirect(BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL . '/' . $categoryId); } } else if ($categoryId == 0) { Qs_Http::redirect(BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL, 301); } if (null !== $categoryId) { if ('0' == $categoryId) { $this->_category = array('id' => 0, 'title' => App_Faq_Obj::NO_CATEGORY_TITLE); } else if (false === ($this->_category = $dataObj->getCategoryData($categoryId)) || 0 == $this->_category['faqCount'] ) { $this->_doc->display404(); return false; } $dataObj->setCategoryId($categoryId); } if ($this->_category) { $this->_doc->appendTitle(' :: ' . $this->_category['title']); } return parent::exec(); } protected function _getList() { $this->_list = parent::_getList(); /** @var $dataObj App_Faq_Obj */ $dataObj = $this->_getDataObj(); $this->_list->categories = $dataObj->getNotEmptyCategories(); $this->_list->category = $this->_category; if ($this->_list->category['id'] == 0) { $this->_list->category['id'] = ''; } $ipp = $this->getConfig('ipp'); if (empty($ipp)) { $this->_list->setIsDisabledLimit(true); } else { $this->_list->setDefaultIpp($ipp); } return $this->_list; } protected function _getLog() { if (null === $this->_log) { parent::_getLog(); $this->_log->setAction('list', 'Viewed "%categoryTitle%" %itemsName% list'); } return $this->_log; } }