-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
55 lines (38 loc) · 1.49 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
<?php
return [
'name' => 'tobbe/widget-includer',
'type' => 'extension',
'main' => 'Tobbe\\WidgetIncluder\\WidgetIncluderModule',
'autoload' => [
'Tobbe\\WidgetIncluder\\' => 'src'
],
'permissions' => [
'widgetincluder: use editor plugin' => [
'title' => 'Use the widget includer editor plugin'
]
],
'routes' => [
'/api/widgetincluder' => [
'name' => '@widgetincluder/api',
'controller' => [
'Tobbe\\WidgetIncluder\\Controller\\WidgetApiController'
]
]
],
'resources' => [
'tobbe/widget-includer:' => ''
],
'events' => [
'view.scripts' => [function ($event, $scripts) use ($app) {
$packageVersion = $app->config('system')->get('packages.tobbe/widget-includer');
$packageVersionHash = substr(sha1($app->system()->config('secret') . $packageVersion), 0, 4);
if ($app['user']->hasAccess('widgetincluder: use editor plugin')) {
$scripts->register('editor-widget', 'tobbe/widget-includer:app/bundle/editor-widget.js', ['~editor'], ['version' => $packageVersionHash]);
if ($app->module('tinymce')) {
$scripts->register('editor-widget-tinymce', 'tobbe/widget-includer:app/bundle/editor-widget-tinymce.js', ['~editor-widget', '~tinymce-script'], ['version' => $packageVersionHash]);
}
}
}, 10]
]
];
?>