protected function startup() { parent::startup(); if (($page = $this->pageRepository->findOneBy(array('special' => 'tags'))) === NULL) { $this->flashMessage($this->translator->translate('Page with tags does not exist.'), 'warning'); } else { $this->extendedPage = $this->getEntityManager()->getRepository($page->class)->findOneBy(array('page' => $page)); } }
protected function startup() { parent::startup(); if (!$this->pageRepository->findOneBy(array('special' => 'users'))) { $this->template->hideForm = true; $this->flashMessage($this->translator->translate('User page does not exist.'), 'warning', false); } if (!$this->extendedPage->userType) { $this->template->hideForm = true; $this->flashMessage($this->translator->translate('Userform has not been set'), 'warning', false); } }
/** * @param Exception * @return void */ public function renderDefault($exception) { if ($this->isAjax()) { // AJAX request? Just note this error in payload. $this->payload->error = TRUE; $this->terminate(); } $code = $exception->getCode(); Debugger::log("HTTP code {$code}: {$exception->getMessage()} in {$exception->getFile()}:{$exception->getLine()}", 'access'); if (in_array($code, array(403, 404, 500))) { $page = $this->pageRepository->findOneBy(array('special' => $code)); if ($page) { $this->forward(':Cms:Pages:Text:Route:', array('routeId' => $page->mainRoute->id, 'pageId' => $page->id)); } } }
protected function startup() { parent::startup(); if (($page = $this->pageRepository->findOneBy(array('special' => 'users'))) === NULL) { $this->flashMessage($this->translator->translate('User page does not exist.'), 'warning'); } else { $this->extendedPage = $this->getEntityManager()->getRepository($page->class)->findOneBy(array('page' => $page)); } if (!$this->type) { $this->type = key($this->securityManager->getUserTypes()); } }