This repository was archived by the owner on May 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathPlugin.php
More file actions
137 lines (127 loc) · 4.04 KB
/
Plugin.php
File metadata and controls
137 lines (127 loc) · 4.04 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?php
declare(strict_types=1);
namespace Adrenth\RssFetcher;
use Backend;
use System\Classes\PluginBase;
/**
* Class Plugin
*
* @package Adrenth\RssFetcher
*/
class Plugin extends PluginBase
{
/**
* {@inheritdoc}
*/
public function pluginDetails(): array
{
return [
'name' => 'adrenth.rssfetcher::lang.plugin.name',
'description' => 'adrenth.rssfetcher::lang.plugin.name',
'author' => 'A. Drenth <adrenth@gmail.com>',
'icon' => 'icon-rss',
'homepage' => 'http://github.com/adrenth/rssfetcher'
];
}
/**
* {@inheritdoc}
*/
public function register()
{
$this->registerConsoleCommand(
'Adrenth.RssFetcher',
Commands\FetchRssCommand::class
);
}
/**
* {@inheritdoc}
*/
public function registerComponents(): array
{
return [
Components\Items::class => 'rssItems',
Components\PaginatableItems::class => 'rssPaginatableItems',
Components\Sources::class => 'rssSources'
];
}
/**
* {@inheritdoc}
*/
public function registerReportWidgets(): array
{
return [
ReportWidgets\Headlines::class => [
'label' => 'RSS Headlines',
'code' => 'headlines'
]
];
}
/**
* {@inheritdoc}
*/
public function registerPermissions(): array
{
return [
'adrenth.rssfetcher.access_sources' => [
'tab' => 'adrenth.rssfetcher::lang.plugin.name',
'label' => 'adrenth.rssfetcher::lang.permissions.access_sources'
],
'adrenth.rssfetcher.access_items' => [
'tab' => 'adrenth.rssfetcher::lang.plugin.name',
'label' => 'adrenth.rssfetcher::lang.permissions.access_items'
],
'adrenth.rssfetcher.access_import_export' => [
'tab' => 'adrenth.rssfetcher::lang.plugin.name',
'label' => 'adrenth.rssfetcher::lang.permissions.access_import_export'
],
'adrenth.rssfetcher.access_feeds' => [
'tab' => 'adrenth.rssfetcher::lang.plugin.name',
'label' => 'adrenth.rssfetcher::lang.permissions.access_feeds'
]
];
}
/**
* {@inheritdoc}
*/
public function registerNavigation(): array
{
return [
'rssfetcher' => [
'label' => 'adrenth.rssfetcher::lang.navigation.menu_label',
'url' => Backend::url('adrenth/rssfetcher/sources'),
'icon' => 'icon-rss',
'permissions' => ['adrenth.rssfetcher.*'],
'order' => 500,
'sideMenu' => [
'sources' => [
'label' => 'adrenth.rssfetcher::lang.navigation.side_menu_label_sources',
'icon' => 'icon-globe',
'url' => Backend::url('adrenth/rssfetcher/sources'),
'permissions' => ['adrenth.rssfetcher.access_sources']
],
'items' => [
'label' => 'adrenth.rssfetcher::lang.navigation.side_menu_label_items',
'icon' => 'icon-files-o',
'url' => Backend::url('adrenth/rssfetcher/items'),
'permissions' => ['adrenth.rssfetcher.access_items']
],
'feeds' => [
'label' => 'adrenth.rssfetcher::lang.navigation.side_menu_label_feeds',
'icon' => 'icon-rss',
'url' => Backend::url('adrenth/rssfetcher/feeds'),
'permissions' => ['adrenth.rssfetcher.access_feeds']
]
]
]
];
}
/**
* {@inheritdoc}
*/
public function registerFormWidgets(): array
{
return [
FormWidgets\TextWithPrefix::class => 'textWithPrefix'
];
}
}