]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
Added translations and currentRoute parameter
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index fc1697bed0913aa6132e95f83d276db67478c342..8c13255ec70bd9fabe44fc7b99cd84f4603425d6 100644 (file)
@@ -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':