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:
2026-04-19 00:09:43 +02:00
parent db9ed43407
commit 7deec2a26d
8 changed files with 390 additions and 4 deletions
+23
View File
@@ -23,6 +23,29 @@ $db = getDB();
echo "=== Content-Architektur Seed ===\n";
// ------------------------------------------------------------------
// 0. Country-Spalten (Landeinstellung-Kaskade) idempotent ergaenzen
// ------------------------------------------------------------------
// Auflösung: students.country? (optional) → classes → teachers → Cookie → AT
// Schreibend nutzt nur Profil-Admin; Lese-Resolver in App/php/lib/Country.php
$countryTargets = [
'teachers' => 'country CHAR(2) NULL DEFAULT NULL AFTER email',
'classes' => 'country CHAR(2) NULL DEFAULT NULL',
'student_sessions' => 'country CHAR(2) NULL DEFAULT NULL',
];
foreach ($countryTargets as $tbl => $def) {
try {
$exists = $db->query("SHOW COLUMNS FROM `$tbl` LIKE 'country'")->fetch();
if (!$exists) {
$db->exec("ALTER TABLE `$tbl` ADD COLUMN $def");
echo " $tbl: Spalte country ergaenzt\n";
}
} catch (Throwable $e) {
echo " $tbl: Hinweis — " . $e->getMessage() . "\n";
}
}
// ------------------------------------------------------------------
// 1. Tabellen
// ------------------------------------------------------------------