Convert return type of dynamic pages

This commit is contained in:
Bruno Rybársky 2024-02-03 16:24:48 +01:00
parent 8a0b5e3e3a
commit 71f62f0e9c
4 changed files with 8 additions and 8 deletions

@ -1,8 +1,7 @@
<?php
function getDynamicPermission($file): int {
include_once($file);
return $page_parameters["minimal_permission_level"];
return include_once($file)["parameters"]["minimal_permission_level"];
}
function generateNavigation(): string

@ -1,10 +1,7 @@
<?php
function renderDynamicPage($page_file): array
{
require_once $page_file;
$page_parameters = get_parameters();
$page_content = render();
return ["output" => $page_content, "parameters" => $page_parameters];
return require_once $page_file;
}
function parsePageTag($input): array

@ -19,4 +19,6 @@ function render(): string
}
return ob_get_clean();
}
}
return render();

@ -18,4 +18,6 @@ function render(): string
}
return ob_get_clean();
}
}
return ["output" => render(), "parameters" => $page_parameters];