| Server IP : 188.114.96.3 / Your IP : 216.73.216.143 Web Server : Apache System : Linux sv058.home.net.pl 6.8.2 husak_dirty_pages_fix #1 SMP PREEMPT_DYNAMIC Tue Apr 2 22:06:51 CEST 2024 x86_64 User : ( 3194769) PHP Version : 8.5.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /polana/admin/ |
Upload File : |
<?php
declare(strict_types=1);
require_once dirname(__DIR__) . '/includes/functions.php';
require_login();
$keys = [
'nav_gallery_enabled',
'nav_blog_enabled',
'nav_collaboration_enabled',
];
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
verify_csrf();
$stmt = db()->prepare(
'INSERT INTO settings (setting_key, setting_value)
VALUES (?, ?)
ON DUPLICATE KEY UPDATE setting_value = VALUES(setting_value)'
);
foreach ($keys as $key) {
$stmt->execute([$key, trim((string)($_POST[$key] ?? '0'))]);
}
admin_log('modules_update', 'Zmieniono widoczność przyszłych sekcji');
flash('success', 'Widoczność sekcji została zapisana.');
redirect('/admin/modules.php');
}
render_admin_header('Sekcje strony');
?>
<div class="admin-title-row">
<div>
<h1>Sekcje strony</h1>
<p>Galeria, blog i współpraca są przygotowane jako kierunek rozwoju, ale domyślnie ukryte w menu.</p>
</div>
</div>
<form class="form-card form-grid" method="post">
<?= csrf_field() ?>
<label>
Galeria
<select name="nav_gallery_enabled">
<option value="0" <?= setting('nav_gallery_enabled', '0') === '0' ? 'selected' : '' ?>>Ukryta</option>
<option value="1" <?= setting('nav_gallery_enabled', '0') === '1' ? 'selected' : '' ?>>Widoczna</option>
</select>
</label>
<label>
Blog
<select name="nav_blog_enabled">
<option value="0" <?= setting('nav_blog_enabled', '0') === '0' ? 'selected' : '' ?>>Ukryty</option>
<option value="1" <?= setting('nav_blog_enabled', '0') === '1' ? 'selected' : '' ?>>Widoczny</option>
</select>
</label>
<label>
Współpraca
<select name="nav_collaboration_enabled">
<option value="0" <?= setting('nav_collaboration_enabled', '0') === '0' ? 'selected' : '' ?>>Ukryta</option>
<option value="1" <?= setting('nav_collaboration_enabled', '0') === '1' ? 'selected' : '' ?>>Widoczna</option>
</select>
</label>
<div class="full">
<button class="btn btn-primary" type="submit">Zapisz</button>
</div>
</form>
<div class="form-card">
<h2>Na później</h2>
<p>
Te przełączniki są celowo wyłączone. Później można pod nie podpiąć:
galerię zdjęć, wpisy/blog Andrzeja oraz stronę współpracy / eventów / cateringu.
</p>
</div>
<?php render_admin_footer(); ?>