From 49b042dfdf33a0efd3c838e1476754e6019730d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 10 Nov 2016 15:23:53 +0100 Subject: Added translations and currentRoute parameter --- src/Wallabag/CoreBundle/Controller/EntryController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php') diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index fc1697be..8c13255e 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -27,7 +27,7 @@ class EntryController extends Controller * * @return \Symfony\Component\HttpFoundation\Response */ - public function searchFormAction(Request $request, $page) + public function searchFormAction(Request $request, $page, $currentRoute) { $form = $this->createForm(SearchEntryType::class); @@ -39,6 +39,7 @@ class EntryController extends Controller return $this->render('WallabagCoreBundle:Entry:search_form.html.twig', [ 'form' => $form->createView(), + 'currentRoute' => $currentRoute, ]); } @@ -269,10 +270,11 @@ class EntryController extends Controller { $repository = $this->get('wallabag_core.entry_repository'); $searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : ''); + $currentRoute = (!is_null($request->get('currentRoute')) ? $request->get('currentRoute') : ''); switch ($type) { case 'search': - $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm); + $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm, $currentRoute); break; case 'untagged': -- cgit v1.2.3