HummingBirdAnimeClient/app/views/settings.php
Timothy J Warren 616ae1ea82 Ugly Progress Commit
* Cache and resize images - not just cache them
* Convert to webp on cache
* Show webp images if available
* Settings Form Generation (doesn't yet save)
2018-10-05 21:32:15 -04:00

44 lines
852 B
PHP

<?php
if ( ! $auth->isAuthenticated())
{
echo '<h1>Not Authorized</h1>';
return;
}
$sectionMapping = [
'config' => 'General Settings',
'cache' => 'Caching',
'database' => 'Collection Database Settings',
];
$hiddenFields = [];
$nestedPrefix = 'config';
?>
<pre><?= print_r($_POST, TRUE) ?></pre>
<form action="<?= $_SERVER['REQUEST_URI'] ?>" method="POST">
<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>
</form>