get('agrid.news_feed.manager')->create($request->get('feed_name')); return new Response(''); } public function listNewsByFeed(AGridModule $module, ContainerInterface $container, Request $request){ /** * @var $feed AGridNewsFeed */ $feed = $container->get('agrid.news_feed.manager')->getOneById($request->get('feed_id')); $module_news_feed_list = $container->get('agrid.module.news_feed.manager')->getAllByModuleAndFeed($module, $feed); return $this->render('@AGrid/agrid_modules/news/list.news.by.module.and.feed.html.twig', ['listModulesNewsFeeds'=>$module_news_feed_list]); } // public function create(ContainerInterface $container){ // $news = $container->get('agrid.news_manager')->create_news(); // // // } public function createNews(AGridModule $module, ContainerInterface $container, Request $request){ $lang = $request->get('lang'); // $feed_id = $request->get('feed_id'); $news = $container->get('agrid.news_manager')->create_news(); // dump($request); // die(); return $this->redirectToRoute('agrid_news_edit', [ 'news' => $news->getId(), ]); } public function edit(ContainerInterface $container, AGridNews $news, string $mode, string $lang){ $slug = $container->get('agrid.slug_manager')->getByMappedElement(AGridNews::class, $news->getId(), $lang); return $this->render('@AGrid/agrid_modules/news/edit_news.html.twig', [ 'news' => $news, 'content' => $news->getContent(), 'mode' => $mode, 'lang' => $lang, 'seo_element' => $slug, 'metadatas' => '' ]); } public function newsParameters(AGridModule $module, ContainerInterface $container, Request $request){ // dump($module);die(); $lang = $request->get('lang'); $feed_id = $request->get('feed_id'); return $this->render('@AGrid/agrid_modules/news/news.parameters.html.twig', ['module'=>$module]); } public function default(ContainerInterface $container, Request $request){ $list_news = $container->get('agrid.news_manager')->getAll(); return $this->render('@AGrid/agrid_modules/news/list.all.news.html.twig', ['listNews'=>$list_news]); } public function NewsLoader(string $lang, string $slugNews, ContainerInterface $container, Request $request) { $page = $container->get('agrid.slug_manager')->getMappedElement($lang, $slugNews, AGridNews::class); return $this->render('@AGrid/renderer_front/news_cached.html.twig',['lang'=>$lang,'news'=>$slugNews,'mode'=>'s']); } 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]); } }