aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-02-12 15:59:13 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-03-03 10:03:28 +0100
commitfe8b37c137adbe036f58616c15dbcffd07dd2cd4 (patch)
treea0d6b5db7867ae7d1600e74b5b193dfaf8375125 /src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
parent7d12fd06288d71bd0f939ab34cfe2c0d881576e8 (diff)
downloadwallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.gz
wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.tar.zst
wallabag-fe8b37c137adbe036f58616c15dbcffd07dd2cd4.zip
Mark all imported articles as read
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php')
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php2
1 files changed, 2 insertions, 0 deletions
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.';