Add menu enable toggle, user status, and mobile/UI polish
- Admin menu page: mobile item cards now put Actions in the top-right
corner next to Status, matching the desktop row layout instead of
stacking at the bottom; same treatment applied to announcements and
users for consistency across all three admin lists
- Center button label text everywhere via .btn { justify-content: center }
instead of one-off overrides
- Add a Disable/Enable Menu toggle to the admin menu toolbar; the public
menu page shows its existing "menu being updated" message while disabled
- Add an Enabled/Disabled status to user accounts, with its own toggle
badge, guardrails against disabling your own account or the last
enabled account, and an immediate session kick for anyone disabled
mid-session
- Fix the announcement banner / hero tagline "·" separators to hide only
when their neighboring text actually wraps onto a different line,
instead of a fixed breakpoint or always-on dot
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eab20899de
commit
cd4c6c1969
13 files changed
+405
-50
No files matched your search
@@ -7,6 +7,22 @@ declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/db.php';
|
||||
|
||||
// Whether the public menu page should show its items at all — separate
|
||||
// from any individual item's is_available, this is the admin-facing "take
|
||||
// the whole menu down for maintenance" switch. Defaults to enabled if the
|
||||
// singleton settings row is somehow missing.
|
||||
function is_menu_enabled(): bool {
|
||||
$pdo = get_db();
|
||||
$value = $pdo->query("SELECT menu_enabled FROM site_settings WHERE id = 1")->fetchColumn();
|
||||
return $value === false ? true : (bool) $value;
|
||||
}
|
||||
|
||||
function set_menu_enabled(bool $enabled): void {
|
||||
$pdo = get_db();
|
||||
$stmt = $pdo->prepare("UPDATE site_settings SET menu_enabled = ?, updated_at = CURRENT_TIMESTAMP WHERE id = 1");
|
||||
$stmt->execute([$enabled ? 1 : 0]);
|
||||
}
|
||||
|
||||
function get_full_menu(bool $availableOnly = false): array {
|
||||
$pdo = get_db();
|
||||
|
||||
|
||||
Reference in new issue
Block a user