protected function beforeAction($action)
{
// Automatic file inclusion unless it's an ajax call
if ($this->assetPath && !Yii::app()->getRequest()->getIsAjaxRequest()) {
if (!$this->isPrintAction($action->id)) {
// nested elements behaviour
//TODO: possibly put this into standard js library for events
Yii::app()->getClientScript()->registerScript('nestedElementJS', 'var moduleName = "' . $this->getModule()->name . '";', CClientScript::POS_HEAD);
Yii::app()->assetManager->registerScriptFile('js/nested_elements.js');
}
}
$this->setFirmFromSession();
if (!isset($this->firm)) {
// No firm selected, reject
throw new CHttpException(403, 'You are not authorised to view this page without selecting a firm.');
}
$this->initAction($action->id);
$this->verifyActionAccess($action);
return parent::beforeAction($action);
}