_restAlias) { $this->_do404(); } else { $this->_getDataObj()->setPrimaryKey($this->_restAlias); $this->_action = 'view'; $this->_doc->getAuth()->setLoginUrl($this->_getLoginUrl()); $this->_doc->getAuth()->setBackUrl($this->url()); $this->_doc->authenticate(); } return parent::exec(); } protected function _getLoginUrl() { return Qs_SiteMap::findFirst(['idParent' => $this->_doc->getOption('idParent')], ['type' => 'User\\Login\\'], null, 'url'); } protected function _initPageSeo(array $item) { $this->_doc->setHeader($item['name'])->setTitle($item['name']); return parent::_initPageSeo($item); } protected function _prepareViewItem(array &$item) { $item['backUrl'] = MunicipalUtilitiesView::getRootPage('url'); $item['mapEmbedUrl'] = sprintf( $this->getConfig('mapEmbedUrl'), urlencode(CompanyModel::createAddress4Geocoding($item)), urlencode($item['latitude']), urlencode($item['longitude']) ); return parent::_prepareViewItem($item); } protected function _addViewItem() { $this->_doc->addScript('js/app/municipalUtilities/detailPage.js'); $this->_doc->addInitObject('app.municipalUtilities.DetailPage'); return parent::_addViewItem(); } }