diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-10 15:23:53 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-11-19 19:17:30 +0100 |
commit | 49b042dfdf33a0efd3c838e1476754e6019730d2 (patch) | |
tree | 6db14479ee9573cfdc44d435c0cc6d56bdae0c74 /src/Wallabag/CoreBundle/Controller/EntryController.php | |
parent | 398de40517356981a9fe1b9185f5f9e5e498c346 (diff) | |
download | wallabag-49b042dfdf33a0efd3c838e1476754e6019730d2.tar.gz wallabag-49b042dfdf33a0efd3c838e1476754e6019730d2.tar.zst wallabag-49b042dfdf33a0efd3c838e1476754e6019730d2.zip |
Added translations and currentRoute parameter
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 6 |
1 files changed, 4 insertions, 2 deletions
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 | |||
27 | * | 27 | * |
28 | * @return \Symfony\Component\HttpFoundation\Response | 28 | * @return \Symfony\Component\HttpFoundation\Response |
29 | */ | 29 | */ |
30 | public function searchFormAction(Request $request, $page) | 30 | public function searchFormAction(Request $request, $page, $currentRoute) |
31 | { | 31 | { |
32 | $form = $this->createForm(SearchEntryType::class); | 32 | $form = $this->createForm(SearchEntryType::class); |
33 | 33 | ||
@@ -39,6 +39,7 @@ class EntryController extends Controller | |||
39 | 39 | ||
40 | return $this->render('WallabagCoreBundle:Entry:search_form.html.twig', [ | 40 | return $this->render('WallabagCoreBundle:Entry:search_form.html.twig', [ |
41 | 'form' => $form->createView(), | 41 | 'form' => $form->createView(), |
42 | 'currentRoute' => $currentRoute, | ||
42 | ]); | 43 | ]); |
43 | } | 44 | } |
44 | 45 | ||
@@ -269,10 +270,11 @@ class EntryController extends Controller | |||
269 | { | 270 | { |
270 | $repository = $this->get('wallabag_core.entry_repository'); | 271 | $repository = $this->get('wallabag_core.entry_repository'); |
271 | $searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : ''); | 272 | $searchTerm = (isset($request->get('search_entry')['term']) ? $request->get('search_entry')['term'] : ''); |
273 | $currentRoute = (!is_null($request->get('currentRoute')) ? $request->get('currentRoute') : ''); | ||
272 | 274 | ||
273 | switch ($type) { | 275 | switch ($type) { |
274 | case 'search': | 276 | case 'search': |
275 | $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm); | 277 | $qb = $repository->getBuilderForSearchByUser($this->getUser()->getId(), $searchTerm, $currentRoute); |
276 | 278 | ||
277 | break; | 279 | break; |
278 | case 'untagged': | 280 | case 'untagged': |