]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use old-style plugin initializers as fallback for GoogleAnalytics
authorEvan Prodromou <evan@status.net>
Mon, 20 Jun 2011 21:06:17 +0000 (17:06 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 20 Jun 2011 21:07:17 +0000 (17:07 -0400)
plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php

index dff43eff95ccf6b550bbf3579b04b0f8cb099e46..9912b71543de9ff8e4f97e4b9c05bc58f92221b3 100644 (file)
@@ -49,6 +49,9 @@ if (!defined('STATUSNET')) {
  */
 class GoogleAnalyticsPlugin extends Plugin
 {
+    var $code;
+    var $domain;
+
     const VERSION = '0.2';
 
     function __construct($code=null)
@@ -64,7 +67,13 @@ class GoogleAnalyticsPlugin extends Plugin
     function onEndShowScripts($action)
     {
         $code = common_config('googleanalytics', 'code');
+        if (empty($code)) {
+            $code = $this->code;
+        }
         $domain = common_config('googleanalytics', 'domain');
+        if (empty($domain)) {
+            $domain = $this->domain;
+        }
 
         $js = <<<ENDOFSCRIPT0