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
1 changed files with 11 additions and 0 deletions

View File

@ -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;