X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=041fe71ca77af8166e7787d1202c157af4af340d;hb=831b02aaf2709d632453a03ab8eb2663fb947497;hp=2f3fd6a9348ab6ec26c0ae1b301de95610e3778b;hpb=e6a228c43bf98f64d2d046314bae224c5b87399e;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 2f3fd6a9..041fe71c 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -266,6 +266,33 @@ class EntryController extends Controller ); } + /** + * Reload an entry. + * Refetch content from the website and make it readable again. + * + * @param Entry $entry + * + * @Route("/reload/{id}", requirements={"id" = "\d+"}, name="reload_entry") + * + * @return \Symfony\Component\HttpFoundation\RedirectResponse + */ + public function reloadAction(Entry $entry) + { + $this->checkUserAction($entry); + + $message = 'Entry reloaded'; + if (false === $this->updateEntry($entry)) { + $message = 'Failed to reload entry'; + } + + $this->get('session')->getFlashBag()->add( + 'notice', + $message + ); + + return $this->redirect($this->generateUrl('view', array('id' => $entry->getId()))); + } + /** * Changes read status for an entry. *