diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 9b2954e7..fad2b51c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -518,6 +518,24 @@ class EntryController extends Controller | |||
518 | } | 518 | } |
519 | 519 | ||
520 | /** | 520 | /** |
521 | * List the entries with the same domain as the current one. | ||
522 | * | ||
523 | * @param int $page | ||
524 | * | ||
525 | * @Route("/same-domain/{id}/{page}", requirements={"id" = ".+"}, defaults={"page" = 1}, name="same_domain") | ||
526 | * | ||
527 | * @return \Symfony\Component\HttpFoundation\Response | ||
528 | */ | ||
529 | public function getSameDomainEntries(Request $request, $page = 1) | ||
530 | { | ||
531 | if (!$this->get('craue_config')->get('share_public')) { | ||
532 | throw $this->createAccessDeniedException('Sharing an entry is disabled for this user.'); | ||
533 | } | ||
534 | |||
535 | return $this->showEntries('same-domain', $request, $page); | ||
536 | } | ||
537 | |||
538 | /** | ||
521 | * Global method to retrieve entries depending on the given type | 539 | * Global method to retrieve entries depending on the given type |
522 | * It returns the response to be send. | 540 | * It returns the response to be send. |
523 | * | 541 | * |
@@ -548,6 +566,9 @@ class EntryController extends Controller | |||
548 | case 'unread': | 566 | case 'unread': |
549 | $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); | 567 | $qb = $repository->getBuilderForUnreadByUser($this->getUser()->getId()); |
550 | break; | 568 | break; |
569 | case 'same-domain': | ||
570 | $qb = $repository->getBuilderForSameDomainByUser($this->getUser()->getId(), $request->get('id')); | ||
571 | break; | ||
551 | case 'all': | 572 | case 'all': |
552 | $qb = $repository->getBuilderForAllByUser($this->getUser()->getId()); | 573 | $qb = $repository->getBuilderForAllByUser($this->getUser()->getId()); |
553 | break; | 574 | break; |