Enhances config file edit form

main
Yasen Pramatarov 2024-10-30 15:55:03 +02:00
parent b67a915ebe
commit e1265500cf
1 changed files with 12 additions and 1 deletions

View File

@ -60,7 +60,18 @@ function editConfig($configPart, $indent, $platform=false, $parent='') {
// if it's not array, just display it
?>
<div class="col-md-8 text-start">
<input class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? '') ?>" required autofocus />
<?php if ($config_item === 'registration_enabled') { ?>
<input class="form-check-input" type="checkbox" role="switch" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? 0) ?>" <?= ($config_value === 1 || $config_value === true) ? 'checked' : '' ?> />
<?php } elseif ($config_item === 'environment') { ?>
<select class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>">
<option value="development"<?= ($config_value === 'development') ? ' selected' : '' ?>>development</option>
<option value="production"<?= ($config_value === 'production') ? ' selected' : '' ?>>production</option>
</select>
<?php } elseif ($config_item === 'version') {?>
<input class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? '') ?>" disabled />
<?php } else { ?>
<input class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? '') ?>" />
<?php } ?>
</div>
<?php } ?>
</div>