X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=plugins%2Fpiwik%2Fpiwik.php;h=ca00c2be71f33dd566be43fb2fb2f791d41e26cf;hb=286757ab29660916f6b66d1fc0ad3b53aef337c8;hp=7c44909c6e47cf1223e3f26dfcbd6dd89a5bfc4d;hpb=849d1650c1af853162b749af896c20bb25d4a4e8;p=github%2Fshaarli%2FShaarli.git
diff --git a/plugins/piwik/piwik.php b/plugins/piwik/piwik.php
index 7c44909c..ca00c2be 100644
--- a/plugins/piwik/piwik.php
+++ b/plugins/piwik/piwik.php
@@ -18,8 +18,8 @@ function piwik_init($conf)
$piwikUrl = $conf->get('plugins.PIWIK_URL');
$piwikSiteid = $conf->get('plugins.PIWIK_SITEID');
if (empty($piwikUrl) || empty($piwikSiteid)) {
- $error = 'Piwik plugin error: ' .
- 'Please define PIWIK_URL and PIWIK_SITEID in the plugin administration page.';
+ $error = t('Piwik plugin error: ' .
+ 'Please define PIWIK_URL and PIWIK_SITEID in the plugin administration page.');
return array($error);
}
}
@@ -50,22 +50,24 @@ function hook_piwik_render_footer($data, $conf)
}
// Free elements at the end of the page.
- $data['endofpage'][] = '' .
-'' .
-'' .
-'';
+ $data['endofpage'][] = sprintf(
+ file_get_contents(PluginManager::$PLUGINS_PATH . '/piwik/piwik.html'),
+ $piwikUrl,
+ $piwikSiteid,
+ $piwikUrl,
+ $piwikSiteid
+ );
return $data;
}
+/**
+ * This function is never called, but contains translation calls for GNU gettext extraction.
+ */
+function piwik_dummy_translation()
+{
+ // meta
+ t('A plugin that adds Piwik tracking code to Shaarli pages.');
+ t('Piwik URL');
+ t('Piwik site ID');
+}