_getDataObj(); $params = array('action' => 'new'); if (is_numeric($categoryId = $dataObj->getFilter('categoryId'))) { $params['categoryId'] = $categoryId; } $links = array(); $links[] = array('title' => 'Add New ' . $dataObj->getConfig('itemName'), 'url' => $this->url($params)); $params['action'] = 'reorder'; $links['reorder'] = array( 'title' => 'Reorder ' . $dataObj->getConfig('itemsName'), 'url' => $this->url($params) ); if (!is_numeric($categoryId) && $dataObj->getCategoriesCount() > 1) { $onClick = "alert('Please select one of the " . htmlspecialchars(App_Faq_Category_Admin_Obj::getInstance()->getConfig('itemsName')) . " from the \"Search\" dropdown list above " . "to reorder its items.'); return false"; $links['reorder']['attribs'] = array( 'class' => 'warning', 'onclick' => $onClick, ); $links['reorder']['url'] = '#'; } $fullAlias = Qs_SiteMap::findFirst( null, array('type' => 'Faq_Category_Admin_'), null, 'fullAlias' );; if (false !== $fullAlias) { $link = array( 'title' => 'Manage ' . App_Faq_Category_Admin_Obj::getInstance()->getConfig('itemsName'), 'url' => $fullAlias ); array_unshift($links, $link); } return $links; } protected function _initAction() { parent::_initAction(); if (in_array($this->_action, array('reorder', 'updateOrder'))) { if (is_numeric($categoryId = Qs_Request::getGetValue('categoryId'))) { $this->_getDataObj()->addFilter(array('categoryId' => $categoryId)); } } return $this; } }