-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathPlugin.php
executable file
·74 lines (66 loc) · 2.27 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
<?php namespace PeterHegman\SlickSlider;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public function registerComponents()
{
return [
'PeterHegman\SlickSlider\Components\Slider' => 'slider'
];
}
public function registerPageSnippets()
{
return [
'PeterHegman\SlickSlider\Components\Slider' => 'slider'
];
}
public function registerMarkupTags()
{
return [
'functions' => [
// Using an inline closure
'numberToBoolean' => [$this, 'numberToBoolean']
]
];
}
public function numberToBoolean($number)
{
if ($number == 1) {
return 'true';
} else {
return 'false';
}
}
public function registerPermissions()
{
return [
'peterhegman.slickslider.manage_slide_shows' => [
'label' => 'peterhegman.slickslider::lang.slickslider.manage_slide_shows',
'tab' => 'peterhegman.slickslider::lang.plugin.name'
],
'peterhegman.slickslider.manage_slides' => [
'label' => 'peterhegman.slickslider::lang.slickslider.manage_slides',
'tab' => 'peterhegman.slickslider::lang.plugin.name'
],
'peterhegman.slickslider.create_slide_shows' => [
'tab' => 'peterhegman.slickslider::lang.plugin.name',
'label' => 'peterhegman.slickslider::lang.slickslider.create_slide_shows_label'
]
];
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'Slide Show Settings',
'description' => 'Manage default slide show settings. These settings will only be used when a user that doesn\'t have access to the settings page creates a slide show',
'category' => 'Slide Shows',
'icon' => 'icon-cog',
'class' => 'peterhegman\slickslider\Models\Settings',
'order' => 500,
'keywords' => 'slide show settings',
'permissions' => ['peterhegman.slickslider.manage_slide_shows']
]
];
}
}