diff --git a/partials/landingpages/modules/setup.php b/partials/landingpages/modules/setup.php
index d32212b..da689c6 100644
--- a/partials/landingpages/modules/setup.php
+++ b/partials/landingpages/modules/setup.php
@@ -60,6 +60,8 @@ $getNested = function (array $source, string $path): mixed {
};
$dbGroups = [];
+$fieldsByDbGroup = [];
+$generalFields = [];
foreach ($fields as $field) {
$name = (string)($field['name'] ?? '');
if (!str_contains($name, '.')) {
@@ -77,6 +79,68 @@ foreach ($fields as $field) {
$dbGroups[$group] = $label;
}
+foreach ($fields as $field) {
+ $name = (string)($field['name'] ?? '');
+ if (str_contains($name, '.')) {
+ [$group] = explode('.', $name, 2);
+ if (array_key_exists($group, $dbGroups)) {
+ $fieldsByDbGroup[$group][] = $field;
+ continue;
+ }
+ }
+
+ $generalFields[] = $field;
+}
+
+$driverOptions = [
+ 'pgsql' => 'PostgreSQL',
+ 'mysql' => 'MySQL / MariaDB',
+ 'sqlite' => 'SQLite',
+];
+
+$renderField = function (array $field) use ($current, $getNested, $driverOptions): void {
+ $name = (string)($field['name'] ?? '');
+ if ($name === '') {
+ return;
+ }
+ $label = (string)($field['label'] ?? $name);
+ $type = (string)($field['type'] ?? 'text');
+ $required = !empty($field['required']);
+ $help = (string)($field['help'] ?? $field['description'] ?? '');
+ $postKey = str_replace('.', '_', $name);
+
+ $value = '';
+ if ($name === 'kea_auto_init') {
+ $value = !empty($current[$name]) ? '1' : '0';
+ } elseif (str_contains($name, '.')) {
+ $value = (string)($getNested($current, $name) ?? '');
+ } else {
+ $value = (string)($current[$name] ?? '');
+ }
+ ?>
+
+
-
+
Setup
-
= e($module['title']) ?> – Einrichtung
+
= e($module['title']) ?> – Einrichtung
Trage die benötigten Informationen für das Modul ein.
@@ -152,60 +216,66 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
= e($error) ?>
-