-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
358 lines (343 loc) · 26.1 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<?php
/*
* Universal Theme addon for Bear CMS
* https://github.com/bearcms/universal-theme-addon
* Copyright (c) Amplilabs Ltd.
* Free to use under the MIT license.
*/
use BearFramework\App;
$app = App::get();
$app->bearCMS->themes
->register('bearcms/universal', function (\BearCMS\Themes\Theme $theme) use ($app) {
$context = $app->contexts->get(__DIR__);
$app->localization
->addDictionary('en', function () use ($context) {
return include $context->dir . '/locales/en.php';
})
->addDictionary('bg', function () use ($context) {
return include $context->dir . '/locales/bg.php';
});
$context->assets
->addDir('assets')
->addDir('values/files') // for previous version files
->addDir('values/files2');
$theme->version = '1.27';
$theme->get = function (\BearCMS\Themes\Theme\Customizations $customizations, array $cntx) use ($app, $context) {
$language = isset($cntx['language']) ? $cntx['language'] : null;
$languages = isset($cntx['languages']) ? $cntx['languages'] : [];
$templateFilename = $context->dir . '/components/defaultTemplate.php';
$template = (static function ($__filename, $customizations, $language, $languages) { // $customizations is used inside
ob_start();
include $__filename;
return ob_get_clean();
})($templateFilename, $customizations, $language, $languages);
if ($app->bearCMS->hasEventListeners('internalBearCMSUniversalThemeGet')) {
$eventDetails = new stdClass();
$eventDetails->template = $template;
$app->bearCMS->dispatchEvent('internalBearCMSUniversalThemeGet', $eventDetails);
$template = $eventDetails->template;
}
return $template;
};
$theme->manifest = function () use ($app, $context, $theme) {
$manifest = $theme->makeManifest();
$manifest->name = __('bearcms.themes.universal.name');
$manifest->description = __('bearcms.themes.universal.description');
$manifest->author = [
'name' => 'BearCMS Team',
'url' => 'https://bearcms.com/addons/',
'email' => '[email protected]',
];
$manifest->media = [
[
'filename' => $context->dir . '/assets/4.jpg',
'width' => 1416,
'height' => 1062,
]
];
if ($app->bearCMS->hasEventListeners('internalBearCMSUniversalThemeManifest')) {
$eventDetails = new stdClass();
$eventDetails->manifest = $manifest;
$app->bearCMS->dispatchEvent('internalBearCMSUniversalThemeManifest', $eventDetails);
$manifest = $eventDetails->manifest;
}
return $manifest;
};
$updateValues = function (array $values = null) {
if (is_array($values)) {
if (isset($values['navigationPosition']) && !isset($values['headerLayout'])) {
$navigationPosition = \BearCMS\Internal\Themes::getValueDetails($values['navigationPosition']);
if ($navigationPosition['value'] === '1') {
$values['headerLayout'] = 'navAboveHeaderContainer';
} else {
$values['headerLayout'] = 'navBelowHeaderContainer';
}
$values['navigationType'] = '{"value":"horizontal","states":[[":screen-size(maxWidth=680)", "buttonBlock"]]}';
unset($values['navigationPosition']);
if (!isset($values['navigationSearchButtonVisibility'])) {
$values['navigationSearchButtonVisibility'] = '0';
}
if (!isset($values['navigationStoreCartButtonVisibility'])) {
$values['navigationStoreCartButtonVisibility'] = '0';
}
}
if (isset($values['navigationCSS'])) {
$navigationContainerCSS = \BearCMS\Internal\Themes::getValueDetails(isset($values['navigationContainerCSS']) ? $values['navigationContainerCSS'] : '');
$navigationCSS = \BearCMS\Internal\Themes::getValueDetails($values['navigationCSS']);
$updatedNavigationCSS = $navigationCSS;
$contentAlignToSet = null;
if (!is_array($updatedNavigationCSS['value'])) {
$updatedNavigationCSS['value']['value'] = [];
}
if (isset($updatedNavigationCSS['value']['text-align'])) {
$contentAlignToSet = $updatedNavigationCSS['value']['text-align'];
unset($updatedNavigationCSS['value']['text-align']);
}
if (isset($navigationContainerCSS['value']['text-align'])) {
if ($contentAlignToSet === null) {
$contentAlignToSet = $navigationContainerCSS['value']['text-align'];
}
unset($navigationContainerCSS['value']['text-align']);
}
$updatedNavigationCSS['states'][] = [":screen-size(maxWidth=680)", [
"padding-left" => "0px",
"padding-top" => "0px",
"padding-right" => "0px",
"padding-bottom" => "0px"
]];
$prefixes = [
'navigationTypeHorizontal',
'navigationTypeButtonBlock',
'navigationTypeButtonDropDown',
'navigationTypeButtonOverlay'
];
$getNavigationButtonCSS = function (string $type) use ($values) {
if (isset($values['navigationItemCSS'])) {
$navigationItemCSS = \BearCMS\Internal\Themes::getValueDetails($values['navigationItemCSS']);
if (!is_array($navigationItemCSS['value'])) {
$navigationItemCSS['value'] = [];
}
if ($type === 'toggle') {
$navigationItemCSS['value']['width'] = '100%';
} else {
if (!isset($navigationItemCSS['value']['width'])) {
if (isset($navigationItemCSS['value']['padding-left'], $navigationItemCSS['value']['padding-right'])) {
$navigationItemCSS['value']['width'] = (20 + (int)str_replace('px', '', $navigationItemCSS['value']['padding-left']) + (int)str_replace('px', '', $navigationItemCSS['value']['padding-right'])) . 'px';
} elseif (isset($navigationItemCSS['value']['height'])) {
$navigationItemCSS['value']['width'] = $navigationItemCSS['value']['height'];
} else {
$navigationItemCSS['value']['width'] = '40px';
}
}
}
$setBackgroundImageForAllStates = function (string $filename) use (&$navigationItemCSS, $type) {
$defaultColor = '#ffffff';
$defaultStateColor = null;
$defaultPaddingLeft = '15px';
$defaultStatePaddingLeft = null;
foreach (['', ':hover', ':active'] as $state) {
$stateIndexToUpdate = null;
if ($state === '') {
$valueToUpdate = $navigationItemCSS['value'];
} else {
$valueToUpdate = [];
foreach ($navigationItemCSS['states'] as $i => $stateData) {
if ($stateData[0] === $state) {
$stateIndexToUpdate = $i;
$valueToUpdate = $stateData[1];
if (!is_array($valueToUpdate)) {
$valueToUpdate = [];
}
break;
}
}
}
$color = isset($valueToUpdate['color']) ? strtolower($valueToUpdate['color']) : ($defaultStateColor !== null ? $defaultStateColor : $defaultColor);
if ($color === '#fff') {
$color = '#ffffff';
}
$paddingLeft = isset($valueToUpdate['padding-left']) ? $valueToUpdate['padding-left'] : ($defaultStatePaddingLeft !== null ? $defaultStatePaddingLeft : $defaultPaddingLeft);
if ($state === '') {
$defaultStateColor = $color;
$defaultStatePaddingLeft = $paddingLeft;
}
$filenameOptions = $color !== $defaultColor ? '?s=' . trim($color, '#') : '';
if ($state === '' || $filenameOptions !== '') {
$valueToUpdate['background-image'] = 'url(' . $filename . $filenameOptions . ')';
$valueToUpdate['background-repeat'] = 'no-repeat';
if ($type === 'toggle') {
$valueToUpdate['background-size'] = '20px 20px'; // auto 50%
$valueToUpdate['background-position'] = 'left ' . $paddingLeft . ' center';
} else {
$valueToUpdate['background-size'] = '20px 20px';
$valueToUpdate['background-position'] = 'center center';
}
if ($state === '') {
$navigationItemCSS['value'] = $valueToUpdate;
} elseif ($stateIndexToUpdate !== null) {
$navigationItemCSS['states'][$stateIndexToUpdate][1] = $valueToUpdate;
} else {
$navigationItemCSS['states'][] = [$state, $valueToUpdate];
}
}
}
};
if ($type === 'search') {
$setBackgroundImageForAllStates('addon:bearcms/universal-theme-addon:assets/search.svg');
} elseif ($type === 'store') {
$setBackgroundImageForAllStates('addon:bearcms/universal-theme-addon:assets/cart.svg');
} elseif ($type === 'toggle') {
$setBackgroundImageForAllStates('addon:bearcms/universal-theme-addon:assets/menu.svg');
}
return json_encode($navigationItemCSS);
}
return null;
};
$searchButtonCSS = $getNavigationButtonCSS('search');
$storeCartButtonCSS = $getNavigationButtonCSS('store');
$toggleButtonCSS = $getNavigationButtonCSS('toggle');
foreach ($prefixes as $prefix) {
$values[$prefix . 'CSS'] = json_encode($updatedNavigationCSS);
if (isset($values['navigationItemCSS'])) {
$values[$prefix . 'ItemCSS'] = $values['navigationItemCSS'];
$values[$prefix . 'SearchButtonCSS'] = $searchButtonCSS;
$values[$prefix . 'StoreCartButtonCSS'] = $storeCartButtonCSS;
$values[$prefix . 'ToggleButtonCSS'] = $toggleButtonCSS;
}
if (isset($values['navigationSelectedItemCSS'])) {
$values[$prefix . 'SelectedItemCSS'] = $values['navigationSelectedItemCSS'];
}
if (isset($values['navigationSubitemCSS'])) {
$values[$prefix . 'SubitemCSS'] = $values['navigationSubitemCSS'];
}
if (isset($values['navigationSelectedSubitemCSS'])) {
$values[$prefix . 'SelectedSubitemCSS'] = $values['navigationSelectedSubitemCSS'];
}
if (isset($values['navigationContainerCSS'])) {
$values[$prefix . 'ContainerCSS'] = $values['navigationContainerCSS'];
}
if ($contentAlignToSet !== null) {
$values[$prefix . 'ContentAlign'] = $contentAlignToSet;
}
}
$values['navigationTypeButtonBlockToggleButtonContainerCSS'] = '{"width":"100%"}';
unset($values['navigationCSS']);
if (isset($values['navigationItemCSS'])) {
unset($values['navigationItemCSS']);
}
if (isset($values['navigationSelectedItemCSS'])) {
unset($values['navigationSelectedItemCSS']);
}
if (isset($values['navigationSubitemCSS'])) {
unset($values['navigationSubitemCSS']);
}
if (isset($values['navigationSelectedSubitemCSS'])) {
unset($values['navigationSelectedSubitemCSS']);
}
if (isset($values['navigationContainerCSS'])) {
unset($values['navigationContainerCSS']);
}
}
}
// Get old assets from the CMS server
$oldAssets = array(
'addon:bearcms/universal-theme-addon:assets/s8/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s8/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s7/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s7/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s5/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s5/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s4/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s4/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s3/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s3/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s20/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s20/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s19/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s19/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s18/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s18/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s17/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s17/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s16/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s16/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s12/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s12/1.jpg',
'addon:bearcms/universal-theme-addon:assets/s11/1.jpg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/s11/1.jpg',
'addon:bearcms/universal-theme-addon:assets/checkbox-icon-111.svg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/checkbox-icon-111.svg',
'addon:bearcms/universal-theme-addon:assets/radio-icon-111.svg' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/radio-icon-111.svg',
'addon:bearcms/universal-theme-addon:assets/search-icon.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/t/universal/assets/search-icon.png',
'addon:internal/cms:themes/bearcms-universal/assets/s9/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s9/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s9/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s9/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s8/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s8/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s8/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s8/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s7/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s7/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s7/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s7/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s6/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s6/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s6/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s6/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s5/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s5/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s5/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s5/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s4/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s4/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s4/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s4/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s3/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s3/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s3/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s3/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s21/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s21/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s21/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s21/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s20/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s20/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s20/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s20/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s2/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s2/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s2/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s2/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s19/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s19/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s19/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s19/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s18/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s18/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s18/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s18/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s17/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s17/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s17/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s17/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s16/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s16/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s16/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s16/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s15/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s15/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s15/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s15/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s14/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s14/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s14/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s14/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s13/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s13/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s13/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s13/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s12/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s12/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s12/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s12/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s11/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s11/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s11/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s11/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s10/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s10/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s10/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s10/2.png',
'addon:internal/cms:themes/bearcms-universal/assets/s1/1.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s1/1.png',
'addon:internal/cms:themes/bearcms-universal/assets/s1/2.png' => 'addon:bearcms/bearframework-addon:assets/s/otsa/c/universal/assets/s1/2.png',
);
$valuesJSON = json_encode($values, true);
if (strpos($valuesJSON, ':') !== false) {
foreach ($oldAssets as $oldKey => $newKey) {
$search[] = 'url(' . $oldKey . ')';
$replace[] = 'url(' . $newKey . ')';
$search[] = trim(json_encode('url(' . $oldKey . ')', JSON_THROW_ON_ERROR), '"');
$replace[] = trim(json_encode('url(' . $newKey . ')', JSON_THROW_ON_ERROR), '"');
$search[] = trim(json_encode(trim(json_encode('url(' . $oldKey . ')', JSON_THROW_ON_ERROR), '"'), JSON_THROW_ON_ERROR), '"');
$replace[] = trim(json_encode(trim(json_encode('url(' . $newKey . ')', JSON_THROW_ON_ERROR), '"'), JSON_THROW_ON_ERROR), '"');
}
$valuesJSON = str_replace($search, $replace, $valuesJSON);
$values = json_decode($valuesJSON, true);
}
return $values;
};
$theme->updateValues = $updateValues;
$theme->options = function () use ($app, $context, $theme, &$updateValues) {
$options = $theme->makeOptions(); // used inside
require $context->dir . '/options.php';
$values = json_decode(file_get_contents($context->dir . '/values/values.json'), true);
$values = $updateValues($values);
$options->setValues($values, true);
if ($app->bearCMS->hasEventListeners('internalBearCMSUniversalThemeOptions')) {
$eventDetails = new stdClass();
$eventDetails->options = $options;
$app->bearCMS->dispatchEvent('internalBearCMSUniversalThemeOptions', $eventDetails);
$options = $eventDetails->options;
}
return $options;
};
if ($app->bearCMS->hasEventListeners('internalBearCMSUniversalThemeRegister')) {
$eventDetails = new stdClass();
$eventDetails->theme = $theme;
$app->bearCMS->dispatchEvent('internalBearCMSUniversalThemeRegister', $eventDetails);
$theme = $eventDetails->theme;
}
$app->clientPackages
->add('-bearcms-universal-theme', function (IvoPetkov\BearFrameworkAddons\ClientPackage $package) use ($context) {
//$package->addJSCode(file_get_contents($context->dir . '/dev/universalTheme.js')); // dev mode
$package->addJSCode(include $context->dir . '/assets/universalTheme.js.min.php');
});
});