rebuild to module

This commit is contained in:
2026-03-03 02:13:17 +01:00
parent ffb52c6789
commit e61f9fb889
23 changed files with 7618 additions and 73 deletions

View File

@@ -28,8 +28,21 @@ if (str_contains($uriPath, '..')) {
exit('Bad request');
}
// Root → page/index.php
if ($uriPath === '' || $uriPath === 'index' || $uriPath === 'index.php') {
// Spezialrouten für Module
if (str_starts_with($uriPath, 'modules/setup/')) {
$_GET['module'] = trim(substr($uriPath, strlen('modules/setup/')), '/');
$target = __DIR__ . '/page/modules_setup.php';
} elseif (preg_match('~^module/([a-zA-Z0-9_-]+)(?:/(.+))?$~', $uriPath, $m)) {
$module = $m[1];
$page = isset($m[2]) && $m[2] !== '' ? trim($m[2], '/') : 'index';
$modulePage = app()->modules()->resolvePage($module, $page);
if ($modulePage) {
$target = $modulePage;
} else {
http_response_code(404);
$target = __DIR__ . '/page/404.php';
}
} elseif ($uriPath === '' || $uriPath === 'index' || $uriPath === 'index.php') {
$target = __DIR__ . '/page/index.php';
} else {
$base = __DIR__ . '/page/' . $uriPath;