From 9ad8af8c6f9c44fcc2d956e985d1dfd2b0e32cad Mon Sep 17 00:00:00 2001 From: bruno Date: Fri, 2 Feb 2024 12:41:02 +0100 Subject: [PATCH] dokelu --- lib/endpoint.php | 2 +- lib/navigation.php | 9 +++++++-- pages/{account/domov.php => apex/account.php} | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) rename pages/{account/domov.php => apex/account.php} (94%) diff --git a/lib/endpoint.php b/lib/endpoint.php index de8413f..201c2c7 100644 --- a/lib/endpoint.php +++ b/lib/endpoint.php @@ -23,7 +23,7 @@ function getEndpoint($endpoint_name): string $endpoint_file = $routerConfig["endpoint_dir"] . $routerRequest["subdomain"] . "/" . $endpoint_name . ".php"; - $endpoint_file_global = $routerConfig["endpoint_dir"] . "account/" . $endpoint_name . ".php"; + $endpoint_file_global = $routerConfig["endpoint_dir"] . "apex/" . $endpoint_name . ".php"; if (file_exists($endpoint_file_global)){ $output = runEndpoint($endpoint_file_global); diff --git a/lib/navigation.php b/lib/navigation.php index 16e7ff6..da3524b 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -19,9 +19,14 @@ function generateNavigation(): string $site_name = str_replace("_", " ", $site_dir); + $site_subdomain = $site_dir; + if ($site_name == "apex") { + $site_subdomain = ""; + } + $site_name = ucfirst($site_name); - $site_location = $routerConfig["protocol"] . $site_dir . "." . $routerRequest["domain"] . "." . $routerRequest["tld"] . "/" . $routerConfig["default_page"]; + $site_location = $routerConfig["protocol"] . $site_subdomain . "." . $routerRequest["domain"] . "." . $routerRequest["tld"] . "/" . $routerConfig["default_page"]; if ($routerRequest["subdomain"] == $site_dir) { //this is the current page @@ -41,7 +46,7 @@ function generateNavigation(): string $page_class = "class=\"navpage_link active\""; } - $page_location = $routerConfig["protocol"] . $site_dir . "." . $routerRequest["domain"] . "." . $routerRequest["tld"] . "/" . $page_dir; + $page_location = $routerConfig["protocol"] . $site_subdomain . "." . $routerRequest["domain"] . "." . $routerRequest["tld"] . "/" . $page_dir; $page_name = str_replace("_", " ", $page_dir); $page_name = explode(".", $page_name)[0]; diff --git a/pages/account/domov.php b/pages/apex/account.php similarity index 94% rename from pages/account/domov.php rename to pages/apex/account.php index 630e3c4..dd6fc3b 100644 --- a/pages/account/domov.php +++ b/pages/apex/account.php @@ -14,7 +14,7 @@ function render(): string ob_start(); if ($_SESSION["ID"] > 0) { - $account_template = file_get_contents($routerConfig["template_dir"] . "account.html"); + $account_template = file_get_contents($routerConfig["template_dir"] . "apex.html"); echo $account_template; } else { $login_template = file_get_contents($routerConfig["template_dir"] . "login.html");