mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
parent
c67ef17e86
commit
d479ab3536
@ -96,6 +96,13 @@ class Tab implements Widget
|
|||||||
*/
|
*/
|
||||||
private $iconCls = null;
|
private $iconCls = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Additional a tag attributes
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
private $tagParams;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets an icon image for this tab
|
* Sets an icon image for this tab
|
||||||
*
|
*
|
||||||
@ -166,6 +173,16 @@ class Tab implements Widget
|
|||||||
$this->urlParams = $urlParams;
|
$this->urlParams = $urlParams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set additional a tag attributes
|
||||||
|
*
|
||||||
|
* @param array $tagParams
|
||||||
|
*/
|
||||||
|
public function setTagParams(array $tagParams)
|
||||||
|
{
|
||||||
|
$this->tagParams = $tagParams;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Tab with the given properties
|
* Create a new Tab with the given properties
|
||||||
*
|
*
|
||||||
@ -215,7 +232,13 @@ class Tab implements Widget
|
|||||||
}
|
}
|
||||||
if ($this->url !== null) {
|
if ($this->url !== null) {
|
||||||
$this->url->overwriteParams($this->urlParams);
|
$this->url->overwriteParams($this->urlParams);
|
||||||
$tab = '<a href="' . $this->url->getAbsoluteUrl() . '">' . $caption . '</a>';
|
$tagParams = '';
|
||||||
|
if ($this->tagParams !== null) {
|
||||||
|
foreach ($this->tagParams as $key => $value) {
|
||||||
|
$tagParams .= ' ' . $key . '="' . $value . '"';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tab = '<a' . $tagParams .' href="' . $this->url->getAbsoluteUrl() . '">' . $caption . '</a>';
|
||||||
} else {
|
} else {
|
||||||
$tab = $caption;
|
$tab = $caption;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user