This repository has been archived by the owner on Apr 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.php
141 lines (110 loc) · 3.92 KB
/
index.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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
use Shw\Gallery\Content\SlideshowPlugin;
use Shw\Gallery\Events\RouteListener;
return [
'name' => 'gallery',
'type' => 'extension',
'autoload' => [
'Shw\\Gallery\\' => 'src',
],
'nodes' => [
'Gallery' => [
'name' => '@gallery',
'label' => 'Gallery',
'controller' => 'Shw\\Gallery\\Controller\\SiteController',
'protected' => true,
],
],
'routes' => [
'/gallery' => [
'name' => '@gallery',
'controller' => [
'Shw\\Gallery\\Controller\\GalleryController',
],
],
'/api/gallery' => [
'name' => '@gallery/api',
'controller' => [
'Shw\\Gallery\\Controller\\GalleryApiController',
'Shw\\Gallery\\Controller\\ImageApiController',
],
],
],
'menu' => [
'gallery' => [
'label' => 'Gallery',
'icon' => 'gallery:icon.svg',
'url' => '@gallery/gallery',
'active' => '@gallery/gallery*',
'access' => 'gallery: manage own galleries',
],
'gallery: galleries' => [
'parent' => 'gallery',
'label' => 'Galleries',
'icon' => 'gallery:icon.svg',
'url' => '@gallery/gallery',
'active' => '@gallery/gallery*',
'access' => 'gallery: manage own galleries',
],
'gallery: settings' => [
'parent' => 'gallery',
'label' => 'Settings',
'url' => '@gallery/settings',
'active' => '@gallery/settings*',
'access' => 'system: access settings',
],
'gallery: whatsNew' => [
'parent' => 'gallery',
'label' => 'Changelog',
'url' => '@gallery/changelog',
'active' => '@gallery/changelog',
'access' => 'gallery: manage own galleries',
],
],
'permissions' => [
'gallery: manage own galleries' => [
'title' => 'Manage own galleries',
'description' => 'Create, edit, delete and publish galleries of their own',
],
'gallery: manage all galleries' => [
'title' => 'Manage all galleries',
'description' => 'Create, edit, delete and publish galleries by all users',
],
'gallery: manage settings' => [
'title' => 'Manage settings',
],
],
'settings' => '@gallery/settings',
'config' => [
'gallery' => [
'title' => 'Gallery',
'back_button' => false,
'galleries_per_page' => 10,
],
'images' => [
'image_width' => 1200,
'image_height' => 1200,
'thumbnail_width' => 150,
'thumbnail_height' => 100,
'image_quality' => 90,
],
],
'events' => [
'boot' => function ($event, $app) {
$app->subscribe(
new RouteListener(),
new SlideshowPlugin()
);
},
'view.scripts' => function ($event, $scripts) use ($app) {
$scripts->register('gallery-link', 'gallery:app/bundle/link-gallery.js', '~panel-link');
$scripts->register('gallery-dashboard', 'gallery:app/bundle/gallery-dashboard.js', '~dashboard');
$scripts->register('gallery-meta', 'gallery:app/bundle/gallery-meta.js', '~gallery-edit');
$scripts->register('gallery-images', 'gallery:app/bundle/gallery-images.js', '~gallery-edit');
$scripts->register('editor-gallery', 'gallery:app/bundle/editor-plugin.js', '~editor');
if ($app->module('tinymce')) {
$scripts->register('tinymce-gallery', 'gallery:app/bundle/tinymce-plugin.js', '~editor-gallery');
}
},
],
];