aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller')
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php2
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php2
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.';