@@ -7,38 +7,38 @@ |
||
| 7 | 7 | |
| 8 | 8 | class NavigationRepository extends EntityRepository |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * function that return all navigation links of pages and modules |
|
| 12 | - * @return array |
|
| 13 | - * @throws DBALException |
|
| 14 | - */ |
|
| 15 | - public function findAllNavigation(): array |
|
| 16 | - { |
|
| 17 | - $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 10 | + /** |
|
| 11 | + * function that return all navigation links of pages and modules |
|
| 12 | + * @return array |
|
| 13 | + * @throws DBALException |
|
| 14 | + */ |
|
| 15 | + public function findAllNavigation(): array |
|
| 16 | + { |
|
| 17 | + $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.url, p.title, p.title_tag FROM navigation n |
|
| 18 | 18 | LEFT JOIN page p ON n.id_page = p.id AND p.displayed = 1 |
| 19 | 19 | LEFT JOIN module m ON n.id_module = m.id AND m.displayed = 1 |
| 20 | 20 | ORDER BY n.order ASC |
| 21 | 21 | "); |
| 22 | 22 | |
| 23 | - $query->execute(); |
|
| 23 | + $query->execute(); |
|
| 24 | 24 | |
| 25 | - return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 26 | - } |
|
| 25 | + return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * function that return all navigation links of pages |
|
| 30 | - * @return array |
|
| 31 | - * @throws DBALException |
|
| 32 | - */ |
|
| 33 | - public function findAllNavigationPage(): array |
|
| 34 | - { |
|
| 35 | - $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.id, p.url, p.title, p.title_tag FROM navigation n |
|
| 28 | + /** |
|
| 29 | + * function that return all navigation links of pages |
|
| 30 | + * @return array |
|
| 31 | + * @throws DBALException |
|
| 32 | + */ |
|
| 33 | + public function findAllNavigationPage(): array |
|
| 34 | + { |
|
| 35 | + $query = $this->getEntityManager()->getConnection()->prepare("SELECT p.id, p.url, p.title, p.title_tag FROM navigation n |
|
| 36 | 36 | INNER JOIN page p ON n.id_page = p.id AND p.displayed = 1 |
| 37 | 37 | ORDER BY n.order ASC |
| 38 | 38 | "); |
| 39 | 39 | |
| 40 | - $query->execute(); |
|
| 40 | + $query->execute(); |
|
| 41 | 41 | |
| 42 | - return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 43 | - } |
|
| 42 | + return $query->fetchAll(\PDO::FETCH_ASSOC); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -8,26 +8,26 @@ |
||
| 8 | 8 | |
| 9 | 9 | class PageController extends AbstractController |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * @Route("/contents", name="ribsadmin_contents") |
|
| 13 | - * @return Response |
|
| 14 | - */ |
|
| 15 | - public function index(): Response |
|
| 16 | - { |
|
| 17 | - $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
|
| 11 | + /** |
|
| 12 | + * @Route("/contents", name="ribsadmin_contents") |
|
| 13 | + * @return Response |
|
| 14 | + */ |
|
| 15 | + public function index(): Response |
|
| 16 | + { |
|
| 17 | + $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
|
| 18 | 18 | |
| 19 | - return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]); |
|
| 20 | - } |
|
| 19 | + return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]); |
|
| 20 | + } |
|
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * @Route("/contents/edit-page/{page_id}", name="ribsadmin_contents_edit_page") |
|
| 24 | - * @param int $page_id |
|
| 25 | - * @return Response |
|
| 26 | - */ |
|
| 27 | - public function editPage(int $page_id): Response |
|
| 28 | - { |
|
| 29 | - $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
|
| 22 | + /** |
|
| 23 | + * @Route("/contents/edit-page/{page_id}", name="ribsadmin_contents_edit_page") |
|
| 24 | + * @param int $page_id |
|
| 25 | + * @return Response |
|
| 26 | + */ |
|
| 27 | + public function editPage(int $page_id): Response |
|
| 28 | + { |
|
| 29 | + $navigation = $this->getDoctrine()->getManager()->getRepository("RibsAdminBundle:Navigation")->findAllNavigationPage(); |
|
| 30 | 30 | |
| 31 | - return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]); |
|
| 32 | - } |
|
| 31 | + return $this->render('@RibsAdmin/page/index.html.twig', ["navigation" => $navigation]); |
|
| 32 | + } |
|
| 33 | 33 | } |