diff options
Diffstat (limited to 'src')
4 files changed, 57 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/DeveloperController.php b/src/Wallabag/CoreBundle/Controller/DeveloperController.php new file mode 100644 index 00000000..3cb86881 --- /dev/null +++ b/src/Wallabag/CoreBundle/Controller/DeveloperController.php | |||
@@ -0,0 +1,38 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Controller; | ||
4 | |||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | ||
6 | use Symfony\Component\HttpFoundation\Request; | ||
7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
8 | |||
9 | class DeveloperController extends Controller | ||
10 | { | ||
11 | /** | ||
12 | * @param Request $request | ||
13 | * | ||
14 | * @Route("/developer", name="developer") | ||
15 | */ | ||
16 | public function indexAction(Request $request) | ||
17 | { | ||
18 | return $this->render('WallabagCoreBundle:Developer:index.html.twig'); | ||
19 | } | ||
20 | |||
21 | /** | ||
22 | * @param Request $request | ||
23 | * | ||
24 | * @Route("/developer/client/create", name="create_client") | ||
25 | */ | ||
26 | public function createClientAction(Request $request) | ||
27 | { | ||
28 | $clientManager = $this->container->get('fos_oauth_server.client_manager.default'); | ||
29 | $client = $clientManager->createClient(); | ||
30 | $client->setRedirectUris(array('http://www.example.com')); | ||
31 | $client->setAllowedGrantTypes(array('token', 'authorization_code')); | ||
32 | $clientManager->updateClient($client); | ||
33 | |||
34 | return $this->render('WallabagCoreBundle:Developer:client.html.twig', array( | ||
35 | 'client_id' => $client->getPublicId(), | ||
36 | )); | ||
37 | } | ||
38 | } | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig new file mode 100644 index 00000000..edebc7ee --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/client.html.twig | |||
@@ -0,0 +1,9 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}New client{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | |||
7 | Client ID: {{ client_id }} | ||
8 | |||
9 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig new file mode 100644 index 00000000..9e06005f --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Developer/index.html.twig | |||
@@ -0,0 +1,9 @@ | |||
1 | {% extends "WallabagCoreBundle::layout.html.twig" %} | ||
2 | |||
3 | {% block title %}{% trans %}Developer{% endtrans %}{% endblock %} | ||
4 | |||
5 | {% block content %} | ||
6 | |||
7 | <a href="{{ path('create_client') }}">Create a new client</a> | ||
8 | |||
9 | {% endblock %} | ||
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig index d7bfa7ae..46aab5dc 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig | |||
@@ -116,6 +116,7 @@ | |||
116 | <div class="container"> | 116 | <div class="container"> |
117 | <p>{% trans %}powered by{% endtrans %} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p> | 117 | <p>{% trans %}powered by{% endtrans %} <a target="_blank" href="https://wallabag.org" class="grey-text text-lighten-4">wallabag</a></p> |
118 | <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{% trans %}About{% endtrans %}</a> | 118 | <a class="grey-text text-lighten-4 right" href="{{ path('about') }}">{% trans %}About{% endtrans %}</a> |
119 | <a class="grey-text text-lighten-4 right" href="{{ path('developer') }}">{% trans %}Developer{% endtrans %} | ||
119 | </div> | 120 | </div> |
120 | </div> | 121 | </div> |
121 | </footer> | 122 | </footer> |