-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
elgg-plugin.php
81 lines (78 loc) · 1.97 KB
/
elgg-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
<?php
use ColdTrick\FileTools\Bootstrap;
use Elgg\Router\Middleware\Gatekeeper;
require_once(dirname(__FILE__) . '/lib/functions.php');
$composer_path = '';
if (is_dir(__DIR__ . '/vendor')) {
$composer_path = __DIR__ . '/';
}
return [
'bootstrap' => Bootstrap::class,
'settings' => [
'list_length' => 50,
'use_folder_structure' => 'no',
],
'entities' => [
[
'type' => 'object',
'subtype' => 'folder',
'class' => FileToolsFolder::class,
],
],
'routes' => [
'add:object:folder' => [
'path' => '/file_tools/folder/new/{guid}',
'resource' => 'file_tools/folder/new',
'middleware' => [
Gatekeeper::class,
],
],
'edit:object:folder' => [
'path' => '/file_tools/folder/edit/{guid}',
'resource' => 'file_tools/folder/edit',
'middleware' => [
Gatekeeper::class,
],
],
'add:object:file:zip' => [
'path' => '/file/upload_zip/{guid}',
'resource' => 'file/upload_zip',
'middleware' => [
Gatekeeper::class,
],
],
],
'views' => [
'default' => [
'js/jquery.serializejson.js' => $composer_path . 'vendor/bower-asset/jquery.serializeJSON/jquery.serializejson.min.js',
],
],
'actions' => [
'file_tools/groups/save_sort' => [],
'file_tools/folder/edit' => [],
'file_tools/folder/reorder' => [],
'file_tools/upload/zip' => [],
'file_tools/file/move' => [],
'file_tools/bulk_delete' => [],
'file_tools/bulk_download' => [],
],
'widgets' => [
'file_tree' => [
'name' => elgg_echo('widgets:file_tree:title'),
'description' => elgg_echo('widgets:file_tree:description'),
'context' => ['profile', 'dashboard', 'groups'],
'multiple' => true,
],
'index_file' => [
'name' => elgg_echo('collection:object:file'),
'description' => elgg_echo('widgets:index_file:description'),
'context' => ['index'],
'multiple' => true,
],
'group_files' => [
'name' => elgg_echo('collection:object:file:group'),
'description' => elgg_echo('widgets:group_files:description'),
'context' => ['groups'],
],
],
];