forked from paramoredigital/Notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NotifierPlugin.php
60 lines (49 loc) · 1.34 KB
/
NotifierPlugin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Craft;
class NotifierPlugin extends BasePlugin
{
function init()
{
require CRAFT_PLUGINS_PATH .'/notifier/vendor/autoload.php';
parent::init();
if (craft()->request->isSiteRequest())
{
craft()->notifier->registerErrorHandler();
}
}
function getName()
{
return Craft::t('Notifier');
}
function getVersion()
{
return '1.1';
}
function getDeveloper()
{
return 'Paramore | The digital agency + Electric Putty Digital';
}
function getDeveloperUrl()
{
return 'http://paramoredigital.com';
}
protected function defineSettings()
{
return array(
'defaultNotifier' => array(AttributeType::String),
'airbrakeApiEndpoint' => array(AttributeType::String),
'airbrakeApiKey' => array(AttributeType::String),
'airbrakeProjectId' => array(AttributeType::String),
'airbrakeProjectKey' => array(AttributeType::String)
);
}
public function getSettingsHtml()
{
return craft()->templates->render('notifier/settings', array('settings' => $this->getSettings()));
}
public function sendToNotifier($message)
{
craft()->notifier->sendString($message);
}
}
/* End of NotifierPlugin.php */