Add support for server-side triggered CSS reload

This commit is contained in:
Thomas Gelf 2014-03-26 07:58:00 +00:00
parent 87f90b6bdd
commit eeaec20873

View File

@ -68,6 +68,8 @@ class ActionController extends Zend_Controller_Action
private $noXhrBody = false; private $noXhrBody = false;
private $reloadCss = false;
private $windowId; private $windowId;
// TODO: This would look better if we had a ModuleActionController // TODO: This would look better if we had a ModuleActionController
@ -149,6 +151,11 @@ class ActionController extends Zend_Controller_Action
return $this->windowId; return $this->windowId;
} }
protected function reloadCss()
{
$this->reloadCss = true;
}
/** /**
* Return a window-aware session by using the given prefix * 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) { if ($isXhr && $this->noXhrBody) {
header('X-Icinga-Container: ignore'); header('X-Icinga-Container: ignore');
return; return;