diff --git a/VERSION b/VERSION index 7dea76e..570c796 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.1 +v1.0.2 diff --git a/composer.lock b/composer.lock index 722451b..aa9ced8 100644 --- a/composer.lock +++ b/composer.lock @@ -144,16 +144,16 @@ }, { "name": "laswitchtech/core-database", - "version": "v1.0.4", + "version": "v1.0.5", "source": { "type": "git", "url": "https://github.com/LaswitchTech/coreDatabase.git", - "reference": "624eec2700f09948b482373891d501e7712ab345" + "reference": "14a28a76c410135a8f8bc7e58c75e04f316593ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/LaswitchTech/coreDatabase/zipball/624eec2700f09948b482373891d501e7712ab345", - "reference": "624eec2700f09948b482373891d501e7712ab345", + "url": "https://api.github.com/repos/LaswitchTech/coreDatabase/zipball/14a28a76c410135a8f8bc7e58c75e04f316593ca", + "reference": "14a28a76c410135a8f8bc7e58c75e04f316593ca", "shasum": "" }, "require": { @@ -178,7 +178,7 @@ "description": "Database Library for the Laswitch Core Framework", "support": { "issues": "https://github.com/LaswitchTech/coreDatabase/issues", - "source": "https://github.com/LaswitchTech/coreDatabase/tree/v1.0.4" + "source": "https://github.com/LaswitchTech/coreDatabase/tree/v1.0.5" }, "funding": [ { @@ -186,7 +186,7 @@ "type": "github" } ], - "time": "2024-08-01T23:39:54+00:00" + "time": "2024-08-30T17:40:50+00:00" }, { "name": "laswitchtech/core-locale", @@ -330,10 +330,10 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/src/Router.php b/src/Router.php index 69fd61a..b77b092 100644 --- a/src/Router.php +++ b/src/Router.php @@ -271,6 +271,10 @@ protected function genHTAccess(){ // Initialize .htaccess $htaccess = $errors; + // Add MIME type for .mjs files + $htaccess .= "AddType application/javascript .mjs" . PHP_EOL; + $htaccess .= PHP_EOL; + // Apache Headers $htaccess .= "" . PHP_EOL; $htaccess .= " RequestHeader unset Proxy" . PHP_EOL; @@ -295,6 +299,10 @@ protected function genHTAccess(){ // Initialize .htaccess $htaccess = $errors; + // Add MIME type for .mjs files + $htaccess .= "AddType application/javascript .mjs" . PHP_EOL; + $htaccess .= PHP_EOL; + // Apache Headers $htaccess .= "" . PHP_EOL; $htaccess .= " RequestHeader unset Proxy" . PHP_EOL; @@ -900,7 +908,6 @@ protected function menu($location = 'sidebar', $parent = null) { if($parent){ if(!isset($param['parent']) || $param['parent'] !== $parent) continue; } - if($param['template'] !== $this->getTemplate()) continue; if(!isset($param['location'])) continue; if(is_string($param['location']) && $param['location'] !== $location) continue; if(is_array($param['location']) && !in_array($location,$param['location'])) continue; @@ -908,7 +915,7 @@ protected function menu($location = 'sidebar', $parent = null) { if(!$param['public'] && $param['permission'] && !$this->hasPermission("Route>" . $route, $param['level'])) continue; $parts = array_filter(explode('/', $route)); - if(empty($parts)) continue; + if(empty($parts)) $parts = [""]; $current = &$menu; $accumulated_route = ""; @@ -959,7 +966,12 @@ protected function js(){ $js = $this->Configurator->get('js'); foreach($js as $file){ if(is_file($this->Configurator->root().'/webroot/'.trim($file,'/'))){ - $html .= '' . PHP_EOL; + // Check if the file is a module by looking for the file extension + if(str_ends_with($file, '.mjs')){ + $html .= '' . PHP_EOL; + } else { + $html .= '' . PHP_EOL; + } } } return $html;