mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-09 00:08:18 +08:00
36 lines
753 B
PHP
36 lines
753 B
PHP
<?php
|
|
|
|
class PiwikAnalyticsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|
{
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function Init()
|
|
{
|
|
if ('' !== $this->Config()->Get('plugin', 'piwik_url', '') &&
|
|
'' !== $this->Config()->Get('plugin', 'site_id', ''))
|
|
{
|
|
$this->addJs('js/include.js');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function configMapping()
|
|
{
|
|
$oUrl = \RainLoop\Plugins\Property::NewInstance('piwik_url')->SetLabel('Piwik URL')
|
|
->SetAllowedInJs(true);
|
|
|
|
$oSiteID = \RainLoop\Plugins\Property::NewInstance('site_id')->SetLabel('Site ID')
|
|
->SetAllowedInJs(true);
|
|
|
|
if (\method_exists($oUrl, 'SetPlaceholder'))
|
|
{
|
|
$oUrl->SetPlaceholder('http://');
|
|
$oSiteID->SetPlaceholder('');
|
|
}
|
|
|
|
return array($oUrl, $oSiteID);
|
|
}
|
|
}
|