Response: Set `showCompact=1` on a redirect url..

..if compact layout has been requested.

refs #4164
fixes Icinga/icingadb-web#125
This commit is contained in:
Johannes Meyer 2021-01-11 15:13:31 +01:00
parent a3db4d1a5b
commit 500696c767
1 changed files with 4 additions and 0 deletions

View File

@ -287,6 +287,10 @@ class Response extends Zend_Controller_Response_Http
$redirectUrl = $this->getRedirectUrl();
if ($this->getRequest()->isXmlHttpRequest()) {
if ($redirectUrl !== null) {
if (Icinga::app()->getViewRenderer()->view->compact) {
$redirectUrl->getParams()->set('showCompact', true);
}
$this->setHeader('X-Icinga-Redirect', rawurlencode($redirectUrl->getAbsoluteUrl()), true);
if ($this->getRerenderLayout()) {
$this->setHeader('X-Icinga-Rerender-Layout', 'yes', true);