Rebuild
This commit is contained in:
47
public/page/settings.php
Normal file
47
public/page/settings.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
$themes = [
|
||||
'light' => 'Light',
|
||||
'ocean' => 'Ocean',
|
||||
'graphite' => 'Graphite',
|
||||
];
|
||||
|
||||
require_auth();
|
||||
|
||||
$current = user_theme();
|
||||
$notice = null;
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
$theme = (string)($_POST['theme'] ?? 'light');
|
||||
if (!isset($themes[$theme])) {
|
||||
$theme = 'light';
|
||||
}
|
||||
set_user_theme($theme);
|
||||
$current = $theme;
|
||||
$notice = 'Theme gespeichert.';
|
||||
}
|
||||
?>
|
||||
<div class="card">
|
||||
<div class="pill">Einstellungen</div>
|
||||
<h1 style="margin-top:.75rem;">User-Design</h1>
|
||||
<p class="muted">Wähle deine persönliche Farbpalette.</p>
|
||||
|
||||
<?php if ($notice): ?>
|
||||
<div class="card" style="margin-top:1rem; border-color:var(--accent-2);">
|
||||
<?= e($notice) ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form method="post" style="margin-top:1rem; display:grid; gap:12px; max-width:360px;">
|
||||
<label class="muted" style="display:grid; gap:6px;">
|
||||
<span>Farbpalette</span>
|
||||
<select name="theme">
|
||||
<?php foreach ($themes as $key => $label): ?>
|
||||
<option value="<?= e($key) ?>" <?= $current === $key ? 'selected' : '' ?>>
|
||||
<?= e($label) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</label>
|
||||
<button class="cta-button" type="submit">Speichern</button>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user