-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathAPI.php
53 lines (41 loc) · 1.07 KB
/
API.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
<?php
namespace Piwik\Plugins\AdminNotification;
class API extends \Piwik\Plugin\API
{
private static $plugin_name = 'AdminNotification';
public function isEnabled()
{
$settings = new SystemSettings();
$enabled = $settings->enabled->getValue();
$message = $this->getMessage();
if ($enabled && !empty($message)) {
return true;
}
return false;
}
public function getTitle()
{
$settings = new SystemSettings();
return $settings->title->getValue();
}
public function getMessage()
{
$settings = new SystemSettings();
return $settings->message->getValue();
}
public function getContext()
{
$settings = new SystemSettings();
return $settings->context->getValue();
}
public function getType()
{
$settings = new SystemSettings();
return $settings->type->getValue();
}
public function getPriority()
{
$settings = new SystemSettings();
return $settings->priority->getValue();
}
}