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'); ?>