mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Response: Add methods to override the client's window id
This commit is contained in:
parent
7bb9c8e25f
commit
d459e58aca
@ -61,6 +61,13 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
*/
|
*/
|
||||||
protected $rerenderLayout = false;
|
protected $rerenderLayout = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to send the current window ID to the client
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $overrideWindowId = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the auto-refresh interval
|
* Get the auto-refresh interval
|
||||||
*
|
*
|
||||||
@ -237,6 +244,29 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get whether to send the current window ID to the client
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function getOverrideWindowId()
|
||||||
|
{
|
||||||
|
return $this->overrideWindowId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether to send the current window ID to the client
|
||||||
|
*
|
||||||
|
* @param bool $overrideWindowId
|
||||||
|
*
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setOverrideWindowId($overrideWindowId = true)
|
||||||
|
{
|
||||||
|
$this->overrideWindowId = $overrideWindowId;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entry point for HTTP responses in JSON format
|
* Entry point for HTTP responses in JSON format
|
||||||
*
|
*
|
||||||
@ -262,6 +292,9 @@ class Response extends Zend_Controller_Response_Http
|
|||||||
$this->setHeader('X-Icinga-Rerender-Layout', 'yes', true);
|
$this->setHeader('X-Icinga-Rerender-Layout', 'yes', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($this->getOverrideWindowId()) {
|
||||||
|
$this->setHeader('X-Icinga-WindowId', Window::getInstance()->getId(), true);
|
||||||
|
}
|
||||||
if ($this->getRerenderLayout()) {
|
if ($this->getRerenderLayout()) {
|
||||||
$this->setHeader('X-Icinga-Container', 'layout', true);
|
$this->setHeader('X-Icinga-Container', 'layout', true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user