getRestParams(); if (count($params) == 1 && is_numeric($params[0])) { $id = intval($params[0]); $this->_getDataObj()->setIdPost($id); if (($title = $this->_getDataObj()->getPostTitle())) { $url = htmlspecialchars(\Qs_SiteMap::getAliasByItem('Blog\\Admin\\') . '?action=edit&id=' . $id); $title = htmlspecialchars($title); $itemsName = htmlspecialchars($this->getConfig('itemsName')); $header = '' . $title . ' ' . $itemsName; $this->_doc->setHeader($header); } } else { $this->_doc->display404(); } return parent::exec(); } protected function _getNewForm(array $options = array()) { $options = array('defaults' => array('idPost' => $this->_getDataObj()->getIdPost())); return $this->_getFormInstance('new', $options); } protected function _doGoBack() { $backUrl = $this->_getBackUrl(PARENT_PAGE_FINAL, BASE_URL_LANGUAGE . '/' . PARENT_PAGE_FINAL); $this->_clearBackUrl(); \Qs_Http::redirect($backUrl); } protected function _getDefaultLinks() { $links = array('goBack' => 'Back to ' . \Qs_Application::getConfig('Blog\\Admin\\')->get('itemsName')); $links += parent::_getDefaultLinks(); return $links; } protected function _doAutocompleteValue() { $this->_doAutocompleteValueAjax(); } protected function _doAutocompleteValueAjax() { $query = \Qs_Request::getRequestValue('term'); $data = $this->_getDataObj()->getAutocompleteList($query); $this->_displayJson($data); } }