-
Notifications
You must be signed in to change notification settings - Fork 1
/
Plugin.php
65 lines (57 loc) · 1.61 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
<?php namespace AspenDigital\LookFeel;
use App;
use Event;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
/** @var \Backend\Classes\Controller */
protected $controller;
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'Aspen Digital Look & Feel',
'description' => 'Customizations to October CMS behavior',
'author' => 'Aspen Digital',
'homepage' => 'http://www.aspendigital.com'
];
}
public function boot()
{
if (!App::runningInBackend()) {
return;
}
// Overrides specifically for Pages plugin
if (class_exists('RainLab\Pages\Classes\Page')) {
Event::listen('backend.form.extendFieldsBefore', function($widget) {
$event = new Classes\ExtendPageForm();
$event->handle($widget);
});
$handler = new Classes\ExtendPageModel();
$handler->boot();
}
}
/**
* Returns any back-end Form Widgets implemented in this plugin
* @return array
*/
public function registerFormWidgets()
{
return [
'AspenDigital\LookFeel\FormWidgets\MultiConditional' => 'multiconditional'
];
}
public function registerPermissions()
{
return [
'aspendigital.lookfeel.see_hidden_elements' => [
'label' => 'See hidden elements in lists',
'tab' => 'Look & Feel'
]
];
}
}