mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2025-12-20 23:00:16 -05:00
TreeRenderer: Properly render sub-processes if viewed individually
This commit is contained in:
parent
35fe4cb943
commit
bb62fe7048
1 changed files with 9 additions and 6 deletions
|
|
@ -53,7 +53,11 @@ class TreeRenderer extends Renderer
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($nodes as $name => $node) {
|
foreach ($nodes as $name => $node) {
|
||||||
$html[] = $this->renderNode($bp, $node);
|
if ($node instanceof BpNode) {
|
||||||
|
$html[] = $this->renderNode($bp, $node);
|
||||||
|
} else {
|
||||||
|
$html[] = $this->renderChild($bp, $node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
|
@ -183,23 +187,22 @@ class TreeRenderer extends Renderer
|
||||||
$path[] = (string) $node;
|
$path[] = (string) $node;
|
||||||
foreach ($node->getChildren() as $name => $child) {
|
foreach ($node->getChildren() as $name => $child) {
|
||||||
if ($child instanceof BpNode) {
|
if ($child instanceof BpNode) {
|
||||||
$tbody->add($this->renderNode($bp, $child, $this->getCurrentPath()));
|
$tbody->add($this->renderNode($bp, $child, $path));
|
||||||
} else {
|
} else {
|
||||||
$this->renderChild($bp, $tbody, $child, $path);
|
$tbody->add($this->renderChild($bp, $child, $path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $table;
|
return $table;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function renderChild($bp, BaseHtmlElement $ul, Node $node, $path = null)
|
protected function renderChild($bp, Node $node, $path = null)
|
||||||
{
|
{
|
||||||
$li = Html::tag('li', [
|
$li = Html::tag('li', [
|
||||||
'class' => 'movable',
|
'class' => 'movable',
|
||||||
'id' => $this->getId($node, $path ?: []),
|
'id' => $this->getId($node, $path ?: []),
|
||||||
'data-node-name' => (string) $node
|
'data-node-name' => (string) $node
|
||||||
]);
|
]);
|
||||||
$ul->add($li);
|
|
||||||
|
|
||||||
if (! $this->isLocked()) {
|
if (! $this->isLocked()) {
|
||||||
$li->add($this->getActionIcons($bp, $node));
|
$li->add($this->getActionIcons($bp, $node));
|
||||||
|
|
@ -216,7 +219,7 @@ class TreeRenderer extends Renderer
|
||||||
$link->add($since);
|
$link->add($since);
|
||||||
}
|
}
|
||||||
|
|
||||||
$li->add($link);
|
return $li;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getActionIcons(BpConfig $bp, Node $node)
|
protected function getActionIcons(BpConfig $bp, Node $node)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue