Convert dynamic page metadata to variable

This commit is contained in:
Bruno Rybársky 2024-02-03 16:21:28 +01:00
parent 6ccbe82189
commit 8a0b5e3e3a
3 changed files with 4 additions and 9 deletions

@ -2,7 +2,7 @@
function getDynamicPermission($file): int { function getDynamicPermission($file): int {
include_once($file); include_once($file);
return get_parameters()["minimal_permission_level"]; return $page_parameters["minimal_permission_level"];
} }
function generateNavigation(): string function generateNavigation(): string

@ -3,10 +3,8 @@
require_once "lib/router.php"; require_once "lib/router.php";
require_once "lib/account.php"; require_once "lib/account.php";
function get_parameters():array $page_parameters = ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Account"];
{
return ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Account"];
}
function render(): string function render(): string
{ {

@ -3,10 +3,7 @@
require_once "lib/router.php"; require_once "lib/router.php";
require_once "lib/account.php"; require_once "lib/account.php";
function get_parameters():array $page_parameters = ["minimal_permission_level" => 2, "secret" => "no", "page_title" => "Settings"];
{
return ["minimal_permission_level" => 2, "secret" => "no", "page_title" => "Settings"];
}
function render(): string function render(): string
{ {