| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class NavigationBuilderController extends Controller |
||
| 10 | { |
||
| 11 | private $nav = []; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @return Response function that display the left navigation mapped by user rights |
||
| 15 | */ |
||
| 16 | public function getLeftNavigationAction(): Response |
||
| 17 | { |
||
| 18 | $navigation = json_decode(file_get_contents($this->get("ribs_admin.globals")->getBaseBundlePath() . "/Resources/json/navigation.json"), true); |
||
| 19 | |||
| 20 | foreach ($navigation["items"] as $item) { |
||
| 21 | if ($this->get("ribs_admin.acess_rights")->testRight($item["right"])) { |
||
| 22 | $this->nav[] = $item; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | $this->getModuleNavigation(); |
||
| 27 | |||
| 28 | return $this->render("@RibsAdmin/navigation.html.twig", ["navigation" => $this->nav]); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * to get all modules navigation and test right navigation |
||
| 33 | */ |
||
| 34 | private function getModuleNavigation() |
||
| 47 | ]; |
||
| 48 | } |
||
| 50 | } |