aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php19
-rw-r--r--src/Wallabag/CoreBundle/Controller/ExportController.php9
2 files changed, 26 insertions, 2 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index ba5bfbe2..2c4b5536 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -236,11 +236,25 @@ class EntryController extends Controller
236 } 236 }
237 237
238 /** 238 /**
239 * Shows entries with annotations for current user.
240 *
241 * @param int $page
242 *
243 * @Route("/with_annotations/list/{page}", name="with_annotations", defaults={"page" = "1"})
244 *
245 * @return \Symfony\Component\HttpFoundation\Response
246 */
247 public function showWithAnnotationsEntriesAction(Request $request, $page)
248 {
249 return $this->showEntries('with_annotations', $request, $page);
250 }
251
252 /**
239 * Shows random entry depending on the given type. 253 * Shows random entry depending on the given type.
240 * 254 *
241 * @param string $type 255 * @param string $type
242 * 256 *
243 * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|all"}) 257 * @Route("/{type}/random", name="random_entry", requirements={"type": "unread|starred|archive|untagged|with_annotations|all"})
244 * 258 *
245 * @return \Symfony\Component\HttpFoundation\RedirectResponse 259 * @return \Symfony\Component\HttpFoundation\RedirectResponse
246 */ 260 */
@@ -503,6 +517,9 @@ class EntryController extends Controller
503 case 'archive': 517 case 'archive':
504 $qb = $repository->getBuilderForArchiveByUser($this->getUser()->getId()); 518 $qb = $repository->getBuilderForArchiveByUser($this->getUser()->getId());
505 break; 519 break;
520 case 'with_annotations':
521 $qb = $repository->getBuilderForAnnotationsByUser($this->getUser()->getId());
522 break;
506 case 'unread': 523 case 'unread':
507 $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); 524 $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId());
508 break; 525 break;
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php
index cec8d499..8517e7a9 100644
--- a/src/Wallabag/CoreBundle/Controller/ExportController.php
+++ b/src/Wallabag/CoreBundle/Controller/ExportController.php
@@ -47,7 +47,7 @@ class ExportController extends Controller
47 * 47 *
48 * @Route("/export/{category}.{format}", name="export_entries", requirements={ 48 * @Route("/export/{category}.{format}", name="export_entries", requirements={
49 * "format": "epub|mobi|pdf|json|xml|txt|csv", 49 * "format": "epub|mobi|pdf|json|xml|txt|csv",
50 * "category": "all|unread|starred|archive|tag_entries|untagged|search" 50 * "category": "all|unread|starred|archive|tag_entries|untagged|search|with_annotations"
51 * }) 51 * })
52 * 52 *
53 * @return \Symfony\Component\HttpFoundation\Response 53 * @return \Symfony\Component\HttpFoundation\Response
@@ -80,6 +80,13 @@ class ExportController extends Controller
80 ->getResult(); 80 ->getResult();
81 81
82 $title = 'Search ' . $searchTerm; 82 $title = 'Search ' . $searchTerm;
83 } elseif ('with_annotations' === $category) {
84 $entries = $repository->getBuilderForAnnotationsByUser(
85 $this->getUser()->getId()
86 )->getQuery()
87 ->getResult();
88
89 $title = 'With annotations';
83 } else { 90 } else {
84 $entries = $repository 91 $entries = $repository
85 ->$methodBuilder($this->getUser()->getId()) 92 ->$methodBuilder($this->getUser()->getId())