|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace GinoPane\AwesomeIconsList; |
|
4
|
|
|
|
|
5
|
|
|
use GinoPane\AwesomeIconsList\Components\FontAwesomeCssLink; |
|
6
|
|
|
use GinoPane\AwesomeIconsList\FormWidgets\AwesomeIconsList; |
|
7
|
|
|
use GinoPane\AwesomeIconsList\Models\Settings; |
|
8
|
|
|
use System\Classes\PluginBase; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class Plugin |
|
12
|
|
|
* |
|
13
|
|
|
* @package GinoPane\AwesomeIconsList |
|
14
|
|
|
*/ |
|
15
|
|
|
class Plugin extends PluginBase |
|
16
|
|
|
{ |
|
17
|
|
|
const DEFAULT_ICON = 'icon-magic'; |
|
18
|
|
|
|
|
19
|
|
|
const LOCALIZATION_KEY = 'ginopane.awesomeiconslist::lang.'; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* Returns information about this plugin |
|
23
|
|
|
* |
|
24
|
|
|
* @return array |
|
25
|
|
|
*/ |
|
26
|
|
|
public function pluginDetails(): array |
|
27
|
|
|
{ |
|
28
|
|
|
return [ |
|
29
|
|
|
'name' => self::LOCALIZATION_KEY . 'plugin.name', |
|
30
|
|
|
'description' => self::LOCALIZATION_KEY . 'plugin.description', |
|
31
|
|
|
'author' => 'Siarhei <Gino Pane> Karavai', |
|
32
|
|
|
'icon' => self::DEFAULT_ICON, |
|
33
|
|
|
'homepage' => 'https://github.com/ginopane/oc-awesomeiconslist-plugin' |
|
34
|
|
|
]; |
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
public function registerFormWidgets(): array |
|
38
|
|
|
{ |
|
39
|
|
|
return [ |
|
40
|
|
|
AwesomeIconsList::class => AwesomeIconsList::DEFAULT_ALIAS |
|
41
|
|
|
]; |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* Register components |
|
46
|
|
|
* |
|
47
|
|
|
* @return array |
|
48
|
|
|
*/ |
|
49
|
|
|
public function registerComponents(): array |
|
50
|
|
|
{ |
|
51
|
|
|
return [ |
|
52
|
|
|
FontAwesomeCssLink::class => FontAwesomeCssLink::NAME, |
|
53
|
|
|
]; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Register plugin settings |
|
58
|
|
|
* |
|
59
|
|
|
* @return array |
|
60
|
|
|
*/ |
|
61
|
|
|
public function registerSettings(): array |
|
62
|
|
|
{ |
|
63
|
|
|
return [ |
|
64
|
|
|
'settings' => [ |
|
65
|
|
|
'label' => self::LOCALIZATION_KEY . 'settings.name', |
|
66
|
|
|
'description' => self::LOCALIZATION_KEY . 'settings.description', |
|
67
|
|
|
'icon' => self::DEFAULT_ICON, |
|
68
|
|
|
'class' => Settings::class, |
|
69
|
|
|
'order' => 100 |
|
70
|
|
|
] |
|
71
|
|
|
]; |
|
72
|
|
|
} |
|
73
|
|
|
} |
|
74
|
|
|
|