get('agrid.page_manager')->getAll(); $contentsList = $container->get('agrid.content_manager')->getAllContent(); //redirection vers la page d'acceuil return $this->render('@AGrid/agrid.home.html.twig', [ 'pagesList' => $pagesList, 'contentsList' => $contentsList ]); } public function pageLoader(string $lang, string $slugPage, ContainerInterface $container, Request $request) { $page = $container->get('agrid.slug_manager')->getMappedElement($lang, $slugPage, AGridPage::class); $detect = new Mobile_Detect(); return $this->render('@AGrid/renderer_front/page_cached.html.twig',['lang'=>$lang,'page'=>$page,'mode'=>'s']); } /** * @param AGridPage $page * @param string $lang * @param ContainerInterface $container * @param Request $request * @return Response */ public function addRoute(AGridPage $page, string $lang,ContainerInterface $container, Request $request): Response { // $page = $container->get('agrid.page_manager')->addRoute($page, $lang, $request->get('url')); // // return $this->render('@AGrid/referencement.slide.html.twig', [ // 'routingElement' => $page->getMapping($lang), // 'lang' => $lang // ]); } public function deleteRoute(AGridPage $page, string $lang, ContainerInterface $container, Request $request): Response { // $name = $request->get('name'); // $routingElement = $page->getMapping($lang); // // $container->get('agrid.route_manager')->removeRouteByName($routingElement, $name); // // return $this->render('@AGrid/referencement.redirections.html.twig', [ // 'routingElement' => $routingElement // ]); } public function seoSave(AGridPage $page, string $lang, ContainerInterface $container, Request $request): Response { $title = $request->get('title'); $description= $request->get('description'); $keywords= $request->get('keywords'); $image= $request->get('image'); $ogtype= $request->get('og_type'); $siteName= $request->get('sitename'); $twittercard= $request->get('twittercard'); // $routingElement = $page->getMapping($lang); // $container->get('agrid.route_manager')->updateSEO($routingElement, $title, $description, $keywords, $image, $siteName, $twittercard, $ogtype); // $container->get('agrid.page_manager')->makeCache($page); return new Response("OK"); } public function screenView(AGridPage $page, string $lang, string $mode, ContainerInterface $container, Request $request) { return $this->render('@AGrid/agrid_page_cashe/page.html.twig',['lang'=>$lang,'mode'=>$mode,'rows'=>$page->getContent()->getRows(),'page'=>$page]); } public function create(ContainerInterface $container){ $page = $container->get('agrid.page_manager')->createPage(); return $this->redirectToRoute('agrid_page_edit', [ 'page' => $page->getId(), ]); } public function edit(ContainerInterface $container, AGridPage $page, string $mode, string $lang){ //appel de la system box du filemanager // $systemBox = $container->get("net15.files.manager.main")->getSystemBox(); // $folder = $container->get("net15.files.manager.main")->userCreateFolder('photos'); // $systemBox->addChildren($folder); // $routingElement = $page->getMapping($lang); // // if(!$routingElement instanceof RoutingElement) $slug = $container->get('agrid.slug_manager')->getByMappedElement(AGridPage::class, $page->getId(), $lang); return $this->render('@AGrid/agrid_page/edit.html.twig', [ 'page' => $page, 'content' => $page->getContent(), 'mode' => $mode, 'lang' => $lang, 'seo_element' => $slug, 'metadatas' => '' ]); } }