@@ -297,6 +297,23 @@ public function js()
297297 $ html .= ' const ADMIN_MODE = ' . ($ this ->Auth ->isAuthorized ('Administrator ' , 1 ) ? 'true ' : 'false ' ) . '; ' . PHP_EOL ;
298298 $ html .= '</script> ' . PHP_EOL ;
299299
300+ // Load Core JS
301+ $ path = $ this ->Config ->root () . '/vendor/laswitchtech/core/assets/js ' ;
302+ if (is_file ($ path .'.cfg ' )){
303+ if (is_dir ($ path )){
304+ $ assets = json_decode (file_get_contents ($ path .'.cfg ' ) ?? '[] ' ,true );
305+ foreach ($ assets as $ file ){
306+ if (is_file ($ path .'/ ' .$ file )){
307+ if (str_ends_with ($ file , '.mjs ' )){
308+ $ html .= '<script type="module" src="/assets/core/js/ ' .trim ($ file ,'/ ' ).'"></script> ' . PHP_EOL ;
309+ } else {
310+ $ html .= '<script src="/assets/core/js/ ' .trim ($ file ,'/ ' ).'"></script> ' . PHP_EOL ;
311+ }
312+ }
313+ }
314+ }
315+ }
316+
300317 // Load Themes JS
301318 $ path = $ this ->Config ->root () . '/lib/themes ' ;
302319 if (is_dir ($ path )){
@@ -319,23 +336,6 @@ public function js()
319336 }
320337 }
321338
322- // Load Core JS
323- $ path = $ this ->Config ->root () . '/vendor/laswitchtech/core/assets/js ' ;
324- if (is_file ($ path .'.cfg ' )){
325- if (is_dir ($ path )){
326- $ assets = json_decode (file_get_contents ($ path .'.cfg ' ) ?? '[] ' ,true );
327- foreach ($ assets as $ file ){
328- if (is_file ($ path .'/ ' .$ file )){
329- if (str_ends_with ($ file , '.mjs ' )){
330- $ html .= '<script type="module" src="/assets/core/js/ ' .trim ($ file ,'/ ' ).'"></script> ' . PHP_EOL ;
331- } else {
332- $ html .= '<script src="/assets/core/js/ ' .trim ($ file ,'/ ' ).'"></script> ' . PHP_EOL ;
333- }
334- }
335- }
336- }
337- }
338-
339339 // Load Themes Assets JS
340340 $ path = $ this ->Config ->root () . '/lib/themes ' ;
341341 if (is_dir ($ path )){
0 commit comments