2018-08-20 12:58:56 -04:00
|
|
|
<?php
|
|
|
|
if ( ! $auth->isAuthenticated())
|
|
|
|
{
|
|
|
|
echo '<h1>Not Authorized</h1>';
|
2018-09-27 16:45:12 -04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-10-05 21:32:15 -04:00
|
|
|
$sectionMapping = [
|
|
|
|
'config' => 'General Settings',
|
|
|
|
'cache' => 'Caching',
|
|
|
|
'database' => 'Collection Database Settings',
|
|
|
|
];
|
2018-09-27 16:45:12 -04:00
|
|
|
|
2018-10-05 21:32:15 -04:00
|
|
|
$hiddenFields = [];
|
|
|
|
$nestedPrefix = 'config';
|
2018-08-20 12:58:56 -04:00
|
|
|
?>
|
|
|
|
|
2018-09-27 16:45:12 -04:00
|
|
|
<pre><?= print_r($_POST, TRUE) ?></pre>
|
|
|
|
|
|
|
|
<form action="<?= $_SERVER['REQUEST_URI'] ?>" method="POST">
|
2018-10-05 21:32:15 -04:00
|
|
|
<main class='form'>
|
|
|
|
<button type="submit">Save Changes</button>
|
|
|
|
<br />
|
|
|
|
<?php foreach ($form as $section => $fields): ?>
|
|
|
|
<fieldset class="box">
|
|
|
|
<legend><?= $sectionMapping[$section] ?></legend>
|
|
|
|
<section class='form'>
|
|
|
|
<?php require __DIR__ . '/_form.php' ?>
|
|
|
|
</section>
|
|
|
|
</fieldset>
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
<?php foreach ($hiddenFields as $field): ?>
|
|
|
|
<?= $field ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<button type="submit">Save Changes</button>
|
|
|
|
</main>
|
2018-09-27 16:45:12 -04:00
|
|
|
</form>
|
|
|
|
|
2018-08-20 12:58:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|