ActionController: set layout module name early

Didn't work correctly before
This commit is contained in:
Thomas Gelf 2014-07-04 12:33:49 +02:00
parent 485e2168c1
commit 3772b9c16f
2 changed files with 3 additions and 3 deletions

View File

@ -111,6 +111,8 @@ class ActionController extends Zend_Controller_Action
$this->handlerBrowserWindows();
$this->view->translationDomain = 'icinga';
$this->_helper->layout()->isIframe = $this->params->shift('isIframe');
$this->_helper->layout()->moduleName = false;
if ($this->rerenderLayout = $this->params->shift('renderLayout')) {
$this->xhrLayout = 'body';
}
@ -375,7 +377,6 @@ class ActionController extends Zend_Controller_Action
$req = $this->getRequest();
$layout = $this->_helper->layout();
$layout->moduleName = false;
if ($user = $req->getUser()) {
// Cast preference app.show_benchmark to bool because preferences loaded from a preferences storage are

View File

@ -24,6 +24,7 @@ class ModuleActionController extends ActionController
) {
parent::__construct($request, $response, $invokeArgs);
$this->moduleName = $request->getModuleName();
$this->_helper->layout()->moduleName = $this->moduleName;
$this->view->translationDomain = $this->moduleName;
$this->moduleInit();
}
@ -59,9 +60,7 @@ class ModuleActionController extends ActionController
{
$req = $this->getRequest();
$resp = $this->getResponse();
$layout = $this->_helper->layout();
$layout->moduleName = $this->moduleName;
if ($this->isXhr()) {
$resp->setHeader('X-Icinga-Module', $layout->moduleName);
}