WowPress-Tailwind/theme/options/misc.php

39 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2024-09-20 20:02:10 +02:00
<?php
// Optionen-Seite erstellen
use WoWPress\Models\SKSHistory;
function wowpress_misc_options_page()
{
global $select_options, $radio_options;
if (! isset($_REQUEST['settings-updated']))
$_REQUEST['settings-updated'] = false; ?>
<div class="wrap">
<h2>Allgemeine Optionen für <?php bloginfo('name'); ?></h2>
<?php if (false !== $_REQUEST['settings-updated']) : ?>
<div class="updated fade">
<p><strong>Einstellungen gespeichert!</strong></p>
</div>
<?php endif; ?>
<h3>SKS-Liste neu Würfeln</h3>
<form method="post" action="/request" enctype="multipart/form-data">
<input type="hidden" name="action" value="rollSKS">
<?php wp_nonce_field('rollSKS', 'rollSKS_nonce'); ?>
<?php foreach (SKSHistory::groupBy('list_name')->get() as $list): ?>
<p class="submit"><input type="submit" name="list_name" class="button-primary" value="<?= $list->list_name ?>" /></p>
<?php endforeach; ?>
</form>
<h3>Neue SKS-Liste</h3>
<form method="post" action="/request" enctype="multipart/form-data">
<input type="hidden" name="action" value="createSKS">
<?php wp_nonce_field('createSKS', 'createSKS_nonce'); ?>
<input type="text" name="list_name" value="" placeholder="Listen-Name">
<p class="submit"><input type="submit" class="button-primary" value="Liste erstellen" /></p>
</form>
</div>
<?php }