diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-03-04 16:12:45 +0100 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-03-04 16:12:45 +0100 |
commit | d89908aed331779fc79b8e50ddaa51212b6269f5 (patch) | |
tree | 8087d461437d315440c825ab28433e62ce799ecc /src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | |
parent | e18138dbca536ebd49c938144f9d051e5276d4ea (diff) | |
parent | 79d0e38e7ff975b2e0306d3dd96f57509fd84aef (diff) | |
download | wallabag-d89908aed331779fc79b8e50ddaa51212b6269f5.tar.gz wallabag-d89908aed331779fc79b8e50ddaa51212b6269f5.tar.zst wallabag-d89908aed331779fc79b8e50ddaa51212b6269f5.zip |
Merge pull request #1670 from wallabag/v2-mark-imported-articles-as-read
Mark all imported articles as read
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index 35fe620f..154a0769 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | |||
@@ -21,15 +21,18 @@ 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.'; |
35 | |||
33 | if (true === $res) { | 36 | if (true === $res) { |
34 | $summary = $wallabag->getSummary(); | 37 | $summary = $wallabag->getSummary(); |
35 | $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; | 38 | $message = 'Import summary: '.$summary['imported'].' imported, '.$summary['skipped'].' already saved.'; |