mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
ExtensibleSetElement: failsafe rendering
This commit is contained in:
parent
685e42d325
commit
5b61b76076
@ -305,17 +305,29 @@ class ExtensibleSetElement extends BaseHtmlElement
|
|||||||
if ($this->inheritedFrom === null) {
|
if ($this->inheritedFrom === null) {
|
||||||
return \sprintf(
|
return \sprintf(
|
||||||
$this->translate('%s (inherited)'),
|
$this->translate('%s (inherited)'),
|
||||||
\implode(', ', $this->inherited)
|
$this->stringifyInheritedValue()
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return \sprintf(
|
return \sprintf(
|
||||||
$this->translate('%s (inherited from %s)'),
|
$this->translate('%s (inherited from %s)'),
|
||||||
\implode(', ', $this->inherited),
|
$this->stringifyInheritedValue(),
|
||||||
$this->inheritedFrom
|
$this->inheritedFrom
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function stringifyInheritedValue()
|
||||||
|
{
|
||||||
|
if (\is_array($this->inherited)) {
|
||||||
|
return \implode(', ', $this->inherited);
|
||||||
|
} else {
|
||||||
|
return \sprintf(
|
||||||
|
$this->translate('%s (not an Array!)'),
|
||||||
|
\var_export($this->inherited, 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function createAddNewButton()
|
private function createAddNewButton()
|
||||||
{
|
{
|
||||||
return $this->newInlineButtons(
|
return $this->newInlineButtons(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user