aboutsummaryrefslogtreecommitdiffstats
path: root/addon/piwik/piwik.php
diff options
context:
space:
mode:
authorTobias Diekershoff <tobias.diekershoff@gmx.net>2011-06-23 20:47:24 +0200
committerTobias Diekershoff <tobias.diekershoff@gmx.net>2011-06-23 20:47:24 +0200
commit6a491db3e0fa0471725bcc875e8c393bc0f6ffdb (patch)
tree5941f1d0c1ed3d5e517a84cea345b14133b05d08 /addon/piwik/piwik.php
parentfa778e0040df784c9eec5392731473e58fbfa0be (diff)
downloadvolse-hubzilla-6a491db3e0fa0471725bcc875e8c393bc0f6ffdb.tar.gz
volse-hubzilla-6a491db3e0fa0471725bcc875e8c393bc0f6ffdb.tar.bz2
volse-hubzilla-6a491db3e0fa0471725bcc875e8c393bc0f6ffdb.zip
admin interface stuff for the piwik addon
Diffstat (limited to 'addon/piwik/piwik.php')
-rw-r--r--addon/piwik/piwik.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/addon/piwik/piwik.php b/addon/piwik/piwik.php
index 032f84f4b..94aa9b55c 100644
--- a/addon/piwik/piwik.php
+++ b/addon/piwik/piwik.php
@@ -70,4 +70,21 @@ function piwik_analytics($a,&$b) {
}
}
-
+function piwik_plugin_admin (&$a, &$o) {
+ $t = file_get_contents( dirname(__file__)."/admin.tpl");
+ $o = replace_macros( $t, array(
+ '$submit' => t('Submit'),
+ '$baseurl' => array('baseurl', t('Piwik Base URL'), get_config('piwik','baseurl' ), ''),
+ '$sideid' => array('sideid', t('Side ID'), get_config('piwik','sideid' ), ''),
+ '$optout' => array('optout', t('Show opt-out cookie link?'), get_config('piwik','optout' ), ''),
+ ));
+}
+function piwik_plugin_admin_post (&$a) {
+ $url = ((x($_POST, 'baseurl')) ? notags(trim($_POST['baseurl'])) : '');
+ $id = ((x($_POST, 'sideid')) ? trim($_POST['sideid']) : '');
+ $optout = ((x($_POST, 'optout')) ? trim($_POST['optout']) : '');
+ set_config('piwik', 'baseurl', $url);
+ set_config('piwik', 'sideid', $id);
+ set_config('piwik', 'optout', $optout);
+ info( t('Settings updated.'). EOL);
+}