aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-02-22 11:24:41 +0100
committerJeremy Benoist <j0k3r@users.noreply.github.com>2016-02-22 11:24:41 +0100
commit12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033 (patch)
treefcdf0fd0c237aa4ec9bd5a7a27f65933598a4775
parenteabb9771f47fe226ecdf5a586cc88bee982620ea (diff)
parent077ddbe1aef64326f39e5e9a9f27517dd8d6ea44 (diff)
downloadwallabag-12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033.tar.gz
wallabag-12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033.tar.zst
wallabag-12b5a8cea12c7c8b10ede7fd00d1f07ca06b1033.zip
Merge pull request #1702 from wallabag/v2-piwik
Added Piwik implementation
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml3
-rw-r--r--app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml3
-rw-r--r--app/config/services.yml6
-rw-r--r--composer.json3
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php15
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php15
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/base.html.twig4
7 files changed, 48 insertions, 1 deletions
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
index 1c47ed2d..719e51ea 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.en.yml
@@ -22,3 +22,6 @@ export: "export"
22import: "import" 22import: "import"
23misc: "misc" 23misc: "misc"
24modify_settings: "apply" 24modify_settings: "apply"
25piwik_host: Host of your website in Piwik
26piwik_site_id: ID of your website in Piwik
27piwik_enabled: Enable Piwik
diff --git a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
index ddb78a13..ab5dfc72 100644
--- a/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
+++ b/app/Resources/CraueConfigBundle/translations/CraueConfigBundle.fr.yml
@@ -22,3 +22,6 @@ export: "export"
22import: "import" 22import: "import"
23misc: "divers" 23misc: "divers"
24modify_settings: "appliquer" 24modify_settings: "appliquer"
25piwik_host: URL de votre site dans Piwik
26piwik_site_id: ID de votre site dans Piwik
27piwik_enabled: Activer Piwik
diff --git a/app/config/services.yml b/app/config/services.yml
index 80d6c1a1..e0683ffc 100644
--- a/app/config/services.yml
+++ b/app/config/services.yml
@@ -19,6 +19,12 @@ services:
19 tags: 19 tags:
20 - { name: twig.extension } 20 - { name: twig.extension }
21 21
22 wallabag.twig_piwik_extension:
23 class: PiwikTwigExtension\PiwikTwigExtension
24 public: false
25 tags:
26 - { name: twig.extension }
27
22 wallabag.locale_listener: 28 wallabag.locale_listener:
23 class: Wallabag\CoreBundle\EventListener\LocaleListener 29 class: Wallabag\CoreBundle\EventListener\LocaleListener
24 arguments: ["%kernel.default_locale%"] 30 arguments: ["%kernel.default_locale%"]
diff --git a/composer.json b/composer.json
index 497b8012..c65ebda1 100644
--- a/composer.json
+++ b/composer.json
@@ -64,7 +64,8 @@
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 "craue/config-bundle": "~1.4",
68 "mnapoli/piwik-twig-extension": "^1.0"
68 }, 69 },
69 "require-dev": { 70 "require-dev": {
70 "doctrine/doctrine-fixtures-bundle": "~2.2", 71 "doctrine/doctrine-fixtures-bundle": "~2.2",
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index b3e20ceb..93520f9a 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -312,6 +312,21 @@ class InstallCommand extends ContainerAwareCommand
312 'value' => 'http://v2.wallabag.org', 312 'value' => 'http://v2.wallabag.org',
313 'section' => 'misc', 313 'section' => 'misc',
314 ], 314 ],
315 [
316 'name' => 'piwik_enabled',
317 'value' => '0',
318 'section' => 'analytics',
319 ],
320 [
321 'name' => 'piwik_host',
322 'value' => 'http://v2.wallabag.org',
323 'section' => 'analytics',
324 ],
325 [
326 'name' => 'piwik_site_id',
327 'value' => '1',
328 'section' => 'analytics',
329 ],
315 ]; 330 ];
316 331
317 foreach ($settings as $setting) { 332 foreach ($settings as $setting) {
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
index 5e89c2a9..10b60f30 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadSettingData.php
@@ -110,6 +110,21 @@ class LoadSettingData extends AbstractFixture implements OrderedFixtureInterface
110 'value' => 'http://v2.wallabag.org', 110 'value' => 'http://v2.wallabag.org',
111 'section' => 'misc', 111 'section' => 'misc',
112 ], 112 ],
113 [
114 'name' => 'piwik_enabled',
115 'value' => '0',
116 'section' => 'analytics',
117 ],
118 [
119 'name' => 'piwik_host',
120 'value' => 'http://v2.wallabag.org',
121 'section' => 'analytics',
122 ],
123 [
124 'name' => 'piwik_site_id',
125 'value' => '1',
126 'section' => 'analytics',
127 ],
113 ]; 128 ];
114 129
115 foreach ($settings as $setting) { 130 foreach ($settings as $setting) {
diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
index 1742b4aa..3cadabfb 100644
--- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig
@@ -71,5 +71,9 @@
71 <div id="warning_message"> 71 <div id="warning_message">
72 You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a> 72 You're trying wallabag v2, which is in alpha version. If you find a bug, please have a look to <a href="https://github.com/wallabag/wallabag/issues">our issues list</a> and <a href="https://github.com/wallabag/wallabag/issues/new">open a new if necessary</a>
73 </div> 73 </div>
74
75 {% if craue_setting('piwik_enabled') %}
76 {{ piwik(craue_setting('piwik_host'), craue_setting('piwik_site_id')) }}
77 {% endif %}
74 </body> 78 </body>
75</html> 79</html>