-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathPlugin.php
More file actions
104 lines (97 loc) · 2.97 KB
/
Copy pathPlugin.php
File metadata and controls
104 lines (97 loc) · 2.97 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
<?php namespace Winter\Location;
use Backend;
use System\Classes\PluginBase;
/**
* Location Plugin
*
* Location based features, such as Country and State
*
* @author Alexey Bobkov, Samuel Georges (original plugin)
* @author Winter CMS
*/
class Plugin extends PluginBase
{
/**
* {@inheritDoc}
*/
public function pluginDetails()
{
return [
'name' => 'winter.location::lang.plugin.name',
'description' => 'winter.location::lang.plugin.description',
'author' => 'Winter CMS',
'icon' => 'icon-globe',
'homepage' => 'https://github.com/wintercms/wn-location-plugin',
'replaces' => ['RainLab.Location' => '^1.1.6'],
];
}
/**
* {@inheritDoc}
*/
public function registerSettings()
{
return [
'location' => [
'label' => 'winter.location::lang.locations.menu_label',
'description' => 'winter.location::lang.locations.menu_description',
'category' => 'winter.location::lang.plugin.name',
'icon' => 'icon-globe',
'url' => Backend::url('winter/location/locations'),
'order' => 500,
'permissions' => ['winter.location.access_settings'],
'keywords' => 'country, countries, state',
],
'settings' => [
'label' => 'winter.location::lang.settings.menu_label',
'description' => 'winter.location::lang.settings.menu_description',
'category' => 'winter.location::lang.plugin.name',
'icon' => 'icon-map-signs',
'class' => 'Winter\Location\Models\Setting',
'order' => 600,
'permissions' => ['winter.location.access_settings'],
]
];
}
/**
* {@inheritDoc}
*/
public function registerComponents()
{
return [
'Winter\Location\Components\LocationPicker' => 'locationPicker',
];
}
/**
* {@inheritDoc}
*/
public function registerPermissions()
{
return [
'winter.location.access_settings' => ['tab' => 'winter.location::lang.plugin.name', 'label' => 'winter.location::lang.permissions.settings'],
];
}
/**
* {@inheritDoc}
*/
public function registerMarkupTags()
{
return [
'functions' => [
'form_select_country' => ['Winter\Location\Models\Country', 'formSelect'],
'form_select_state' => ['Winter\Location\Models\State', 'formSelect']
]
];
}
/**
* {@inheritDoc}
*/
public function registerFormWidgets()
{
return [
'Winter\Location\FormWidgets\AddressFinder' => [
'label' => 'Address Finder',
'code' => 'addressfinder'
]
];
}
}