HummingBirdAnimeClient/app/views/settings/settings.php

47 lines
1.1 KiB
PHP
Raw Permalink Normal View History

<?php
if ( ! $_->isAuthenticated())
{
echo '<h1>Not Authorized</h1>';
2018-09-27 16:45:12 -04:00
return;
}
$sectionMapping = [
'anilist' => 'Anilist API Integration',
'config' => 'General Settings',
'cache' => 'Caching',
'database' => 'Collection Database Settings',
];
2018-09-27 16:45:12 -04:00
$hiddenFields = [];
$nestedPrefix = 'config';
?>
<form action="<?= $_->urlFromRoute('settings-post') ?>" method="POST">
<main class='settings form'>
<button type="submit">Save Changes</button>
2018-10-08 16:38:08 -04:00
<div class="tabs">
<?php $i = 0; ?>
<?php foreach ($form as $section => $fields): ?>
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="settings-tab<?= $i ?>"
name="settings-tabs"
/>
<label for="settings-tab<?= $i ?>"><h3><?= $sectionMapping[$section] ?></h3></label>
<section class="content">
<?php
($section === 'anilist')
? require __DIR__ . '/_anilist.php'
: require __DIR__ . '/_form.php'
?>
2018-10-08 16:38:08 -04:00
</section>
<?php $i++; ?>
<?php endforeach ?>
</div>
<br />
<?php foreach ($hiddenFields as $field): ?>
<?= $field->__toString() ?>
<?php endforeach ?>
<button type="submit">Save Changes</button>
</main>
2018-09-27 16:45:12 -04:00
</form>