2024-08-13 19:46:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// render config variables array
|
2024-08-26 18:19:21 +00:00
|
|
|
function renderConfig($configPart, $indent, $platform=false, $parent='') {
|
2024-08-19 10:25:09 +00:00
|
|
|
?>
|
|
|
|
<div style="padding-left: <?= $indent ?>px; padding-bottom: 20px;">
|
2024-09-04 09:53:02 +00:00
|
|
|
<?php foreach ($configPart as $config_item => $config_value) { ?>
|
2024-08-19 10:25:09 +00:00
|
|
|
<div class="row mb-1" style="padding-left: <?= $indent ?>px;">
|
|
|
|
<div class="col-md-4 text-end">
|
|
|
|
<?= htmlspecialchars($config_item) ?>:
|
|
|
|
</div>
|
|
|
|
<?php
|
2024-08-25 10:24:48 +00:00
|
|
|
if (is_array($config_value)) {
|
2024-08-26 18:19:21 +00:00
|
|
|
// here we render recursively nested arrays
|
|
|
|
$indent = $indent + 50;
|
|
|
|
if ($parent === 'platforms') {
|
|
|
|
$indent = 100;
|
|
|
|
}
|
2024-08-25 10:24:48 +00:00
|
|
|
if ($config_item === 'platforms') {
|
2024-08-26 18:19:21 +00:00
|
|
|
renderConfig($config_value, $indent, $platform, 'platforms');
|
2024-08-25 10:24:48 +00:00
|
|
|
} else {
|
2024-08-26 18:19:21 +00:00
|
|
|
renderConfig($config_value, $indent, $platform);
|
2024-08-25 10:24:48 +00:00
|
|
|
}
|
|
|
|
$indent = 0;
|
|
|
|
} else {
|
|
|
|
// if it's not array, just display it
|
2024-08-19 10:25:09 +00:00
|
|
|
?>
|
|
|
|
<div class="border col-md-8 text-start">
|
|
|
|
<?= htmlspecialchars($config_value ?? '')?>
|
|
|
|
</div>
|
2024-09-04 09:53:02 +00:00
|
|
|
<?php } ?>
|
2024-08-19 10:25:09 +00:00
|
|
|
</div>
|
2024-09-04 09:53:02 +00:00
|
|
|
<?php } ?>
|
|
|
|
</div>
|
2024-08-19 10:25:09 +00:00
|
|
|
<?php
|
2024-08-13 19:46:56 +00:00
|
|
|
}
|
2024-10-29 11:38:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
// render config variables array
|
|
|
|
function editConfig($configPart, $indent, $platform=false, $parent='') {
|
|
|
|
?>
|
|
|
|
<div style="padding-left: <?= $indent ?>px; padding-bottom: 20px;">
|
|
|
|
<?php foreach ($configPart as $config_item => $config_value) { ?>
|
|
|
|
<div class="row mb-1" style="padding-left: <?= $indent ?>px;">
|
|
|
|
<div class="col-md-4 text-end">
|
|
|
|
<label for="<?= htmlspecialchars($config_item) ?>" class="form-label"><?= htmlspecialchars($config_item) ?></label>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if (is_array($config_value)) {
|
|
|
|
// here we render recursively nested arrays
|
|
|
|
$indent = $indent + 50;
|
2024-10-29 11:45:27 +00:00
|
|
|
editConfig($config_value, $indent, $platform);
|
2024-10-29 11:38:22 +00:00
|
|
|
$indent = 0;
|
|
|
|
} else {
|
|
|
|
// if it's not array, just display it
|
|
|
|
?>
|
2024-10-29 11:45:27 +00:00
|
|
|
<div class="col-md-8 text-start">
|
2024-10-30 13:55:03 +00:00
|
|
|
<?php if ($config_item === 'registration_enabled') { ?>
|
2024-11-01 18:01:43 +00:00
|
|
|
<input type="hidden" name="<?= htmlspecialchars($config_item) ?>" value="0" />
|
2024-10-30 13:55:03 +00:00
|
|
|
<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 />
|
2024-11-01 17:48:23 +00:00
|
|
|
<?php } elseif ($config_item === 'db_type') {?>
|
|
|
|
<input class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? '') ?>" disabled />
|
2024-10-30 13:55:03 +00:00
|
|
|
<?php } else { ?>
|
|
|
|
<input class="form-control" type="text" name="<?= htmlspecialchars($config_item) ?>" value="<?= htmlspecialchars($config_value ?? '') ?>" />
|
|
|
|
<?php } ?>
|
2024-10-29 11:38:22 +00:00
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-08-13 19:46:56 +00:00
|
|
|
?>
|