Lehrplan: Country-Helper + Landeinstellung live
- App/php/lib/Country.php: Kaskade session → classes → teachers → cookie → 'AT', Helper current()/flag()/label()/allCountries() - App/php/api/country.php: GET + POST /api/country - country-Spalten in teachers, classes, student_sessions (idempotent) - Native-<select>-Picker im Header aller öffentlichen Seiten (modul-*.php, lehrplan.php, simulationen.php) - Footer-Links "Andere Länder: 🇨🇭 🇩🇪 🇱🇮" - lehrplan.php liest Default-Filter jetzt aus Country::current() - iPad-freundlich: Native Select gibt Wheel-Picker auf iOS, Touch-Ziel >=40px Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+11
-4
@@ -15,14 +15,19 @@
|
||||
require_once __DIR__ . '/../php/config/app.php';
|
||||
require_once __DIR__ . '/../php/config/db.php';
|
||||
require_once __DIR__ . '/../php/lib/EasyLang.php';
|
||||
require_once __DIR__ . '/../php/lib/Country.php';
|
||||
|
||||
$db = getDB();
|
||||
|
||||
// Filter aus URL (sanft, nur Whitelist-Werte)
|
||||
// Filter: Default ist das aktuelle Landes-Setting (Kaskade), per URL überschreibbar
|
||||
$allowedCountries = ['AT', 'DE', 'CH', 'LI'];
|
||||
$qCountry = strtoupper(trim($_GET['country'] ?? 'AT'));
|
||||
if (!in_array($qCountry, $allowedCountries, true) && $qCountry !== 'ALL') {
|
||||
$qCountry = 'AT'; // Default
|
||||
if (isset($_GET['country'])) {
|
||||
$qCountry = strtoupper(trim($_GET['country']));
|
||||
if (!in_array($qCountry, $allowedCountries, true) && $qCountry !== 'ALL') {
|
||||
$qCountry = Country::current();
|
||||
}
|
||||
} else {
|
||||
$qCountry = Country::current();
|
||||
}
|
||||
|
||||
$qTheme = preg_replace('/[^a-z0-9_-]/', '', strtolower($_GET['theme'] ?? ''));
|
||||
@@ -359,6 +364,7 @@ $categoryMeta = [
|
||||
<?php if ($easyActive): ?>
|
||||
<span class="lp-btn-sm lp-easy-pill">🟢 Leichte Sprache</span>
|
||||
<?php endif; ?>
|
||||
<?php include __DIR__ . '/_partials/country_picker.php'; ?>
|
||||
<a href="<?= $bp ?>/pages/simulationen.php" class="lp-btn-sm">Simulationen</a>
|
||||
<a href="<?= $bp ?>/glossar" class="lp-btn-sm">Glossar</a>
|
||||
<a href="<?= $bp ?>/login.html" class="lp-btn-sm lp-btn-primary">Anmelden</a>
|
||||
@@ -557,6 +563,7 @@ $categoryMeta = [
|
||||
<a href="<?= $bp ?>/impressum.html">Impressum</a> ·
|
||||
<a href="<?= $bp ?>/datenschutz.html">Datenschutz</a>
|
||||
</div>
|
||||
<?php include __DIR__ . '/_partials/country_footer.php'; ?>
|
||||
</footer>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user