aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@smile.fr>2015-10-23 14:45:50 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-02 23:24:17 +0100
commitd51b38ed309c9aead938e8c8963c05c6d82b4ec2 (patch)
treef1d575776c8f6a97370fccdbb1ca02a680a4ffe0 /src/Wallabag/ImportBundle
parent557e549db7932e9101f60bfda64238a235a0ce3b (diff)
downloadwallabag-d51b38ed309c9aead938e8c8963c05c6d82b4ec2.tar.gz
wallabag-d51b38ed309c9aead938e8c8963c05c6d82b4ec2.tar.zst
wallabag-d51b38ed309c9aead938e8c8963c05c6d82b4ec2.zip
create ImportController to list importers
Diffstat (limited to 'src/Wallabag/ImportBundle')
-rw-r--r--src/Wallabag/ImportBundle/Controller/ImportController.php17
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php9
-rw-r--r--src/Wallabag/ImportBundle/Import/ImportInterface.php2
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php10
-rw-r--r--src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig16
5 files changed, 49 insertions, 5 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/ImportController.php b/src/Wallabag/ImportBundle/Controller/ImportController.php
new file mode 100644
index 00000000..3569793b
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Controller/ImportController.php
@@ -0,0 +1,17 @@
1<?php
2
3namespace Wallabag\ImportBundle\Controller;
4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7
8class ImportController extends Controller
9{
10 /**
11 * @Route("/import", name="import")
12 */
13 public function importAction()
14 {
15 return $this->render('WallabagImportBundle:Import:index.html.twig', array());
16 }
17}
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index 9602c282..f851c81c 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -4,20 +4,19 @@ namespace Wallabag\ImportBundle\Controller;
4 4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7use Wallabag\ImportBundle\Import\PocketImport;
8 7
9class PocketController extends Controller 8class PocketController extends Controller
10{ 9{
11 /** 10 /**
12 * @Route("/import", name="import") 11 * @Route("/import/pocket", name="pocket")
13 */ 12 */
14 public function importAction() 13 public function indexAction()
15 { 14 {
16 return $this->render('WallabagImportBundle:Pocket:index.html.twig', array()); 15 return $this->render('WallabagImportBundle:Pocket:index.html.twig', array());
17 } 16 }
18 17
19 /** 18 /**
20 * @Route("/auth-pocket", name="authpocket") 19 * @Route("/import/pocket/auth", name="authpocket")
21 */ 20 */
22 public function authAction() 21 public function authAction()
23 { 22 {
@@ -28,7 +27,7 @@ class PocketController extends Controller
28 } 27 }
29 28
30 /** 29 /**
31 * @Route("/callback-pocket", name="callbackpocket") 30 * @Route("/import/pocket/callback", name="callbackpocket")
32 */ 31 */
33 public function callbackAction() 32 public function callbackAction()
34 { 33 {
diff --git a/src/Wallabag/ImportBundle/Import/ImportInterface.php b/src/Wallabag/ImportBundle/Import/ImportInterface.php
index 88de3fa8..f07a120c 100644
--- a/src/Wallabag/ImportBundle/Import/ImportInterface.php
+++ b/src/Wallabag/ImportBundle/Import/ImportInterface.php
@@ -4,6 +4,8 @@ namespace Wallabag\ImportBundle\Import;
4 4
5interface ImportInterface 5interface ImportInterface
6{ 6{
7 public function getName();
8 public function getDescription();
7 public function oAuthRequest($redirectUri, $callbackUri); 9 public function oAuthRequest($redirectUri, $callbackUri);
8 public function oAuthAuthorize(); 10 public function oAuthAuthorize();
9 public function import($accessToken); 11 public function import($accessToken);
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 413c9ccc..81af8e57 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -23,6 +23,16 @@ class PocketImport implements ImportInterface
23 $this->consumerKey = $consumerKey; 23 $this->consumerKey = $consumerKey;
24 } 24 }
25 25
26 public function getName()
27 {
28 return 'Pocket';
29 }
30
31 public function getDescription()
32 {
33 return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data.';
34 }
35
26 /** 36 /**
27 * Create a new Client. 37 * Create a new Client.
28 * 38 *
diff --git a/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig
new file mode 100644
index 00000000..bdd57e5e
--- /dev/null
+++ b/src/Wallabag/ImportBundle/Resources/views/Import/index.html.twig
@@ -0,0 +1,16 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2{% block title %}{% trans %}import{% endtrans %}{% endblock %}
3
4{% block content %}
5
6<div class="row">
7 <div class="col s12">
8 <div class="card-panel settings">
9 {% trans %}Welcome on wallabag importer. Please select your previous service that you want to migrate.{% endtrans %}
10 <ul>
11 <li><a href="{{ path('pocket') }}">Pocket</a></li>
12 </ul>
13 </div>
14 </div>
15</div>
16{% endblock %}