This commit is contained in:
2026-07-22 21:15:44 +02:00
parent 1176b98522
commit 751b6996c4
8 changed files with 375 additions and 19 deletions

View File

@@ -13,6 +13,18 @@ if (!in_array($childGender, ['male', 'female', 'mixed'], true)) {
}
$debugEnabled = defined('APP_DEBUG') && APP_DEBUG === true;
$locationTrackingPreference = 'prompt';
if (isset($_SESSION['user_id'])) {
try {
$pdo = $app->pdo();
if ($pdo) {
$profileSettings = new \App\ProfileSettings($pdo);
$locationTrackingPreference = $profileSettings->getLocationTrackingPreference((int)$_SESSION['user_id']);
}
} catch (\Throwable) {
$locationTrackingPreference = 'prompt';
}
}
$debugFiles = [];
if ($debugEnabled) {
$debugDir = __DIR__ . '/../../debug';
@@ -57,7 +69,7 @@ if ($debugEnabled) {
<?php asset_styles(); ?>
<?php asset_scripts('header'); ?>
</head>
<body data-auth="<?= isset($_SESSION['user_id']) ? '1' : '0' ?>" data-child-gender="<?= htmlspecialchars($childGender, ENT_QUOTES) ?>">
<body data-auth="<?= isset($_SESSION['user_id']) ? '1' : '0' ?>" data-child-gender="<?= htmlspecialchars($childGender, ENT_QUOTES) ?>" data-location-preference="<?= htmlspecialchars($locationTrackingPreference, ENT_QUOTES) ?>">
<?php tpl('matomo', 'structure'); ?>
<?php tpl('nav', 'structure'); ?>

View File

@@ -15,7 +15,7 @@ $isDebug = defined('APP_DEBUG') && APP_DEBUG === true;
<nav class="nav-links" aria-label="Hauptmenü">
<a href="/">Home</a>
<a href="/search">Suche</a>
<a href="/#events">Termine</a>
<a href="/#events" data-nav-events>Termine</a>
<a href="/community">Community</a>
</nav>
<div class="nav-actions">
@@ -35,7 +35,7 @@ $isDebug = defined('APP_DEBUG') && APP_DEBUG === true;
<div class="mobile-menu" id="mobileMenu">
<a href="/">Home</a>
<a href="/search">Suche</a>
<a href="/#events">Termine</a>
<a href="/#events" data-nav-events>Termine</a>
<a href="/community">Community</a>
<?php if ($isLoggedIn): ?>
<a class="btn ghost" href="/dashboard">Dashboard</a>