update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
296343bf3b
commit
d885a4baa9
5833 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -15,8 +15,9 @@ use Piwik\Plugins\MobileMessaging\APIException;
|
|||
use Piwik\Plugins\MobileMessaging\SMSProvider;
|
||||
|
||||
require_once PIWIK_INCLUDE_PATH . "/plugins/MobileMessaging/APIException.php";
|
||||
|
||||
/**
|
||||
*
|
||||
* @ignore
|
||||
*/
|
||||
class Clockwork extends SMSProvider
|
||||
{
|
||||
|
|
@ -31,6 +32,27 @@ class Clockwork extends SMSProvider
|
|||
const MAXIMUM_FROM_LENGTH = 11;
|
||||
const MAXIMUM_CONCATENATED_SMS = 3;
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return 'Clockwork';
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return 'You can use <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/"><img src="plugins/MobileMessaging/images/Clockwork.png"/></a> to send SMS Reports from Piwik.<br/>
|
||||
<ul>
|
||||
<li> First, <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/platforms/piwik/">get an API Key from Clockwork</a> (Signup is free!)
|
||||
</li><li> Enter your Clockwork API Key on this page. </li>
|
||||
</ul>
|
||||
<br/><em>About Clockwork: </em><ul>
|
||||
<li>Clockwork gives you fast, reliable high quality worldwide SMS delivery, over 450 networks in every corner of the globe.
|
||||
</li><li>Cost per SMS message is around ~0.08USD (0.06EUR).
|
||||
</li><li>Most countries and networks are supported but we suggest you check the latest position on their coverage map <a target="_blank" href="?module=Proxy&action=redirect&url=http://www.clockworksms.com/sms-coverage/">here</a>.
|
||||
</li>
|
||||
</ul>
|
||||
';
|
||||
}
|
||||
|
||||
public function verifyCredential($apiKey)
|
||||
{
|
||||
$this->getCreditLeft($apiKey);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,57 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
namespace Piwik\Plugins\MobileMessaging\SMSProvider;
|
||||
|
||||
use Piwik\Notification;
|
||||
use Piwik\Plugins\MobileMessaging\SMSProvider;
|
||||
use Piwik\Development as PiwikDevelopment;
|
||||
|
||||
/**
|
||||
* Used for development only
|
||||
*
|
||||
* @ignore
|
||||
*/
|
||||
class Development extends SMSProvider
|
||||
{
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return 'Development';
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return 'Development SMS Provider<br />All sent SMS will be displayed as Notification';
|
||||
}
|
||||
|
||||
public function isAvailable()
|
||||
{
|
||||
return PiwikDevelopment::isEnabled();
|
||||
}
|
||||
|
||||
public function verifyCredential($apiKey)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function sendSMS($apiKey, $smsText, $phoneNumber, $from)
|
||||
{
|
||||
$message = sprintf('An SMS was sent:<br />From: %s<br />To: %s<br />Message: %s', $from, $phoneNumber, $smsText);
|
||||
|
||||
$notification = new Notification($message);
|
||||
$notification->raw = true;
|
||||
$notification->context = Notification::CONTEXT_INFO;
|
||||
Notification\Manager::notify('StubbedSMSProvider'.preg_replace('/[^a-z0-9]/', '', $phoneNumber), $notification);
|
||||
}
|
||||
|
||||
public function getCreditLeft($apiKey)
|
||||
{
|
||||
return 'Balance: 42';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -13,10 +13,26 @@ use Piwik\Plugins\MobileMessaging\SMSProvider;
|
|||
/**
|
||||
* Used for testing
|
||||
*
|
||||
* @ignore
|
||||
*/
|
||||
class StubbedProvider extends SMSProvider
|
||||
{
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return 'StubbedProvider';
|
||||
}
|
||||
|
||||
public function getDescription()
|
||||
{
|
||||
return 'Only during testing available';
|
||||
}
|
||||
|
||||
public function isAvailable()
|
||||
{
|
||||
return defined('PIWIK_TEST_MODE') && PIWIK_TEST_MODE;
|
||||
}
|
||||
|
||||
public function verifyCredential($apiKey)
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue