diff options
author | Paulino Michelazzo <paulino@michelazzo.com.br> | 2016-10-18 22:48:23 +0200 |
---|---|---|
committer | Paulino Michelazzo <paulino@michelazzo.com.br> | 2016-10-18 22:48:23 +0200 |
commit | 99731f0bb1f6fd2815eeb9af504ce86df927657b (patch) | |
tree | b080efc608d2bbd52b77a4a0067402007f50c5a8 /src/Wallabag/ImportBundle/Controller/WallabagController.php | |
parent | 3a3c6b866b52721431bed22426d9abfcd0d2dfe0 (diff) | |
parent | 7180aaed45dce62e40620a9e4b202526ebd6a3bb (diff) | |
download | wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.gz wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.tar.zst wallabag-99731f0bb1f6fd2815eeb9af504ce86df927657b.zip |
Merge remote-tracking branch 'wallabag/master'
Diffstat (limited to 'src/Wallabag/ImportBundle/Controller/WallabagController.php')
-rw-r--r-- | src/Wallabag/ImportBundle/Controller/WallabagController.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagController.php b/src/Wallabag/ImportBundle/Controller/WallabagController.php index 76ced0d2..9c0cde80 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagController.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagController.php | |||
@@ -38,15 +38,15 @@ abstract class WallabagController extends Controller | |||
38 | $form->handleRequest($request); | 38 | $form->handleRequest($request); |
39 | 39 | ||
40 | $wallabag = $this->getImportService(); | 40 | $wallabag = $this->getImportService(); |
41 | $wallabag->setUser($this->getUser()); | ||
41 | 42 | ||
42 | if ($form->isValid()) { | 43 | if ($form->isValid()) { |
43 | $file = $form->get('file')->getData(); | 44 | $file = $form->get('file')->getData(); |
44 | $markAsRead = $form->get('mark_as_read')->getData(); | 45 | $markAsRead = $form->get('mark_as_read')->getData(); |
45 | $name = $this->getUser()->getId().'.json'; | 46 | $name = $this->getUser()->getId().'.json'; |
46 | 47 | ||
47 | if (in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { | 48 | if (null !== $file && in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes')) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) { |
48 | $res = $wallabag | 49 | $res = $wallabag |
49 | ->setUser($this->getUser()) | ||
50 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) | 50 | ->setFilepath($this->getParameter('wallabag_import.resource_dir').'/'.$name) |
51 | ->setMarkAsRead($markAsRead) | 51 | ->setMarkAsRead($markAsRead) |
52 | ->import(); | 52 | ->import(); |
@@ -60,6 +60,12 @@ abstract class WallabagController extends Controller | |||
60 | '%skipped%' => $summary['skipped'], | 60 | '%skipped%' => $summary['skipped'], |
61 | ]); | 61 | ]); |
62 | 62 | ||
63 | if (0 < $summary['queued']) { | ||
64 | $message = $this->get('translator')->trans('flashes.import.notice.summary_with_queue', [ | ||
65 | '%queued%' => $summary['queued'], | ||
66 | ]); | ||
67 | } | ||
68 | |||
63 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); | 69 | unlink($this->getParameter('wallabag_import.resource_dir').'/'.$name); |
64 | } | 70 | } |
65 | 71 | ||