mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
parent
a527a80c93
commit
3f2a2fa984
@ -7,6 +7,7 @@ use Icinga\Data\Filter\Filter;
|
|||||||
use Icinga\Web\Navigation\NavigationItem;
|
use Icinga\Web\Navigation\NavigationItem;
|
||||||
use Icinga\Module\Monitoring\Object\Macro;
|
use Icinga\Module\Monitoring\Object\Macro;
|
||||||
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
use Icinga\Module\Monitoring\Object\MonitoredObject;
|
||||||
|
use Icinga\Web\Url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action for monitored objects
|
* Action for monitored objects
|
||||||
@ -34,6 +35,13 @@ class Action extends NavigationItem
|
|||||||
*/
|
*/
|
||||||
protected $filter;
|
protected $filter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This action's raw url attribute
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $rawUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set this action's object
|
* Set this action's object
|
||||||
*
|
*
|
||||||
@ -80,14 +88,22 @@ class Action extends NavigationItem
|
|||||||
return $this->filter;
|
return $this->filter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function setUrl($url)
|
||||||
* {@inheritdoc}
|
{
|
||||||
*/
|
if (is_string($url)) {
|
||||||
|
$this->rawUrl = $url;
|
||||||
|
} else {
|
||||||
|
parent::setUrl($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
public function getUrl()
|
public function getUrl()
|
||||||
{
|
{
|
||||||
$url = parent::getUrl();
|
$url = parent::getUrl();
|
||||||
if (! $this->resolved && $url !== null) {
|
if (! $this->resolved && $url === null) {
|
||||||
$this->setUrl(Macro::resolveMacros($url->getAbsoluteUrl(), $this->getObject()));
|
$this->setUrl(Url::fromPath(Macro::resolveMacros($this->rawUrl, $this->getObject())));
|
||||||
$this->resolved = true;
|
$this->resolved = true;
|
||||||
return parent::getUrl();
|
return parent::getUrl();
|
||||||
} else {
|
} else {
|
||||||
@ -95,9 +111,6 @@ class Action extends NavigationItem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@inheritdoc}
|
|
||||||
*/
|
|
||||||
public function getRender()
|
public function getRender()
|
||||||
{
|
{
|
||||||
if ($this->render === null) {
|
if ($this->render === null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user