forked from GNUsocial/gnu-social
use old-style plugin initializers as fallback for GoogleAnalytics
This commit is contained in:
parent
34a2152d0a
commit
42f3fedd43
@ -49,6 +49,9 @@ if (!defined('STATUSNET')) {
|
|||||||
*/
|
*/
|
||||||
class GoogleAnalyticsPlugin extends Plugin
|
class GoogleAnalyticsPlugin extends Plugin
|
||||||
{
|
{
|
||||||
|
var $code;
|
||||||
|
var $domain;
|
||||||
|
|
||||||
const VERSION = '0.2';
|
const VERSION = '0.2';
|
||||||
|
|
||||||
function __construct($code=null)
|
function __construct($code=null)
|
||||||
@ -64,7 +67,13 @@ class GoogleAnalyticsPlugin extends Plugin
|
|||||||
function onEndShowScripts($action)
|
function onEndShowScripts($action)
|
||||||
{
|
{
|
||||||
$code = common_config('googleanalytics', 'code');
|
$code = common_config('googleanalytics', 'code');
|
||||||
|
if (empty($code)) {
|
||||||
|
$code = $this->code;
|
||||||
|
}
|
||||||
$domain = common_config('googleanalytics', 'domain');
|
$domain = common_config('googleanalytics', 'domain');
|
||||||
|
if (empty($domain)) {
|
||||||
|
$domain = $this->domain;
|
||||||
|
}
|
||||||
|
|
||||||
$js = <<<ENDOFSCRIPT0
|
$js = <<<ENDOFSCRIPT0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user