This commit is contained in:
2024-02-02 12:38:18 +01:00
parent 5a087db6d2
commit 7f6afabab2
4 changed files with 6 additions and 33 deletions

View File

@@ -44,24 +44,10 @@ function getPage($page_name = null): array|false|string
$dynamic_page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".php";
$page_file = $routerConfig["page_dir"] . $routerRequest["subdomain"] . "/" . $page_name . ".html";
$dynamic_page_file_global = $routerConfig["page_dir"] . "global/" . $page_name . ".php";
$page_file_global = $routerConfig["page_dir"] . "global/" . $page_name . ".html";
$skeleton = file_get_contents($routerConfig["template_dir"] . "skeleton.html");
$nav = file_get_contents($routerConfig["template_dir"] . "nav.html");
if (file_exists($dynamic_page_file_global)){
$pageMetadata = renderDynamicPage($dynamic_page_file_global);
$page = $pageMetadata["output"];
}
elseif (file_exists($page_file_global)){
$page_tmp = file_get_contents($page_file_global);
$pageMetadata = parsePageTag($page_tmp);
$page = $pageMetadata["output"];
}
elseif (file_exists($dynamic_page_file)){
if (file_exists($dynamic_page_file)){
$pageMetadata = renderDynamicPage($dynamic_page_file);
$page = $pageMetadata["output"];
@@ -143,11 +129,9 @@ function getPage($page_name = null): array|false|string
if(!empty($pageMetadata["parameters"]["page_script"])){
$script_location = $pageMetadata["parameters"]["page_script"];
echo $script_location;
}
else{
$script_location = "assets/scripts/$site_name/$page_name.js";
echo $script_location;
}
if(file_exists($style_location)) {