1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-27 17:28:39 +00:00

Added translations and currentRoute parameter

This commit is contained in:
Nicolas Lœuillet 2016-11-10 15:23:53 +01:00
parent 398de40517
commit 49b042dfdf
15 changed files with 57 additions and 8 deletions

View 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':