aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--app/AppKernel.php1
-rw-r--r--app/DoctrineMigrations/Version20160120200534_settings.php51
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml15
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml15
-rw-r--r--app/Resources/CraueConfigBundle/views/Settings/modify.html.twig43
-rw-r--r--app/config/config.yml24
-rw-r--r--app/config/parameters.yml.dist28
-rw-r--r--app/config/routing.yml9
-rw-r--r--app/config/security.yml1
-rw-r--r--app/config/tests/parameters.yml.dist.mysql28
-rw-r--r--app/config/tests/parameters.yml.dist.pgsql28
-rw-r--r--app/config/tests/parameters.yml.dist.sqlite28
-rw-r--r--composer.json5
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php1
-rw-r--r--src/Wallabag/CoreBundle/Controller/StaticController.php5
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/Configuration.php4
-rw-r--r--src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php2
-rw-r--r--src/Wallabag/CoreBundle/Helper/EntriesExport.php7
-rw-r--r--src/Wallabag/CoreBundle/Resources/config/services.yml4
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig19
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig3
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig25
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig3
-rw-r--r--src/Wallabag/ImportBundle/Import/PocketImport.php5
-rw-r--r--src/Wallabag/ImportBundle/Resources/config/services.yml2
-rw-r--r--src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php11
-rw-r--r--src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php10
-rw-r--r--src/Wallabag/UserBundle/Resources/config/services.yml3
29 files changed, 208 insertions, 173 deletions
diff --git a/app/AppKernel.php b/app/AppKernel.php
index 7e76a9e9..82d3aa38 100644
--- a/app/AppKernel.php
+++ b/app/AppKernel.php
@@ -33,6 +33,7 @@ class AppKernel extends Kernel
33 new KPhoen\RulerZBundle\KPhoenRulerZBundle(), 33 new KPhoen\RulerZBundle\KPhoenRulerZBundle(),
34 new Wallabag\ImportBundle\WallabagImportBundle(), 34 new Wallabag\ImportBundle\WallabagImportBundle(),
35 new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), 35 new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
36 new Craue\ConfigBundle\CraueConfigBundle(),
36 ]; 37 ];
37 38
38 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) { 39 if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
diff --git a/app/DoctrineMigrations/Version20160120200534_settings.php b/app/DoctrineMigrations/Version20160120200534_settings.php
new file mode 100644
index 00000000..34809ff9
--- /dev/null
+++ b/app/DoctrineMigrations/Version20160120200534_settings.php
@@ -0,0 +1,51 @@
1<?php
2
3namespace Application\Migrations;
4
5use Doctrine\DBAL\Migrations\AbstractMigration;
6use Doctrine\DBAL\Schema\Schema;
7
8/**
9 * Auto-generated Migration: Please modify to your needs!
10 */
11class Version20160120200534_settings extends AbstractMigration
12{
13 /**
14 * @param Schema $schema
15 */
16 public function up(Schema $schema)
17 {
18 // this up() migration is auto-generated, please modify it to your needs
19 $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
20
21 $this->addSql('CREATE TABLE craue_config_setting (name VARCHAR(255) NOT NULL, value VARCHAR(255) DEFAULT NULL, section VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_B95BA9425E237E06 (name), PRIMARY KEY(name)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB');
22 $this->addSql("INSERT INTO `craue_config_setting` (`name`, `value`, `section`) VALUES
23 ('download_pictures', '1', 'entry'),
24 ('carrot', '1', 'entry'),
25 ('share_diaspora', '1', 'entry'),
26 ('diaspora_url', 'http://diasporapod.com', 'entry'),
27 ('share_shaarli', '1', 'entry'),
28 ('shaarli_url', 'http://myshaarli.com', 'entry'),
29 ('share_mail', '1', 'entry'),
30 ('share_twitter', '1', 'entry'),
31 ('export_epub', '1', 'export'),
32 ('export_mobi', '1', 'export'),
33 ('export_pdf', '1', 'export'),
34 ('pocket_consumer_key', NULL, 'import'),
35 ('show_printlink', '1', 'entry'),
36 ('wallabag_support_url', 'https://www.wallabag.org/pages/support.html', 'misc'),
37 ('wallabag_url', 'http://v2.wallabag.org', 'misc')"
38 );
39 }
40
41 /**
42 * @param Schema $schema
43 */
44 public function down(Schema $schema)
45 {
46 // this down() migration is auto-generated, please modify it to your needs
47 $this->abortIf($this->connection->getDatabasePlatform()->getName() != 'mysql', 'Migration can only be executed safely on \'mysql\'.');
48
49 $this->addSql('DROP TABLE craue_config_setting');
50 }
51}
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
new file mode 100644
index 00000000..ea90460e
--- /dev/null
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
@@ -0,0 +1,15 @@
1download_pictures: Download pictures on your server
2carrot: Enable share to Carrot
3diaspora_url: Diaspora URL, if the service is enabled
4export_epub: Enable ePub export
5export_mobi: Enable .mobi export
6export_pdf: Enable PDF export
7pocket_consumer_key: Consumer key for Pocket to import contents (https://getpocket.com/developer/docs/authentication)
8shaarli_url: URL de Shaarli, if the service is enabled
9share_diaspora: Enable share to Diaspora
10share_mail: Enable share by email
11share_shaarli: Enable share to Shaarli
12share_twitter: Enable share to Twitter
13show_printlink: Display a link to print content
14wallabag_support_url: Support URL for wallabag
15wallabag_url: URL of *your* wallabag instance
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
new file mode 100644
index 00000000..19600045
--- /dev/null
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
@@ -0,0 +1,15 @@
1download_pictures: Télécharger les images sur le serveur
2carrot: Activer le partage vers Carrot
3diaspora_url: URL de Diaspora, si le service Diaspora est activé
4export_epub: Activer l'export ePub
5export_mobi: Activer l'export .mobi
6export_pdf: Activer l'export PDF
7pocket_consumer_key: Clé d'authentification Pocket pour importer les données (https://getpocket.com/developer/docs/authentication)
8shaarli_url: URL de Shaarli, si le service Diaspora est activé
9share_diaspora: Activer le partage vers Diaspora
10share_mail: Activer le partage par email
11share_shaarli: Activer le partage vers Shaarli
12share_twitter: Activer le partage vers Twitter
13show_printlink: Afficher un lien pour imprimer
14wallabag_support_url: URL de support de wallabag
15wallabag_url: URL de *votre* instance de wallabag
diff --git a/app/Resources/CraueConfigBundle/views/Settings/modify.html.twig b/app/Resources/CraueConfigBundle/views/Settings/modify.html.twig
new file mode 100644
index 00000000..f44db420
--- /dev/null
+++ b/app/Resources/CraueConfigBundle/views/Settings/modify.html.twig
@@ -0,0 +1,43 @@
1{% extends "WallabagCoreBundle::layout.html.twig" %}
2
3{% block title %}{% trans %}internal settings{% endtrans %}{% endblock %}
4
5{% block content %}
6 <div class="row">
7 <div class="col s12">
8 <div class="card-panel settings">
9 {{ form_start(form, {'attr': {'class': 'craue_config_settings_modify'}}) }}
10 {{ form_errors(form) }}
11
12 <div class="row">
13 <div class="div_tabs col s12">
14 <ul class="tabs">
15 {% for section in sections | craue_sortSections %}
16 <li class="tab col s3"><a href="#set-{{ section }}">{{ section | trans({}, 'CraueConfigBundle') }}</a></li>
17 {% endfor %}
18 </ul>
19 </div>
20
21 {% for section in sections | craue_sortSections %}
22 <div id="set-{{ section }}" class="col s12">
23 {% for setting in form.settings if setting.section.vars.value == section %}
24 {{ form_row(setting.name) }}
25 {{ form_row(setting.section) }}
26 {{ form_row(setting.value, {
27 'label': setting.name.vars.value | trans({}, 'CraueConfigBundle'),
28 }) }}
29 {% endfor %}
30 </div>
31 {% endfor %}
32 </div>
33
34 <button class="btn waves-effect waves-light" type="submit" name="action">
35 {{ 'modify_settings' | trans({}, 'CraueConfigBundle') }}
36 </button>
37
38 {{ form_rest(form) }}
39 {{ form_end(form) }}
40 </div>
41 </div>
42 </div>
43{% endblock %}
diff --git a/app/config/config.yml b/app/config/config.yml
index 58e1dd66..3c278ea6 100644
--- a/app/config/config.yml
+++ b/app/config/config.yml
@@ -28,6 +28,8 @@ framework:
28 assets: ~ 28 assets: ~
29 29
30wallabag_core: 30wallabag_core:
31 version: 2.0.0-alpha.1
32 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
31 languages: 33 languages:
32 en: 'English' 34 en: 'English'
33 fr: 'Français' 35 fr: 'Français'
@@ -46,28 +48,6 @@ wallabag_import:
46twig: 48twig:
47 debug: "%kernel.debug%" 49 debug: "%kernel.debug%"
48 strict_variables: "%kernel.debug%" 50 strict_variables: "%kernel.debug%"
49 globals:
50 share_twitter: %share_twitter%
51 share_mail: %share_mail%
52 share_shaarli: %share_shaarli%
53 shaarli_url: %shaarli_url%
54 share_diaspora: %share_diaspora%
55 diaspora_url: %diaspora_url%
56 flattr: %flattr%
57 flattrable: 1
58 flattred: 2
59 carrot: %carrot%
60 show_printlink: %show_printlink%
61 export_epub: %export_epub%
62 export_mobi: %export_mobi%
63 export_pdf: %export_pdf%
64 export_csv: %export_csv%
65 export_json: %export_json%
66 export_txt: %export_txt%
67 export_xml: %export_xml%
68 version: %app.version%
69 twofactor_auth: %twofactor_auth%
70 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb"
71 form_themes: 51 form_themes:
72 - "LexikFormFilterBundle:Form:form_div_layout.html.twig" 52 - "LexikFormFilterBundle:Form:form_div_layout.html.twig"
73 53
diff --git a/app/config/parameters.yml.dist b/app/config/parameters.yml.dist
index 52d26cb4..3eeedb78 100644
--- a/app/config/parameters.yml.dist
+++ b/app/config/parameters.yml.dist
@@ -37,32 +37,6 @@ parameters:
37 # A secret key that's used to generate certain security-related tokens 37 # A secret key that's used to generate certain security-related tokens
38 secret: ThisTokenIsNotSoSecretChangeIt 38 secret: ThisTokenIsNotSoSecretChangeIt
39 39
40 # wallabag misc 40 # two factor stuff
41 app.version: 2.0.0-alpha
42 twofactor_auth: true 41 twofactor_auth: true
43 twofactor_sender: no-reply@wallabag.org 42 twofactor_sender: no-reply@wallabag.org
44
45 download_pictures: false # if true, pictures will be stored into data/assets for each article
46
47 # Entry view
48 share_twitter: true
49 share_mail: true
50 share_shaarli: true
51 shaarli_url: http://myshaarli.com
52 share_diaspora: true
53 diaspora_url: http://diasporapod.com
54 flattr: true
55 carrot: true
56 show_printlink: true
57 export_epub: true
58 export_mobi: true
59 export_pdf: true
60 export_csv: true
61 export_json: true
62 export_txt: true
63 export_xml: true
64 wallabag_url: http://v2.wallabag.org
65 wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
66
67 # pocket import
68 pocket_consumer_key: xxxxxxxx
diff --git a/app/config/routing.yml b/app/config/routing.yml
index 84b98d23..c491d35d 100644
--- a/app/config/routing.yml
+++ b/app/config/routing.yml
@@ -22,7 +22,9 @@ rest :
22 22
23homepage: 23homepage:
24 path: "/{page}" 24 path: "/{page}"
25 defaults: { _controller: WallabagCoreBundle:Entry:showUnread, page : 1 } 25 defaults:
26 _controller: WallabagCoreBundle:Entry:showUnread
27 page : 1
26 requirements: 28 requirements:
27 page: \d+ 29 page: \d+
28 30
@@ -31,3 +33,8 @@ fos_user:
31 33
32fos_oauth_server_token: 34fos_oauth_server_token:
33 resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml" 35 resource: "@FOSOAuthServerBundle/Resources/config/routing/token.xml"
36
37craue_config_settings_modify:
38 path: /settings
39 defaults:
40 _controller: CraueConfigBundle:Settings:modify
diff --git a/app/config/security.yml b/app/config/security.yml
index a99a7d80..6f20490b 100644
--- a/app/config/security.yml
+++ b/app/config/security.yml
@@ -58,3 +58,4 @@ security:
58 - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY } 58 - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
59 - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY } 59 - { path: /(unread|starred|archive).xml$, roles: IS_AUTHENTICATED_ANONYMOUSLY }
60 - { path: ^/, roles: ROLE_USER } 60 - { path: ^/, roles: ROLE_USER }
61 - { path: ^/settings, roles: ROLE_SUPER_ADMIN }
diff --git a/app/config/tests/parameters.yml.dist.mysql b/app/config/tests/parameters.yml.dist.mysql
index 073f6c27..3244fd3a 100644
--- a/app/config/tests/parameters.yml.dist.mysql
+++ b/app/config/tests/parameters.yml.dist.mysql
@@ -27,32 +27,6 @@ parameters:
27 # A secret key that's used to generate certain security-related tokens 27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt 28 secret: ThisTokenIsNotSoSecretChangeIt
29 29
30 # wallabag misc 30 # two factor stuff
31 app.version: 2.0.0-alpha
32 twofactor_auth: true 31 twofactor_auth: true
33 twofactor_sender: no-reply@wallabag.org 32 twofactor_sender: no-reply@wallabag.org
34
35 download_pictures: false # if true, pictures will be stored into data/assets for each article
36
37 # Entry view
38 share_twitter: true
39 share_mail: true
40 share_shaarli: true
41 shaarli_url: http://myshaarli.com
42 share_diaspora: true
43 diaspora_url: http://diasporapod.com
44 flattr: true
45 carrot: true
46 show_printlink: true
47 export_epub: true
48 export_mobi: true
49 export_pdf: true
50 export_csv: true
51 export_json: true
52 export_txt: true
53 export_xml: true
54 wallabag_url: http://v2.wallabag.org
55 wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
56
57 # pocket import
58 pocket_consumer_key: xxxxxxxx
diff --git a/app/config/tests/parameters.yml.dist.pgsql b/app/config/tests/parameters.yml.dist.pgsql
index 24a1818a..cee34473 100644
--- a/app/config/tests/parameters.yml.dist.pgsql
+++ b/app/config/tests/parameters.yml.dist.pgsql
@@ -27,32 +27,6 @@ parameters:
27 # A secret key that's used to generate certain security-related tokens 27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt 28 secret: ThisTokenIsNotSoSecretChangeIt
29 29
30 # wallabag misc 30 # two factor stuff
31 app.version: 2.0.0-alpha
32 twofactor_auth: true 31 twofactor_auth: true
33 twofactor_sender: no-reply@wallabag.org 32 twofactor_sender: no-reply@wallabag.org
34
35 download_pictures: false # if true, pictures will be stored into data/assets for each article
36
37 # Entry view
38 share_twitter: true
39 share_mail: true
40 share_shaarli: true
41 shaarli_url: http://myshaarli.com
42 share_diaspora: true
43 diaspora_url: http://diasporapod.com
44 flattr: true
45 carrot: true
46 show_printlink: true
47 export_epub: true
48 export_mobi: true
49 export_pdf: true
50 export_csv: true
51 export_json: true
52 export_txt: true
53 export_xml: true
54 wallabag_url: http://v2.wallabag.org
55 wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
56
57 # pocket import
58 pocket_consumer_key: xxxxxxxx
diff --git a/app/config/tests/parameters.yml.dist.sqlite b/app/config/tests/parameters.yml.dist.sqlite
index c739f89b..a1535bc9 100644
--- a/app/config/tests/parameters.yml.dist.sqlite
+++ b/app/config/tests/parameters.yml.dist.sqlite
@@ -27,32 +27,6 @@ parameters:
27 # A secret key that's used to generate certain security-related tokens 27 # A secret key that's used to generate certain security-related tokens
28 secret: ThisTokenIsNotSoSecretChangeIt 28 secret: ThisTokenIsNotSoSecretChangeIt
29 29
30 # wallabag misc 30 # two factor stuff
31 app.version: 2.0.0-alpha
32 twofactor_auth: true 31 twofactor_auth: true
33 twofactor_sender: no-reply@wallabag.org 32 twofactor_sender: no-reply@wallabag.org
34
35 download_pictures: false # if true, pictures will be stored into data/assets for each article
36
37 # Entry view
38 share_twitter: true
39 share_mail: true
40 share_shaarli: true
41 shaarli_url: http://myshaarli.com
42 share_diaspora: true
43 diaspora_url: http://diasporapod.com
44 flattr: true
45 carrot: true
46 show_printlink: true
47 export_epub: true
48 export_mobi: true
49 export_pdf: true
50 export_csv: true
51 export_json: true
52 export_txt: true
53 export_xml: true
54 wallabag_url: http://v2.wallabag.org
55 wallabag_support_url: 'https://www.wallabag.org/pages/support.html'
56
57 # pocket import
58 pocket_consumer_key: xxxxxxxx
diff --git a/composer.json b/composer.json
index d84e1f8b..1c07c209 100644
--- a/composer.json
+++ b/composer.json
@@ -55,7 +55,7 @@
55 "lexik/form-filter-bundle": "~5.0", 55 "lexik/form-filter-bundle": "~5.0",
56 "j0k3r/graby": "~1.0", 56 "j0k3r/graby": "~1.0",
57 "friendsofsymfony/user-bundle": "dev-master", 57 "friendsofsymfony/user-bundle": "dev-master",
58 "friendsofsymfony/oauth-server-bundle": "^1.5@dev", 58 "friendsofsymfony/oauth-server-bundle": "^1.5",
59 "stof/doctrine-extensions-bundle": "^1.2@dev", 59 "stof/doctrine-extensions-bundle": "^1.2@dev",
60 "scheb/two-factor-bundle": "~2.0", 60 "scheb/two-factor-bundle": "~2.0",
61 "grandt/phpepub": "~4.0", 61 "grandt/phpepub": "~4.0",
@@ -63,7 +63,8 @@
63 "kphoen/rulerz-bundle": "~0.10", 63 "kphoen/rulerz-bundle": "~0.10",
64 "guzzlehttp/guzzle": "^5.2.0", 64 "guzzlehttp/guzzle": "^5.2.0",
65 "doctrine/doctrine-migrations-bundle": "^1.0", 65 "doctrine/doctrine-migrations-bundle": "^1.0",
66 "paragonie/random_compat": "~1.0" 66 "paragonie/random_compat": "~1.0",
67 "craue/config-bundle": "~1.4"
67 }, 68 },
68 "require-dev": { 69 "require-dev": {
69 "doctrine/doctrine-fixtures-bundle": "~2.2", 70 "doctrine/doctrine-fixtures-bundle": "~2.2",
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index 4ece6431..c7513f79 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -163,6 +163,7 @@ class ConfigController extends Controller
163 'username' => $user->getUsername(), 163 'username' => $user->getUsername(),
164 'token' => $config->getRssToken(), 164 'token' => $config->getRssToken(),
165 ), 165 ),
166 'twofactor_auth' => $this->getParameter('twofactor_auth'),
166 )); 167 ));
167 } 168 }
168 169
diff --git a/src/Wallabag/CoreBundle/Controller/StaticController.php b/src/Wallabag/CoreBundle/Controller/StaticController.php
index 9ada371b..5b7bd56e 100644
--- a/src/Wallabag/CoreBundle/Controller/StaticController.php
+++ b/src/Wallabag/CoreBundle/Controller/StaticController.php
@@ -25,7 +25,10 @@ class StaticController extends Controller
25 { 25 {
26 return $this->render( 26 return $this->render(
27 'WallabagCoreBundle:Static:about.html.twig', 27 'WallabagCoreBundle:Static:about.html.twig',
28 array() 28 array(
29 'version' => $this->getParameter('wallabag_core.version'),
30 'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
31 )
29 ); 32 );
30 } 33 }
31 34
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
index 4d5a63f8..bc405fdc 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
@@ -29,6 +29,10 @@ class Configuration implements ConfigurationInterface
29 ->integerNode('rss_limit') 29 ->integerNode('rss_limit')
30 ->defaultValue(50) 30 ->defaultValue(50)
31 ->end() 31 ->end()
32 ->scalarNode('version')
33 ->end()
34 ->scalarNode('paypal_url')
35 ->end()
32 ->end() 36 ->end()
33 ; 37 ;
34 38
diff --git a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
index 73bbffe1..9b4703e4 100644
--- a/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
+++ b/src/Wallabag/CoreBundle/DependencyInjection/WallabagCoreExtension.php
@@ -19,6 +19,8 @@ class WallabagCoreExtension extends Extension
19 $container->setParameter('wallabag_core.theme', $config['theme']); 19 $container->setParameter('wallabag_core.theme', $config['theme']);
20 $container->setParameter('wallabag_core.language', $config['language']); 20 $container->setParameter('wallabag_core.language', $config['language']);
21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']); 21 $container->setParameter('wallabag_core.rss_limit', $config['rss_limit']);
22 $container->setParameter('wallabag_core.version', $config['version']);
23 $container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
22 24
23 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); 25 $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
24 $loader->load('services.yml'); 26 $loader->load('services.yml');
diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
index 31a80d6e..965a40b6 100644
--- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php
+++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php
@@ -8,6 +8,7 @@ use JMS\Serializer\SerializerBuilder;
8use PHPePub\Core\EPub; 8use PHPePub\Core\EPub;
9use PHPePub\Core\Structure\OPF\DublinCore; 9use PHPePub\Core\Structure\OPF\DublinCore;
10use Symfony\Component\HttpFoundation\Response; 10use Symfony\Component\HttpFoundation\Response;
11use Craue\ConfigBundle\Util\Config;
11 12
12/** 13/**
13 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest. 14 * This class doesn't have unit test BUT it's fully covered by a functional test with ExportControllerTest.
@@ -27,12 +28,12 @@ class EntriesExport
27 </div'; 28 </div';
28 29
29 /** 30 /**
30 * @param string $wallabagUrl Wallabag instance url 31 * @param Config $craueConfig CraueConfig instance to get wallabag instance url from database
31 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE 32 * @param string $logoPath Path to the logo FROM THE BUNDLE SCOPE
32 */ 33 */
33 public function __construct($wallabagUrl, $logoPath) 34 public function __construct(Config $craueConfig, $logoPath)
34 { 35 {
35 $this->wallabagUrl = $wallabagUrl; 36 $this->wallabagUrl = $craueConfig->get('wallabag_url');
36 $this->logoPath = $logoPath; 37 $this->logoPath = $logoPath;
37 } 38 }
38 39
diff --git a/src/Wallabag/CoreBundle/Resources/config/services.yml b/src/Wallabag/CoreBundle/Resources/config/services.yml
index 6a1afcc0..813f8a96 100644
--- a/src/Wallabag/CoreBundle/Resources/config/services.yml
+++ b/src/Wallabag/CoreBundle/Resources/config/services.yml
@@ -3,7 +3,7 @@ services:
3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme 3 class: Wallabag\CoreBundle\Helper\DetectActiveTheme
4 arguments: 4 arguments:
5 - "@security.token_storage" 5 - "@security.token_storage"
6 - %theme% # default theme from parameters.yml 6 - %wallabag_core.theme%
7 7
8 # custom form type 8 # custom form type
9 wallabag_core.form.type.config: 9 wallabag_core.form.type.config:
@@ -86,7 +86,7 @@ services:
86 wallabag_core.helper.entries_export: 86 wallabag_core.helper.entries_export:
87 class: Wallabag\CoreBundle\Helper\EntriesExport 87 class: Wallabag\CoreBundle\Helper\EntriesExport
88 arguments: 88 arguments:
89 - %wallabag_url% 89 - "@craue_config"
90 - src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png 90 - src/Wallabag/CoreBundle/Resources/public/themes/_global/img/appicon/apple-touch-icon-152.png
91 91
92 wallabag.operator.array.matches: 92 wallabag.operator.array.matches:
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 20f4352b..cc814cc4 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -13,6 +13,7 @@ archive: 'Lus'
13all: 'Tous les articles' 13all: 'Tous les articles'
14tags: 'Tags' 14tags: 'Tags'
15config: 'Configuration' 15config: 'Configuration'
16internal settings: 'Configuration interne'
16import: 'Importer' 17import: 'Importer'
17howto: 'Aide' 18howto: 'Aide'
18logout: 'Déconnexion' 19logout: 'Déconnexion'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
index c23d0e27..27a88287 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
@@ -11,16 +11,15 @@
11 <li><a title="{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}</span></a></li> 11 <li><a title="{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}" class="tool icon icon-check {% if entry.isArchived == 0 %}archive-off{% else %}archive{% endif %}" href="{{ path('archive_entry', { 'id': entry.id }) }}"><span>{% if entry.isArchived == 0 %}{% trans %}Mark as read{% endtrans %}{% else %}{% trans %}Mark as unread{% endtrans %}{% endif %}</span></a></li>
12 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li> 12 <li><a title="{% trans %}Favorite{% endtrans %}" class="tool icon icon-star {% if entry.isStarred == 0 %}fav-off{% else %}fav{% endif %}" href="{{ path('star_entry', { 'id': entry.id }) }}"><span>{% trans %}Toggle favorite{% endtrans %}</span></a></li>
13 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li> 13 <li><a title="{% trans %}Delete{% endtrans %}" class="tool delete icon icon-trash" href="{{ path('delete_entry', { 'id': entry.id }) }}"><span>{% trans %}Delete{% endtrans %}</span></a></li>
14 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %} 14 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}Tweet{% endtrans %}"><span>{% trans %}Tweet{% endtrans %}</span></a></li>{% endif %}
15 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %} 15 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
16 {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} 16 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %}
17 {% if share_diaspora %}<li><a href="{{ diaspora_url }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora{% endtrans %}"><span>{% trans %}diaspora{% endtrans %}</span></a></li>{% endif %} 17 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora{% endtrans %}"><span>{% trans %}diaspora{% endtrans %}</span></a></li>{% endif %}
18 {# {% if flattr %}{% if flattr.status == flattrable %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}"><span>{% trans %}flattr{% endtrans %}</span></a></li>{% elseif flattr.status == flattred %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}><span>{% trans %}flattr{% endtrans %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} #} 18 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %}
19 {% if carrot %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %} 19 {% if craue_setting('show_printlink') %}<li><a title="{% trans %}Print{% endtrans %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans %}Print{% endtrans %}</span></a></li>{% endif %}
20 {% if show_printlink %}<li><a title="{% trans %}Print{% endtrans %}" class="tool icon icon-print" href="javascript: window.print();"><span>{% trans %}Print{% endtrans %}</span></a></li>{% endif %} 20 {% if craue_setting('export_epub') %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %}
21 {% if export_epub %}<li><a href="?epub&amp;method=id&amp;value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %} 21 {% if craue_setting('export_mobi') %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
22 {% if export_mobi %}<li><a href="?mobi&amp;method=id&amp;value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %} 22 {% if craue_setting('export_pdf') %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
23 {% if export_pdf %}<li><a href="?pdf&amp;method=id&amp;value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %}
24 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li> 23 <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&amp;body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li>
25 </ul> 24 </ul>
26 </div> 25 </div>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
index 3aead497..b630070c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/layout.html.twig
@@ -51,6 +51,9 @@
51 </div> 51 </div>
52 </li> 52 </li>
53 <li><a href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li> 53 <li><a href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li>
54 {% if is_granted('ROLE_SUPER_ADMIN') %}
55 <li><a href="{{ path('craue_config_settings_modify') }}">{% trans %}internal settings{% endtrans %}</a></li>
56 {% endif %}
54 <li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li> 57 <li><a href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li>
55 <li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li> 58 <li><a href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li>
56 <li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li> 59 <li><a href="{{ path('about') }}">{% trans %}about{% endtrans %}</a></li>
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
index 31963ae8..dad96187 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
@@ -97,12 +97,11 @@
97 </a> 97 </a>
98 <div class="collapsible-body"> 98 <div class="collapsible-body">
99 <ul> 99 <ul>
100 {% if share_twitter %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}twitter{% endtrans %}"><span>{% trans %}twitter{% endtrans %}</span></a></li>{% endif %} 100 {% if craue_setting('share_twitter') %}<li><a href="https://twitter.com/home?status={{entry.title|url_encode}}%20{{ entry.url|url_encode }}%20via%20@wallabagapp" target="_blank" class="tool twitter icon icon-twitter" title="{% trans %}twitter{% endtrans %}"><span>{% trans %}twitter{% endtrans %}</span></a></li>{% endif %}
101 {% if share_shaarli %}<li><a href="{{ shaarli_url }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %} 101 {% if craue_setting('share_shaarli') %}<li><a href="{{ craue_setting('shaarli_url') }}/index.php?post={{ entry.url|url_encode }}&amp;title={{ entry.title|url_encode }}" target="_blank" class="tool shaarli" title="{% trans %}shaarli{% endtrans %}"><span>{% trans %}shaarli{% endtrans %}</span></a></li>{% endif %}
102 {% if share_diaspora %}<li><a href="{{ diaspora_url }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora*{% endtrans %}"><span>{% trans %}diaspora*{% endtrans %}</span></a></li>{% endif %} 102 {% if craue_setting('share_diaspora') %}<li><a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}&notes=&v=1&noui=1&jump=doclose" target="_blank" class="tool diaspora icon-image icon-image--diaspora" title="{% trans %}diaspora*{% endtrans %}"><span>{% trans %}diaspora*{% endtrans %}</span></a></li>{% endif %}
103 {# {% if flattr %}{% if flattr.status == flattrable %}<li><a href="http://flattr.com/submit/auto?url={{ entry.url }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}"><span>{% trans %}flattr{% endtrans %}</span></a></li>{% elseif flattr.status == flattred %}<li><a href="{{ flattr.flattrItemURL }}" class="tool flattr icon icon-flattr" target="_blank" title="{% trans %}flattr{% endtrans %}><span>{% trans %}flattr{% endtrans %}</span> ({{ flattr.numFlattrs }})</a></li>{% endif %}{% endif %} #} 103 {% if craue_setting('carrot') %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %}
104 {% if carrot %}<li><a href="https://secure.carrot.org/GiveAndGetBack.do?url={{ entry.url|url_encode }}&title={{ entry.title|url_encode }}" class="tool carrot icon-image icon-image--carrot" target="_blank" title="{% trans %}carrot{% endtrans %}"><span>Carrot</span></a></li>{% endif %} 104 {% if craue_setting('share_mail') %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
105 {% if share_mail %}<li><a href="mailto:?subject={{ entry.title|url_encode }}&amp;body={{ entry.url|url_encode }}%20via%20@wallabagapp" class="tool email icon icon-mail" title="{% trans %}Email{% endtrans %}"><span>{% trans %}Email{% endtrans %}</span></a></li>{% endif %}
106 </ul> 105 </ul>
107 </div> 106 </div>
108 </li> 107 </li>
@@ -114,13 +113,13 @@
114 </a> 113 </a>
115 <div class="collapsible-body"> 114 <div class="collapsible-body">
116 <ul> 115 <ul>
117 {% if export_epub %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %} 116 {% if craue_setting('export_epub') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'epub' }) }}" title="Generate ePub file">EPUB</a></li>{% endif %}
118 {% if export_mobi %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %} 117 {% if craue_setting('export_mobi') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'mobi' }) }}" title="Generate Mobi file">MOBI</a></li>{% endif %}
119 {% if export_pdf %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %} 118 {% if craue_setting('export_pdf') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'pdf' }) }}" title="Generate PDF file">PDF</a></li>{% endif %}
120 {% if export_csv %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'csv' }) }}" title="Generate CSV file">CSV</a></li>{% endif %} 119 {% if craue_setting('export_csv') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'csv' }) }}" title="Generate CSV file">CSV</a></li>{% endif %}
121 {% if export_json %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'json' }) }}" title="Generate JSON file">JSON</a></li>{% endif %} 120 {% if craue_setting('export_json') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'json' }) }}" title="Generate JSON file">JSON</a></li>{% endif %}
122 {% if export_txt %}<li><del><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'txt' }) }}" title="Generate TXT file">TXT</a></del></li>{% endif %} 121 {% if craue_setting('export_txt') %}<li><del><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'txt' }) }}" title="Generate TXT file">TXT</a></del></li>{% endif %}
123 {% if export_xml %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'xml' }) }}" title="Generate XML file">XML</a></li>{% endif %} 122 {% if craue_setting('export_xml') %}<li><a href="{{ path('export_entry', { 'id': entry.id, 'format': 'xml' }) }}" title="Generate XML file">XML</a></li>{% endif %}
124 </ul> 123 </ul>
125 </div> 124 </div>
126 </li> 125 </li>
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 a8b6dc3f..dff9e612 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/layout.html.twig
@@ -45,6 +45,9 @@
45 <li class="bold border-bottom {% if currentRoute == 'all' %}active{% endif %}"><a class="waves-effect" href="{{ path('all') }}">{% trans %}all{% endtrans %}</a></li> 45 <li class="bold border-bottom {% if currentRoute == 'all' %}active{% endif %}"><a class="waves-effect" href="{{ path('all') }}">{% trans %}all{% endtrans %}</a></li>
46 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"><a class="waves-effect" href="{{ path('tag') }}">{% trans %}tags{% endtrans %}</a></li> 46 <li class="bold border-bottom {% if currentRoute == 'tags' %}active{% endif %}"><a class="waves-effect" href="{{ path('tag') }}">{% trans %}tags{% endtrans %}</a></li>
47 <li class="bold {% if currentRoute == 'config' %}active{% endif %}"><a class="waves-effect" href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li> 47 <li class="bold {% if currentRoute == 'config' %}active{% endif %}"><a class="waves-effect" href="{{ path('config') }}">{% trans %}config{% endtrans %}</a></li>
48 {% if is_granted('ROLE_SUPER_ADMIN') %}
49 <li class="bold border-bottom {% if currentRoute == 'craue_config_settings_modify' %}active{% endif %}"><a class="waves-effect" href="{{ path('craue_config_settings_modify') }}">{% trans %}internal settings{% endtrans %}</a></li>
50 {% endif %}
48 <li class="bold {% if currentRoute == 'import' %}active{% endif %}"><a class="waves-effect" href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li> 51 <li class="bold {% if currentRoute == 'import' %}active{% endif %}"><a class="waves-effect" href="{{ path('import') }}">{% trans %}import{% endtrans %}</a></li>
49 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"><a class="waves-effect" href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li> 52 <li class="bold {% if currentRoute == 'howto' %}active{% endif %}"><a class="waves-effect" href="{{ path('howto') }}">{% trans %}howto{% endtrans %}</a></li>
50 <li class="bold"><a class="waves-effect" class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li> 53 <li class="bold"><a class="waves-effect" class="icon icon-power" href="{{ path('fos_user_security_logout') }}" title="{% trans %}logout{% endtrans %}">{% trans %}logout{% endtrans %}</a></li>
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php
index 72b9047c..0463a739 100644
--- a/src/Wallabag/ImportBundle/Import/PocketImport.php
+++ b/src/Wallabag/ImportBundle/Import/PocketImport.php
@@ -11,6 +11,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
11use Wallabag\CoreBundle\Entity\Entry; 11use Wallabag\CoreBundle\Entity\Entry;
12use Wallabag\CoreBundle\Entity\Tag; 12use Wallabag\CoreBundle\Entity\Tag;
13use Wallabag\CoreBundle\Helper\ContentProxy; 13use Wallabag\CoreBundle\Helper\ContentProxy;
14use Craue\ConfigBundle\Util\Config;
14 15
15class PocketImport implements ImportInterface 16class PocketImport implements ImportInterface
16{ 17{
@@ -25,12 +26,12 @@ class PocketImport implements ImportInterface
25 protected $accessToken; 26 protected $accessToken;
26 private $translator; 27 private $translator;
27 28
28 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, $consumerKey) 29 public function __construct(TokenStorageInterface $tokenStorage, EntityManager $em, ContentProxy $contentProxy, Config $craueConfig)
29 { 30 {
30 $this->user = $tokenStorage->getToken()->getUser(); 31 $this->user = $tokenStorage->getToken()->getUser();
31 $this->em = $em; 32 $this->em = $em;
32 $this->contentProxy = $contentProxy; 33 $this->contentProxy = $contentProxy;
33 $this->consumerKey = $consumerKey; 34 $this->consumerKey = $craueConfig->get('pocket_consumer_key');
34 $this->logger = new NullLogger(); 35 $this->logger = new NullLogger();
35 } 36 }
36 37
diff --git a/src/Wallabag/ImportBundle/Resources/config/services.yml b/src/Wallabag/ImportBundle/Resources/config/services.yml
index e4dde100..dc536808 100644
--- a/src/Wallabag/ImportBundle/Resources/config/services.yml
+++ b/src/Wallabag/ImportBundle/Resources/config/services.yml
@@ -17,7 +17,7 @@ services:
17 - "@security.token_storage" 17 - "@security.token_storage"
18 - "@doctrine.orm.entity_manager" 18 - "@doctrine.orm.entity_manager"
19 - "@wallabag_core.content_proxy" 19 - "@wallabag_core.content_proxy"
20 - %pocket_consumer_key% 20 - "@craue_config"
21 calls: 21 calls:
22 - [ setClient, [ "@wallabag_import.pocket.client" ] ] 22 - [ setClient, [ "@wallabag_import.pocket.client" ] ]
23 - [ setLogger, [ "@logger" ]] 23 - [ setLogger, [ "@logger" ]]
diff --git a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
index 76225fe4..25359d56 100644
--- a/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
+++ b/src/Wallabag/ImportBundle/Tests/Import/PocketImportTest.php
@@ -55,11 +55,20 @@ class PocketImportTest extends \PHPUnit_Framework_TestCase
55 ->disableOriginalConstructor() 55 ->disableOriginalConstructor()
56 ->getMock(); 56 ->getMock();
57 57
58 $config = $this->getMockBuilder('Craue\ConfigBundle\Util\Config')
59 ->disableOriginalConstructor()
60 ->getMock();
61
62 $config->expects($this->any())
63 ->method('get')
64 ->with('pocket_consumer_key')
65 ->willReturn($consumerKey);
66
58 $pocket = new PocketImportMock( 67 $pocket = new PocketImportMock(
59 $this->tokenStorage, 68 $this->tokenStorage,
60 $this->em, 69 $this->em,
61 $this->contentProxy, 70 $this->contentProxy,
62 $consumerKey 71 $config
63 ); 72 );
64 73
65 $this->logHandler = new TestHandler(); 74 $this->logHandler = new TestHandler();
diff --git a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
index 6b108dd3..4ab6051b 100644
--- a/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
+++ b/src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
@@ -4,6 +4,7 @@ namespace Wallabag\UserBundle\Mailer;
4 4
5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; 5use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface;
6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; 6use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface;
7use Craue\ConfigBundle\Util\Config;
7 8
8/** 9/**
9 * Custom mailer for TwoFactorBundle email. 10 * Custom mailer for TwoFactorBundle email.
@@ -60,17 +61,16 @@ class AuthCodeMailer implements AuthCodeMailerInterface
60 * @param \Twig_Environment $twig 61 * @param \Twig_Environment $twig
61 * @param string $senderEmail 62 * @param string $senderEmail
62 * @param string $senderName 63 * @param string $senderName
63 * @param string $supportUrl 64 * @param Config $craueConfig Craue\Config instance to get wallabag support url from database
64 * @param string $wallabagUrl
65 */ 65 */
66 public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, $supportUrl, $wallabagUrl) 66 public function __construct(\Swift_Mailer $mailer, \Twig_Environment $twig, $senderEmail, $senderName, Config $craueConfig)
67 { 67 {
68 $this->mailer = $mailer; 68 $this->mailer = $mailer;
69 $this->twig = $twig; 69 $this->twig = $twig;
70 $this->senderEmail = $senderEmail; 70 $this->senderEmail = $senderEmail;
71 $this->senderName = $senderName; 71 $this->senderName = $senderName;
72 $this->supportUrl = $supportUrl; 72 $this->supportUrl = $craueConfig->get('wallabag_support_url');
73 $this->wallabagUrl = $wallabagUrl; 73 $this->wallabagUrl = $craueConfig->get('wallabag_url');
74 } 74 }
75 75
76 /** 76 /**
diff --git a/src/Wallabag/UserBundle/Resources/config/services.yml b/src/Wallabag/UserBundle/Resources/config/services.yml
index bf9e036a..d79d8fa2 100644
--- a/src/Wallabag/UserBundle/Resources/config/services.yml
+++ b/src/Wallabag/UserBundle/Resources/config/services.yml
@@ -6,8 +6,7 @@ services:
6 - "@twig" 6 - "@twig"
7 - "%scheb_two_factor.email.sender_email%" 7 - "%scheb_two_factor.email.sender_email%"
8 - "%scheb_two_factor.email.sender_name%" 8 - "%scheb_two_factor.email.sender_name%"
9 - "%wallabag_support_url%" 9 - "@craue_config"
10 - "%wallabag_url%"
11 10
12 wallabag_user.password_resetting: 11 wallabag_user.password_resetting:
13 class: Wallabag\UserBundle\EventListener\PasswordResettingListener 12 class: Wallabag\UserBundle\EventListener\PasswordResettingListener