-
Notifications
You must be signed in to change notification settings - Fork 6
/
Plugin.php
74 lines (69 loc) · 2.48 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 VojtaSvoboda\UserImportExport;
use Backend;
use Config;
use Event;
use Log;
use System\Classes\PluginBase;
use RainLab\User\Controllers\Users;
/**
* User Import Export Plugin Information File
*/
class Plugin extends PluginBase
{
public $require = [
'RainLab.User',
];
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'vojtasvoboda.userimportexport::lang.plugin.name',
'description' => 'vojtasvoboda.userimportexport::lang.plugin.description',
'author' => 'Vojta Svoboda',
'icon' => 'icon-sign-in',
'homepage' => 'https://github.com/vojtasvoboda/oc-userimportexport-plugin',
];
}
public function registerPermissions()
{
return [
'vojtasvoboda.userimportexport.*' => [
'tab' => 'vojtasvoboda.userimportexport::lang.permissions.tab',
'label' => 'vojtasvoboda.userimportexport::lang.label.permission',
],
];
}
public function boot()
{
Event::listen('backend.menu.extendItems', function($manager)
{
$manager->addSideMenuItems('RainLab.User', 'user', [
'users' => [
'label' => 'rainlab.user::lang.users.menu_label',
'url' => Backend::url('rainlab/user/users'),
'icon' => 'icon-user',
'permissions' => ['rainlab.users.*'],
'order' => 100,
],
'import' => [
'label' => 'vojtasvoboda.userimportexport::lang.label.import',
'url' => Backend::url('vojtasvoboda/userimportexport/userimportexport/import'),
'icon' => 'icon-sign-in',
'permissions' => ['vojtasvoboda.userimportexport.import'],
'order' => 200,
],
'export' => [
'label' => 'vojtasvoboda.userimportexport::lang.label.export',
'url' => Backend::url('vojtasvoboda/userimportexport/userimportexport/export'),
'icon' => 'icon-sign-out',
'permissions' => ['vojtasvoboda.userimportexport.export'],
'order' => 300,
],
]);
});
}
}