aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-20 15:59:47 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-08-21 07:30:48 +0200
commit89659c9eae338cd29e5919b5ffde6924189a59ca (patch)
tree281d37681fb2ca8413f7c619cacdc356fe90c0a4 /src/Wallabag/CoreBundle/Controller/EntryController.php
parent109d67dbb16478f927c3d6a46ab61ea9994aafae (diff)
downloadwallabag-89659c9eae338cd29e5919b5ffde6924189a59ca.tar.gz
wallabag-89659c9eae338cd29e5919b5ffde6924189a59ca.tar.zst
wallabag-89659c9eae338cd29e5919b5ffde6924189a59ca.zip
filters: implement status filter and a new view (to display all entries)
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index dc399b8a..4070a603 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -102,6 +102,48 @@ class EntryController extends Controller
102 } 102 }
103 103
104 /** 104 /**
105 * Shows all entries for current user.
106 *
107 * @param Request $request
108 * @param int $page
109 *
110 * @Route("/all/list/{page}", name="all", defaults={"page" = "1"})
111 *
112 * @return \Symfony\Component\HttpFoundation\Response
113 */
114 public function showAllAction(Request $request, $page)
115 {
116 $form = $this->get('form.factory')->create(new EntryFilterType());
117
118 $filterBuilder = $this->getDoctrine()
119 ->getRepository('WallabagCoreBundle:Entry')
120 ->findAllByUser($this->getUser()->getId());
121
122 if ($request->query->has($form->getName())) {
123 // manually bind values from the request
124 $form->submit($request->query->get($form->getName()));
125
126 // build the query from the given form object
127 $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($form, $filterBuilder);
128 }
129
130 $pagerAdapter = new DoctrineORMAdapter($filterBuilder->getQuery());
131 $entries = new Pagerfanta($pagerAdapter);
132
133 $entries->setMaxPerPage($this->getUser()->getConfig()->getItemsPerPage());
134 $entries->setCurrentPage($page);
135
136 return $this->render(
137 'WallabagCoreBundle:Entry:entries.html.twig',
138 array(
139 'form' => $form->createView(),
140 'entries' => $entries,
141 'currentPage' => $page,
142 )
143 );
144 }
145
146 /**
105 * Shows unread entries for current user. 147 * Shows unread entries for current user.
106 * 148 *
107 * @param Request $request 149 * @param Request $request