Fixed piwik-analytics plugin

This commit is contained in:
RainLoop Team 2014-10-31 20:48:49 +04:00
parent 139f412b6a
commit 11b66abd17
2 changed files with 38 additions and 37 deletions

View file

@ -7,7 +7,8 @@ class PiwikAnalyticsPlugin extends \RainLoop\Plugins\AbstractPlugin
*/
public function Init()
{
if ('' !== $this->Config()->Get('plugin', 'account', ''))
if ('' !== $this->Config()->Get('plugin', 'piwik_url', '') &&
'' !== $this->Config()->Get('plugin', 'site_id', ''))
{
$this->addJs('js/include.js');
}

View file

@ -9,7 +9,7 @@ $(function () {
if ('' !== sPiwikURL && '' !== sSiteID)
{
sPiwikURL = sPiwikURL.replace(/[\\\/\s]+$/, '') + '/';
if (/^https?:/i.test(sPiwikURL))
if (!/^https?:/i.test(sPiwikURL))
{
sPiwikURL = 'http://' + sPiwikURL;
}