/** * Check set the default page title and layout title * don't allow this to be overridden past this point so authentication is always required * @SuppressWarnings(PHPMD.ExitExpression) */ public final function beforeAction() { parent::beforeAction(); if (!$this->checkIsAllowed($this->controllerName, $this->actionName)) { $this->addMessage('error', 'You have attempted to access an un-authorized resource.'); $this->redirect($this->path('welcome')); exit; } if ($this->_cycle and $this->_program) { if (!$this->checkIsAllowed('admin_changecycle')) { $this->_cycle = $this->_em->getRepository('\\Jazzee\\Entity\\Cycle')->findBestCycle($this->_program); } $this->setLayoutVar('pageTitle', $this->_cycle->getName() . ' ' . $this->_program->getName()); $this->setLayoutVar('layoutTitle', $this->_cycle->getName() . ' ' . $this->_program->getName()); } $this->addScript($this->path('resource/scripts/classes/Status.class.js')); $this->addScript($this->path('resource/scripts/classes/AuthenticationTimeout.class.js')); $this->addScript($this->path('resource/scripts/controllers/admin.controller.js')); $this->setup(); }