-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.php
More file actions
94 lines (71 loc) · 3.18 KB
/
index.php
File metadata and controls
94 lines (71 loc) · 3.18 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
<?php
use Pagekit\Application as App;
return [
'name' => 'bixie/pk-framework',
'type' => 'extension',
'main' => 'Bixie\\PkFramework\\FrameworkModule',
'fieldtypes' => 'fieldtypes',
'autoload' => [
'Bixie\\PkFramework\\' => 'src'
],
'routes' => [
'/api/bixpkframework' => [
'name' => '@bixpkframework/api',
'controller' => [
'Bixie\\PkFramework\\Controller\\FrameworkApiController',
'Bixie\\PkFramework\\Controller\\ImageApiController',
]
]
],
'resources' => [
'bixie/pk-framework:' => ''
],
'permissions' => [
'bixpkframework: upload files' => [
'title' => 'Upload files'
]
],
'settings' => 'settings-bixpkframework',
'config' => [
'image_cache_path' => trim(str_replace(App::path(), '', App::get('path.storage') . '/bixpkframework'), '/'),
'google_maps_key' => '',
],
'events' => [
'view.scripts' => function ($event, $scripts) use ($app) {
$version = $app->module('bixie/pk-framework')->getVersionKey();
$scripts->register('vuex', 'bixie/pk-framework:app/bundle/vuex.js', 'vue');
$scripts->register('framework-settings', 'bixie/pk-framework:app/bundle/settings.js',
'~extensions', ['version' => $version]);
$scripts->register('typeahead-bundle', 'bixie/pk-framework:app/assets/typeahead/dist/typeahead.bundle.min.js', ['jquery']);
$scripts->register('bixie-typeahead', 'bixie/pk-framework:app/bundle/bixie-typeahead.js',
['vue', 'typeahead-bundle'], ['version' => $version]);
$scripts->register('bixie-chartjs', 'bixie/pk-framework:app/bundle/bixie-chartjs.js',
['vue'], ['version' => $version]);
$scripts->register('bixie-markdown-it', 'bixie/pk-framework:app/assets/markdown-it/dist/markdown-it.js',
[], ['version' => $version]);
$scripts->register('bixie-marked', 'bixie/pk-framework:app/bundle/bixie-marked.js',
['~editor', 'vue', 'bixie-markdown-it'], ['version' => $version]);
$scripts->register('bixie-pkframework', 'bixie/pk-framework:app/bundle/bixie-framework.js',
['vue', 'uikit-lightbox'], ['version' => $version]);
//register fields
$dependancies = ['bixie-pkframework', 'uikit-tooltip'];
foreach ($app->module('bixie/pk-framework')->getFieldTypes() as $fieldType) {
//pick up dependancies from types
if ($depends = $fieldType->registerScripts($scripts, $version)) {
$dependancies = array_merge($dependancies, $depends);
}
}
$scripts->register('bixie-fieldtypes', 'bixie/pk-framework:app/bundle/bixie-fieldtypes.js',
$dependancies, ['version' => $version]);
},
'view.data' => function ($event, $data) use ($app) {
//todo can this be done only when framework js is loaded?
$data->add('$pkframework', [
'google_maps_key' => $app->module('bixie/pk-framework')->config('google_maps_key')
]);
},
'console.init' => function ($event, $console) {
$console->add(new Bixie\PkFramework\Console\Commands\TranslateCommand());
},
]
];