This repository has been archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.php
88 lines (79 loc) · 2.34 KB
/
Plugin.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
namespace Klaasie\Pushbullet;
use App;
use Backend;
use Event;
use Illuminate\Foundation\AliasLoader;
use Klaasie\Pushbullet\Classes\EventListeners\ExceptionListener;
use Klaasie\Pushbullet\Classes\EventListeners\LogListener;
use Klaasie\Pushbullet\Facades\Pushbullet as PushbulletFacade;
use Klaasie\Pushbullet\ServiceProvider\Pushbullet as PushbulletServiceProvider;
use System\Classes\PluginBase;
/**
* Class Plugin
*
* @package Klaasie\Pushbullet
*/
class Plugin extends PluginBase
{
/**
* {@inheritdoc}
*/
public function pluginDetails()
{
return [
'name' => 'klaasie.pushbullet::lang.plugin.name',
'description' => 'klaasie.pushbullet::lang.plugin.description',
'author' => 'Klaas Poortinga',
'icon' => 'icon-commenting-o',
'homepage' => 'https://github.com/Klaasie/oc-pushbullet-plugin',
];
}
/**
* {@inheritdoc}
*/
public function register()
{
App::register(PushbulletServiceProvider::class);
$alias = AliasLoader::getInstance();
$alias->alias('Pushbullet', PushbulletFacade::class);
$this->registerEventListeners();
}
/**
* {@inheritdoc}
*/
public function registerPermissions()
{
return [
'klaasie.pushbullet.access_settings' => [
'tab' => 'klaasie.pushbullet::lang.permissions.tab',
'label' => 'klaasie.pushbullet::lang.permissions.label'
],
];
}
/**
* {@inheritdoc}
*/
public function registerSettings()
{
return [
'pushbullet' => [
'label' => 'klaasie.pushbullet::lang.settings.label',
'description' => 'klaasie.pushbullet::lang.settings.description',
'category' => 'klaasie.pushbullet::lang.settings.category',
'icon' => 'icon-commenting-o',
'url' => Backend::url('klaasie/pushbullet/settings'),
'order' => 500,
'permissions' => ['klaasie.pushbullet.access_settings']
]
];
}
/**
* Register event listeners
*/
private function registerEventListeners()
{
Event::subscribe(new LogListener());
Event::subscribe(new ExceptionListener());
}
}