mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-26 11:01:04 +00:00
create ImportController to list importers
This commit is contained in:
parent
557e549db7
commit
d51b38ed30
5 changed files with 49 additions and 5 deletions
17
src/Wallabag/ImportBundle/Controller/ImportController.php
Normal file
17
src/Wallabag/ImportBundle/Controller/ImportController.php
Normal file
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
|
||||
class ImportController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/import", name="import")
|
||||
*/
|
||||
public function importAction()
|
||||
{
|
||||
return $this->render('WallabagImportBundle:Import:index.html.twig', array());
|
||||
}
|
||||
}
|
|
@ -4,20 +4,19 @@ namespace Wallabag\ImportBundle\Controller;
|
|||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Wallabag\ImportBundle\Import\PocketImport;
|
||||
|
||||
class PocketController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/import", name="import")
|
||||
* @Route("/import/pocket", name="pocket")
|
||||
*/
|
||||
public function importAction()
|
||||
public function indexAction()
|
||||
{
|
||||
return $this->render('WallabagImportBundle:Pocket:index.html.twig', array());
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/auth-pocket", name="authpocket")
|
||||
* @Route("/import/pocket/auth", name="authpocket")
|
||||
*/
|
||||
public function authAction()
|
||||
{
|
||||
|
@ -28,7 +27,7 @@ class PocketController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* @Route("/callback-pocket", name="callbackpocket")
|
||||
* @Route("/import/pocket/callback", name="callbackpocket")
|
||||
*/
|
||||
public function callbackAction()
|
||||
{
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Wallabag\ImportBundle\Import;
|
|||
|
||||
interface ImportInterface
|
||||
{
|
||||
public function getName();
|
||||
public function getDescription();
|
||||
public function oAuthRequest($redirectUri, $callbackUri);
|
||||
public function oAuthAuthorize();
|
||||
public function import($accessToken);
|
||||
|
|
|
@ -23,6 +23,16 @@ class PocketImport implements ImportInterface
|
|||
$this->consumerKey = $consumerKey;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'Pocket';
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return 'This importer will import all your <a href="https://getpocket.com">Pocket</a> data.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Client.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{% extends "WallabagCoreBundle::layout.html.twig" %}
|
||||
{% block title %}{% trans %}import{% endtrans %}{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="row">
|
||||
<div class="col s12">
|
||||
<div class="card-panel settings">
|
||||
{% trans %}Welcome on wallabag importer. Please select your previous service that you want to migrate.{% endtrans %}
|
||||
<ul>
|
||||
<li><a href="{{ path('pocket') }}">Pocket</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in a new issue