diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-02-12 15:59:13 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-03-03 10:03:28 +0100 |
commit | fe8b37c137adbe036f58616c15dbcffd07dd2cd4 (patch) | |
tree | a0d6b5db7867ae7d1600e74b5b193dfaf8375125 /src/Wallabag/ImportBundle/Controller | |
parent | 7d12fd06288d71bd0f939ab34cfe2c0d881576e8 (diff) | |
download | wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.gz wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.zst wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.zip |
Mark all imported articles as read
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 2 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index 35fe620f..8b27144b 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | |||
@@ -21,12 +21,14 @@ class WallabagV1Controller extends Controller | |||
21 | 21 | ||
22 | if ($form->isValid()) { | 22 | if ($form->isValid()) { |
23 | $file = $form->get('file')->getData(); | 23 | $file = $form->get('file')->getData(); |
24 | $markAsRead = $form->get('mark_as_read')->getData(); | ||
24 | $name = $this->getUser()->getId().'.json'; | 25 | $name = $this->getUser()->getId().'.json'; |
25 | 26 | ||
26 | if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { | 27 | if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { |
27 | $res = $wallabag | 28 | $res = $wallabag |
28 | ->setUser($this->getUser()) | 29 | ->setUser($this->getUser()) |
29 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) | 30 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) |
31 | ->setMarkAsRead($markAsRead) | ||
30 | ->import(); | 32 | ->import(); |
31 | 33 | ||
32 | $message = 'Import failed, please try again.'; | 34 | $message = 'Import failed, please try again.'; |
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php index 2e6225f2..6dcd204a 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php | |||
@@ -21,12 +21,14 @@ class WallabagV2Controller extends Controller | |||
21 | 21 | ||
22 | if ($form->isValid()) { | 22 | if ($form->isValid()) { |
23 | $file = $form->get('file')->getData(); | 23 | $file = $form->get('file')->getData(); |
24 | $markAsRead = $form->get('mark_as_read')->getData(); | ||
24 | $name = $this->getUser()->getId().'.json'; | 25 | $name = $this->getUser()->getId().'.json'; |
25 | 26 | ||
26 | if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { | 27 | if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { |
27 | $res = $wallabag | 28 | $res = $wallabag |
28 | ->setUser($this->getUser()) | 29 | ->setUser($this->getUser()) |
29 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) | 30 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) |
31 | ->setMarkAsRead($markAsRead) | ||
30 | ->import(); | 32 | ->import(); |
31 | 33 | ||
32 | $message = 'Import failed, please try again.'; | 34 | $message = 'Import failed, please try again.'; |