mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-31 13:09:21 +03:00
Plugin system improvements
+ piwik analytics plugin (not tested)
This commit is contained in:
parent
4c38993c26
commit
085095b717
11 changed files with 137 additions and 11 deletions
35
plugins/piwik-analytics/index.php
Normal file
35
plugins/piwik-analytics/index.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue