aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2019-11-18 17:26:41 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2020-04-30 15:48:20 +0200
commit38f7c4590362e4657402eb1b58ad29b44ec763a6 (patch)
treee4cb7e84ab18e501ac85c37ed82478423600f1da /src/Wallabag/CoreBundle/Controller/EntryController.php
parent557e810c1f2b2e662f163fc419014e80d5484e3a (diff)
downloadwallabag-38f7c4590362e4657402eb1b58ad29b44ec763a6.tar.gz
wallabag-38f7c4590362e4657402eb1b58ad29b44ec763a6.tar.zst
wallabag-38f7c4590362e4657402eb1b58ad29b44ec763a6.zip
Added button to show entries with the same domain
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php21
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;