diff options
Diffstat (limited to 'src/Wallabag')
16 files changed, 65 insertions, 40 deletions
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; | |||
8 | use PHPePub\Core\EPub; | 8 | use PHPePub\Core\EPub; |
9 | use PHPePub\Core\Structure\OPF\DublinCore; | 9 | use PHPePub\Core\Structure\OPF\DublinCore; |
10 | use Symfony\Component\HttpFoundation\Response; | 10 | use Symfony\Component\HttpFoundation\Response; |
11 | use 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' | |||
13 | all: 'Tous les articles' | 13 | all: 'Tous les articles' |
14 | tags: 'Tags' | 14 | tags: 'Tags' |
15 | config: 'Configuration' | 15 | config: 'Configuration' |
16 | internal settings: 'Configuration interne' | ||
16 | import: 'Importer' | 17 | import: 'Importer' |
17 | howto: 'Aide' | 18 | howto: 'Aide' |
18 | logout: 'Déconnexion' | 19 | logout: '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 }}&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 }}&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 }}&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 }}&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 }}¬es=&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 }}¬es=&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&method=id&value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %} |
21 | {% if export_epub %}<li><a href="?epub&method=id&value={{ entry.id }}" title="Generate ePub file">EPUB</a></li>{% endif %} | 21 | {% if craue_setting('export_mobi') %}<li><a href="?mobi&method=id&value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %} |
22 | {% if export_mobi %}<li><a href="?mobi&method=id&value={{ entry.id }}" title="Generate Mobi file">MOBI</a></li>{% endif %} | 22 | {% if craue_setting('export_pdf') %}<li><a href="?pdf&method=id&value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %} |
23 | {% if export_pdf %}<li><a href="?pdf&method=id&value={{ entry.id }}" title="Generate PDF file">PDF</a></li>{% endif %} | ||
24 | <li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&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&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 }}&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 }}&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 }}¬es=&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 }}¬es=&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 }}&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 }}&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 | |||
11 | use Wallabag\CoreBundle\Entity\Entry; | 11 | use Wallabag\CoreBundle\Entity\Entry; |
12 | use Wallabag\CoreBundle\Entity\Tag; | 12 | use Wallabag\CoreBundle\Entity\Tag; |
13 | use Wallabag\CoreBundle\Helper\ContentProxy; | 13 | use Wallabag\CoreBundle\Helper\ContentProxy; |
14 | use Craue\ConfigBundle\Util\Config; | ||
14 | 15 | ||
15 | class PocketImport implements ImportInterface | 16 | class 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 | ||
5 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; | 5 | use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; |
6 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; | 6 | use Scheb\TwoFactorBundle\Mailer\AuthCodeMailerInterface; |
7 | use 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 |