From aab265709abf6b8fc058306fee1e6b5c426c3c87 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 20 Jun 2011 17:06:17 -0400 Subject: [PATCH] use old-style plugin initializers as fallback for GoogleAnalytics --- plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php index dff43eff95..9912b71543 100644 --- a/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php +++ b/plugins/GoogleAnalytics/GoogleAnalyticsPlugin.php @@ -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 = <<