mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 01:25:55 +02:00
Added show all parts to tools tree.
This commit is contained in:
parent
c0f44b76f3
commit
570aa68535
2 changed files with 20 additions and 1 deletions
|
@ -67,7 +67,7 @@ class PartListsController extends AbstractController
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route("/parts")
|
* @Route("/parts", name="parts_show_all")
|
||||||
*
|
*
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param DataTableFactory $dataTable
|
* @param DataTableFactory $dataTable
|
||||||
|
|
|
@ -30,6 +30,8 @@
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Helpers\TreeViewNode;
|
use App\Helpers\TreeViewNode;
|
||||||
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Service generates the tree structure for the tools.
|
* This Service generates the tree structure for the tools.
|
||||||
|
@ -38,6 +40,16 @@ use App\Helpers\TreeViewNode;
|
||||||
class ToolsTreeBuilder
|
class ToolsTreeBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
|
protected $translator;
|
||||||
|
protected $urlGenerator;
|
||||||
|
|
||||||
|
public function __construct(TranslatorInterface $translator, UrlGeneratorInterface $urlGenerator)
|
||||||
|
{
|
||||||
|
$this->translator = $translator;
|
||||||
|
$this->urlGenerator = $urlGenerator;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates the tree for the tools menu.
|
* Generates the tree for the tools menu.
|
||||||
* @return TreeViewNode The array containing all Nodes for the tools menu.
|
* @return TreeViewNode The array containing all Nodes for the tools menu.
|
||||||
|
@ -52,6 +64,13 @@ class ToolsTreeBuilder
|
||||||
|
|
||||||
$tree[] = new TreeViewNode('test', 'www.google.de', $nodes);
|
$tree[] = new TreeViewNode('test', 'www.google.de', $nodes);
|
||||||
|
|
||||||
|
$show_nodes = array();
|
||||||
|
$show_nodes[] = new TreeViewNode($this->translator->trans('tree.tools.show.all_parts'),
|
||||||
|
$this->urlGenerator->generate('parts_show_all')
|
||||||
|
);
|
||||||
|
|
||||||
|
$tree[] = new TreeViewNode($this->translator->trans('tree.tools.show'), null, $show_nodes);
|
||||||
|
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue