From eeaec20873d25eb18ced843d76d3563766ac99cd Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 26 Mar 2014 07:58:00 +0000 Subject: [PATCH] Add support for server-side triggered CSS reload --- library/Icinga/Web/Controller/ActionController.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php index 300413b63..7429d89c8 100644 --- a/library/Icinga/Web/Controller/ActionController.php +++ b/library/Icinga/Web/Controller/ActionController.php @@ -68,6 +68,8 @@ class ActionController extends Zend_Controller_Action private $noXhrBody = false; + private $reloadCss = false; + private $windowId; // TODO: This would look better if we had a ModuleActionController @@ -149,6 +151,11 @@ class ActionController extends Zend_Controller_Action return $this->windowId; } + protected function reloadCss() + { + $this->reloadCss = true; + } + /** * Return a window-aware session by using the given prefix * @@ -370,6 +377,10 @@ class ActionController extends Zend_Controller_Action } } + if ($isXhr && ($this->reloadCss || $this->getParam('_reload') === 'css')) { + header('X-Icinga-CssReload: now'); + } + if ($isXhr && $this->noXhrBody) { header('X-Icinga-Container: ignore'); return;