]> 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:06:17 +0000 (17:06 -0400)
plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php

index 4e0bdf75362c6a99b5dfcb034f2f8a9138c0e43a..640330b85007305b5cd7cb0548b30b49ecb9a504 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