forked from skydiver/october-plugin-gitreposmanager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Plugin.php
55 lines (44 loc) · 1.69 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
<?php
namespace Martin\GitReposManager;
use Backend, Controller, Lang, Validator;
use System\Classes\PluginBase;
use System\Classes\SettingsManager;
class Plugin extends PluginBase {
public function pluginDetails() {
return [
'name' => 'martin.gitreposmanager::lang.plugin.name',
'description' => 'martin.gitreposmanager::lang.plugin.description',
'author' => 'Martin M.',
'homepage' => 'https://github.com/skydiver/',
'icon' => 'icon-cubes'
];
}
public function boot() {
Validator::extend('isReadable', function ($attribute, $value, $parameters, $validator) {
if (is_readable($value)) {
return true;
} else {
return false;
}
}, Lang::get('martin.gitreposmanager::lang.model.errors.validator_is_readable'));
}
public function registerSettings() {
return [
'gitreposmanager' => [
'label' => 'martin.gitreposmanager::lang.navigation.label',
'description' => 'martin.gitreposmanager::lang.navigation.description',
'category' => SettingsManager::CATEGORY_SYSTEM,
'icon' => 'icon-git',
'url' => Backend::url('martin/gitreposmanager/repos'),
'order' => 500,
'permissions' => ['martin.gitreposmanager.access_repos'],
]
];
}
public function registerPermissions() {
return [
'martin.gitreposmanager.access_repos' => ['label' => 'Access Git Repos Manager page', 'tab' => 'Git Repos Manager'],
];
}
}
?>