mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-01-10 00:38:04 +08:00
36 lines
728 B
PHP
36 lines
728 B
PHP
|
<?php
|
||
|
|
||
|
class PiwikAnalyticsPlugin extends \RainLoop\Plugins\AbstractPlugin
|
||
|
{
|
||
|
/**
|
||
|
* @return void
|
||
|
*/
|
||
|
public function Init()
|
||
|
{
|
||
|
if ('' !== $this->Config()->Get('plugin', 'account', ''))
|
||
|
{
|
||
|
$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);
|
||
|
}
|
||
|
}
|