_restAlias) { if (is_numeric($this->_restParams[0]) && 1 == count($this->_restParams)) { $this->_defaultAction = 'view'; $this->_getDataObj()->setPrimaryKey($this->_restAlias); } else { $this->_do404(); return $this; } } return parent::exec(); } public function preDispatch(&$items) { if (!empty($this->_restAlias)) { foreach ($items as $index => $item) { if ($item['type'] == 'HtmlBlock_' && $item['groupName'] == 'ITEMS') { unset($items[$index]); } } } return $this; } protected function _doView() { $item = $this->_getDataObj()->getData(); if (empty($item) || $item['enabled'] != 'y') { $this->_doc->display404(); } $item['tpl'] = $this->getTemplate('view.tpl'); $item['config'] = $this->_getDataObj()->getConfig()->toArray(); $item['backUrl'] = $this->_getBackUrl(); if ($item['backUrl'] == '') { $item['backUrl'] = CURRENT_PAGE_FINAL; } Qs_Navigation::append(array('title' => $item['name'], 'url' => $item['backUrl'] . '/' . $item['id'])); $this->_addItem($item); $this->_postView(); return $this; } protected function _getBackUrl($sessionName = CURRENT_PAGE_FINAL) { $session = new Qs_Session_Namespace($sessionName); if (isset($session->backUrl)) { return $session->backUrl; } return BASE_URL_LANGUAGE . '/' . CURRENT_PAGE_FINAL; } }