mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 05:24:28 +02:00
Hide empty nodes in tools tree.
This commit is contained in:
parent
e72bc52e12
commit
e091d8e26a
1 changed files with 15 additions and 4 deletions
|
@ -105,10 +105,21 @@ class ToolsTreeBuilder
|
|||
$item->tag(['tree_tools', 'groups', $this->keyGenerator->generateKey()]);
|
||||
|
||||
$tree = [];
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.tools'), null, $this->getToolsNode());
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.edit'), null, $this->getEditNodes());
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.show'), null, $this->getShowNodes());
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.system'), null, $this->getSystemNodes());
|
||||
if (!empty($this->getToolsNode())) {
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.tools'), null, $this->getToolsNode());
|
||||
}
|
||||
|
||||
if (!empty($this->getEditNodes())) {
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.edit'), null, $this->getEditNodes());
|
||||
}
|
||||
if (!empty($this->getShowNodes())) {
|
||||
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.show'), null, $this->getShowNodes());
|
||||
}
|
||||
if (!empty($this->getSystemNodes())) {
|
||||
$tree[] = new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.system'), null, $this->getSystemNodes()
|
||||
);
|
||||
}
|
||||
|
||||
return $tree;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue