forked from mavitm/oc_estate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
executable file
·126 lines (115 loc) · 4.98 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
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
<?php namespace Awebsome\Realestate;
use Backend;
use System\Classes\PluginBase;
class Plugin extends PluginBase
{
public $require = ['RainLab.Translate', 'GinoPane.AwesomeIconsList'];
public function pluginDetails()
{
return [
'name' => 'awebsome.realestate::lang.plugin.name',
'description' => 'awebsome.realestate::lang.plugin.description',
'author' => 'Awebsome',
'icon' => 'icon-building',
'homepage' => ''
];
}
public function registerComponents()
{
return [
'Awebsome\Realestate\Components\SearchForm' => 'search_form',
'Awebsome\Realestate\Components\Realtylist' => 'realty_list',
'Awebsome\Realestate\Components\Realtydetail' => 'realty_detail',
'Awebsome\Realestate\Components\Category' => 'realty_category',
'Awebsome\Realestate\Components\ContactForm' => 'contact_form',
'Awebsome\Realestate\Components\PopularList' => 'popular_list',
'Awebsome\Realestate\Components\NewestList' => 'newest_list'
];
}
public function registerPermissions()
{
return [
'awebsome.realestate.access.realty' => [
'tab' => 'awebsome.realestate::lang.plugin.name',
'label' => 'awebsome.realestate::lang.plugin.name'
]
];
}
public function registerNavigation()
{
return [
'estate' => [
'label' => 'awebsome.realestate::lang.plugin.name',
'url' => Backend::url('awebsome/realestate/realties'),
'icon' => 'icon-building',
'permissions' => ['awebsome.realestate.access.realty'],
'sideMenu' => [
'realty' => [
'label' => 'awebsome.realestate::lang.plugin.name',
'url' => Backend::url('awebsome/realestate/realties'),
'icon' => 'icon-building-o',
'permissions' => ['awebsome.realestate.access.realty']
],
'category' => [
'label' => 'awebsome.realestate::lang.plugin.category',
'url' => Backend::url('awebsome/realestate/categories'),
'icon' => 'icon-folder',
'permissions' =>['awebsome.realestate.access.realty']
],
'feature' => [
'label' => 'awebsome.realestate::lang.plugin.features',
'url' => Backend::url('awebsome/realestate/features'),
'icon' => 'icon-check-square-o',
'permissions' =>['awebsome.realestate.access.realty']
],
'tags' => [
'label' => 'awebsome.realestate::lang.tags.title',
'url' => Backend::url('awebsome/realestate/tags'),
'icon' => 'icon-tags',
'permissions' => ['awebsome.realestate.access.realty']
],
'setting' => [
'label' => 'awebsome.realestate::lang.settings.menuLabel',
'url' => Backend::url('system/settings/update/awebsome/realestate/settings'),
'icon' => 'icon-cog',
'permissions' => ['awebsome.realestate.access.realty']
],
'messages' => [
'label' => 'awebsome.realestate::lang.plugin.messages',
'url' => Backend::url('awebsome/realestate/messages'),
'icon' => 'icon-envelope',
'permissions' => ['awebsome.realestate.access.realty']
]
]
]
];
}
public function registerMarkupTags()
{
return [
'filters' => [
'base64_enc' => [$this, 'encode'],
'base64_dec' => [$this, 'decode'],
],
];
}
public function encode($img) {
return base64_encode($img);
}
public function decode($img) {
return base64_decode($img);
}
public function registerSettings()
{
return [
'settings' => [
'label' => 'awebsome.realestate::lang.settings.menuLabel',
'description' => 'awebsome.realestate::lang.settings.menuDescription',
'category' => 'awebsome.realestate::lang.plugin.name',
'icon' => 'icon-cog',
'class' => 'Awebsome\Realestate\Models\Settings',
'order' => 100
],
];
}
}