]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Use a different way to use piwik 1702/head
authorJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Feb 2016 09:58:43 +0000 (10:58 +0100)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Mon, 22 Feb 2016 10:11:08 +0000 (11:11 +0100)
app/config/services.yml
src/Wallabag/CoreBundle/Resources/views/base.html.twig
src/Wallabag/CoreBundle/Twig/WallabagPiwikExtension.php [deleted file]

index 71862fd254b93caecc88f076501a9b9d3ffba2d8..e0683ffc7256369109b9e6bed67ed188c438e1c9 100644 (file)
@@ -20,10 +20,8 @@ services:
             - { name: twig.extension }
 
     wallabag.twig_piwik_extension:
-        class: Wallabag\CoreBundle\Twig\WallabagPiwikExtension
+        class: PiwikTwigExtension\PiwikTwigExtension
         public: false
-        arguments:
-            - "@craue_config"
         tags:
             - { name: twig.extension }
 
index 8ca217283c6ec462a8ea93525fbbe176bdd46620..3cadabfb0ef72a3289dcd1349aaa7925cc4726fe 100644 (file)
@@ -71,6 +71,9 @@
         <div id="warning_message">
             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>
         </div>
-        {{ piwik() }}
+
+        {% if craue_setting('piwik_enabled') %}
+            {{ piwik(craue_setting('piwik_host'), craue_setting('piwik_site_id')) }}
+        {% endif %}
     </body>
 </html>
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagPiwikExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagPiwikExtension.php
deleted file mode 100644 (file)
index 7725cd8..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?php
-
-namespace Wallabag\CoreBundle\Twig;
-
-use Craue\ConfigBundle\Util\Config;
-use PiwikTwigExtension\PiwikTwigExtension;
-
-class WallabagPiwikExtension extends PiwikTwigExtension
-{
-    public function __construct(Config $craueConfig)
-    {
-        parent::__construct($craueConfig->get('piwik_host'), $craueConfig->get('piwik_site_id'), $craueConfig->get('piwik_enabled'));
-    }
-}