-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
elgg-plugin.php
125 lines (123 loc) · 3.04 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
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
<?php
use ColdTrick\SiteAnnouncements\Gatekeeper;
use Elgg\Blog\Forms\PrepareFields;
return [
'plugin' => [
'version' => '12.0',
],
'entities' => [
[
'type' => 'object',
'subtype' => 'site_announcement',
'class' => \SiteAnnouncement::class,
'capabilities' => [
'commentable' => false,
],
],
],
'actions' => [
'site_announcements/edit' => [
'middleware' => [
Gatekeeper::class,
],
],
'site_announcements/mark' => ['access' => 'public'],
'site_announcements/toggle_editor' => ['access' => 'admin'],
],
'routes' => [
'add:object:site_announcement' => [
'path' => '/announcements/add/{guid?}',
'resource' => 'site_announcements/add',
'middleware' => [
Gatekeeper::class,
],
],
'edit:object:site_announcement' => [
'path' => '/announcements/edit/{guid}',
'resource' => 'site_announcements/edit',
'middleware' => [
Gatekeeper::class,
],
],
'collection:object:site_announcement:archive' => [
'path' => '/announcements/archive',
'resource' => 'site_announcements/archive',
],
'collection:object:site_announcement:scheduled' => [
'path' => '/announcements/scheduled',
'resource' => 'site_announcements/scheduled',
'middleware' => [
Gatekeeper::class,
],
],
'collection:object:site_announcement:editors' => [
'path' => '/announcements/editors',
'resource' => 'site_announcements/editors',
'middleware' => [
Gatekeeper::class,
],
],
'collection:object:site_announcement:all' => [
'path' => '/announcements/all',
'resource' => 'site_announcements/all',
],
'default:object:site_announcement' => [
'path' => '/announcements',
'resource' => 'site_announcements/all',
],
],
'events' => [
'access:collections:write' => [
'user' => [
'\ColdTrick\SiteAnnouncements\Access::userWriteCollections' => [],
],
],
'container_permissions_check' => [
'object' => [
'\ColdTrick\SiteAnnouncements\Access::containerPermissionsCheck' => [],
],
],
'cron' => [
'daily' => [
'\ColdTrick\SiteAnnouncements\Cron::cleanupExpiredAnnouncements' => [],
],
],
'form:prepare:fields' => [
'site_announcements/edit' => [
\ColdTrick\SiteAnnouncements\Forms\PrepareFields::class => [],
],
],
'permissions_check' => [
'object' => [
'\ColdTrick\SiteAnnouncements\Access::permissionsCheck' => [],
],
],
'register' => [
'menu:admin_header' => [
'\ColdTrick\SiteAnnouncements\Menus\AdminHeader::register' => [],
],
'menu:filter:site_announcements' => [
'\ColdTrick\SiteAnnouncements\Menus\Filter::register' => [],
],
'menu:footer' => [
'\ColdTrick\SiteAnnouncements\Menus\Footer::register' => [],
],
'menu:user_hover' => [
'\ColdTrick\SiteAnnouncements\Menus\UserHover::register' => [],
],
],
'seeds' => [
'database' => [
'\ColdTrick\SiteAnnouncements\Seeder::register' => [],
],
],
],
'view_extensions' => [
'elgg.css' => [
'site_announcements/site.css' => [],
],
'page/elements/body' => [
'site_announcements/site' => ['priority' => 400],
],
],
];