-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPlugin.php
More file actions
171 lines (159 loc) · 5.29 KB
/
Plugin.php
File metadata and controls
171 lines (159 loc) · 5.29 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php namespace Keios\Support;
use System\Classes\PluginBase;
use Backend;
/**
* Support Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* @var array
*/
public $require = [
// One of these two is required
// 'Keios.ProUser',
// 'RainLab.User',
'RainLab.Translate',
];
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'keios.support::lang.plugin.name',
'description' => 'keios.support::lang.plugin.description',
'author' => 'keios',
'icon' => 'icon-leaf',
];
}
/**
* Registers settings
*
* @return array
*/
public function registerSettings()
{
return [
'settings' => [
'label' => 'Support Settings',
'description' => 'Setup Ticket System',
'icon' => 'icon-life-ring',
'class' => 'Keios\Support\Models\Settings',
'keywords' => 'support, tickets',
'permissions' => ['keios.support.settings'],
'order' => 600,
],
];
}
/**
* Registers components
*
* @return array
*/
public function registerComponents()
{
return [
'Keios\Support\Components\TicketForm' => 'ticket_form',
'Keios\Support\Components\TicketList' => 'ticket_list',
'Keios\Support\Components\TicketStatus' => 'ticket_status',
'Keios\Support\Components\Upload' => 'ticket_attach',
];
}
/**
* Registers mail templates
*
* @return array
*/
public function registerMailTemplates()
{
return [
'keios.support::mail.ticket.first' => trans(
'keios.support::lang.mailer.first'
),
'keios.support::mail.ticket.create' => trans(
'keios.support::lang.mailer.create'
),
'keios.support::mail.ticket.update' => trans(
'keios.support::lang.mailer.update'
),
'keios.support::mail.ticket.close' => trans(
'keios.support::lang.mailer.close'
),
];
}
/**
* Registers backend navigation
*
* @return array
*/
public function registerNavigation()
{
return [
'support' => [
'label' => 'Support',
'url' => Backend::url('keios/support/tickets'),
'icon' => 'icon-life-ring',
'order' => 500,
'sideMenu' => [
'tickets' => [
'label' => 'keios.support::lang.app.tickets',
'url' => Backend::url('keios/support/tickets'),
'permissions' => ['keios.support.tickets'],
'icon' => 'icon-ticket',
],
'ticketattachments' => [
'label' => 'keios.support::lang.app.ticketattachments',
'url' => Backend::url('keios/support/ticketattachments'),
'permissions' => ['keios.support.statuses'],
'icon' => 'icon-file',
],
'ticketcategories' => [
'label' => 'keios.support::lang.app.ticketcategories',
'url' => Backend::url('keios/support/ticketcategories'),
'permissions' => ['keios.support.categories'],
'icon' => 'icon-folder',
],
'ticketstatuses' => [
'label' => 'keios.support::lang.app.ticketstatusesandpriorities',
'url' => Backend::url('keios/support/ticketstatuses'),
'permissions' => ['keios.support.statuses'],
'icon' => 'icon-flag',
],
],
],
];
}
/**
* Registers permissions
*
* @return array
*/
public function registerPermissions()
{
return [
'keios.support.tickets' => [
'tab' => 'keios.support::lang.plugin.name',
'label' => 'keios.support::lang.permissions.tickets',
],
'keios.support.categories' => [
'tab' => 'keios.support::lang.plugin.name',
'label' => 'keios.support::lang.permissions.categories',
],
'keios.support.statuses' => [
'tab' => 'keios.support::lang.plugin.name',
'label' => 'keios.support::lang.permissions.statuses',
],
'keios.support.priorities' => [
'tab' => 'keios.support::lang.plugin.name',
'label' => 'keios.support::lang.permissions.priorities',
],
'keios.support.settings' => [
'tab' => 'keios.support::lang.plugin.name',
'label' => 'keios.support::lang.permissions.settings',
],
];
}
}