mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-31 01:34:09 +02:00
Send PDF BEFORE we take care of custom headers
This commit is contained in:
parent
063939b73a
commit
9971030965
@ -283,6 +283,21 @@ class ActionController extends Zend_Controller_Action
|
|||||||
|
|
||||||
$this->addModuleContainer();
|
$this->addModuleContainer();
|
||||||
|
|
||||||
|
if ($user = $this->getRequest()->getUser()) {
|
||||||
|
// Cast preference app.showBenchmark to bool because preferences loaded from a preferences storage are
|
||||||
|
// always strings
|
||||||
|
if ((bool) $user->getPreferences()->get('app.showBenchmark', false) === true) {
|
||||||
|
Benchmark::measure('Response ready');
|
||||||
|
$this->_helper->layout()->benchmark = $this->renderBenchmark();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->_request->getParam('format') === 'pdf') {
|
||||||
|
$this->_helper->layout()->setLayout('pdf');
|
||||||
|
$this->sendAsPdf();
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->_request->isXmlHttpRequest() || $this->getParam('view') === 'compact') {
|
if ($this->_request->isXmlHttpRequest() || $this->getParam('view') === 'compact') {
|
||||||
$this->_helper->layout()->setLayout('inline');
|
$this->_helper->layout()->setLayout('inline');
|
||||||
}
|
}
|
||||||
@ -301,20 +316,6 @@ class ActionController extends Zend_Controller_Action
|
|||||||
if ($this->autorefreshInterval !== null) {
|
if ($this->autorefreshInterval !== null) {
|
||||||
header('X-Icinga-Refresh: ' . $this->autorefreshInterval);
|
header('X-Icinga-Refresh: ' . $this->autorefreshInterval);
|
||||||
}
|
}
|
||||||
if ($user = $this->getRequest()->getUser()) {
|
|
||||||
// Cast preference app.showBenchmark to bool because preferences loaded from a preferences storage are
|
|
||||||
// always strings
|
|
||||||
if ((bool) $user->getPreferences()->get('app.showBenchmark', false) === true) {
|
|
||||||
Benchmark::measure('Response ready');
|
|
||||||
$this->_helper->layout()->benchmark = $this->renderBenchmark();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($this->_request->getParam('format') === 'pdf' && $this->_request->getControllerName() !== 'static') {
|
|
||||||
$this->sendAsPdf();
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addModuleContainer()
|
protected function addModuleContainer()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user