-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlugin.php
More file actions
99 lines (91 loc) · 2.73 KB
/
Copy pathPlugin.php
File metadata and controls
99 lines (91 loc) · 2.73 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
<?php
namespace Observatby\FileSharingOnCdn;
use Backend\Facades\Backend;
use Observatby\FileSharingOnCdn\Console\DeleteOldFiles;
use System\Classes\PluginBase;
/**
* FileSharingOnCdn Plugin Information File
*/
class Plugin extends PluginBase
{
/**
* Returns information about this plugin.
*
* @return array
*/
public function pluginDetails()
{
return [
'name' => 'FileSharingOnCdn',
'description' => 'Temporary file sharing on CDN',
'author' => 'Observatby',
'homepage' => 'https://github.com/Observat/FileSharingOnCdn',
'icon' => 'icon-leaf'
];
}
/**
* Register method, called when the plugin is first registered.
*
* @return void
*/
public function register()
{
$this->registerConsoleCommand('filesharingoncdn:deleteoldfiles', DeleteOldFiles::class);
}
public function registerSchedule($schedule)
{
$schedule->command('filesharingoncdn:deleteoldfiles', ['days' => 15])->daily();
}
/**
* Registers any front-end components implemented in this plugin.
*
* @return array
*/
public function registerComponents()
{
return [];
}
/**
* Registers any back-end permissions used by this plugin.
*
* @return array
*/
public function registerPermissions()
{
return [
'observatby.filesharingoncdn.some_permission' => [
'tab' => 'FileSharingOnCdn',
'label' => 'Some permission'
],
];
}
/**
* Registers back-end navigation items for this plugin.
*
* @return array
*/
public function registerNavigation()
{
return [
'filesharingoncdn' => [
'label' => 'observatby.filesharingoncdn::lang.menu.links',
'url' => Backend::url('observatby/filesharingoncdn/links'),
'icon' => 'icon-leaf',
'permissions' => ['observatby.filesharingoncdn.*'],
'order' => 500,
'sideMenu' => [
'new_link' => [
'label' => 'observatby.filesharingoncdn::lang.menu.add_link',
'icon' => 'icon-plus',
'url' => Backend::url('observatby/filesharingoncdn/links/create'),
],
'links' => [
'label' => 'observatby.filesharingoncdn::lang.menu.links',
'icon' => 'icon-file-image-o',
'url' => Backend::url('observatby/filesharingoncdn/links'),
],
],
],
];
}
}