-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathPlugin.php
57 lines (52 loc) · 1.72 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
<?php namespace Vdomah\Telegram;
/**
* This file is part of the Telegram plugin for OctoberCMS.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* (c) Anton Romanov <iam+octobercms@theone74.ru>
*/
use System\Classes\PluginBase;
use Vdomah\Telegram\Classes\RegisterWidgets;
class Plugin extends PluginBase
{
public function registerComponents()
{
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'vdomah.telegram::lang.settings.page_name',
'description' => 'vdomah.telegram::lang.settings.page_desc',
'category' => 'vdomah.telegram::lang.plugin.name',
'icon' => 'icon-paper-plane',
'class' => 'Vdomah\Telegram\Models\TelegramInfoSettings',
'order' => 500,
'keywords' => 'telegram bot',
'permissions' => ['vdomah.telegram.settings']
]
];
}
public function registerFormWidgets()
{
return [
'Vdomah\Telegram\FormWidgets\TelegramChat' => [
'label' => 'Telegram Chat',
'code' => 'telechat',
'alias' => 'telechat',
],
'Vdomah\Telegram\FormWidgets\CheckWebhook' => [
'label' => 'Telegram check webhook button',
'code' => 'checkwebhook',
'alias' => 'checkwebhook',
],
];
}
public function boot() {
\Event::listen('pages.builder.registerControls', function($controlLibrary) {
new RegisterWidgets($controlLibrary);
});
}
}