From f37517233ba35a65832bc2abe944768b8f2f85d9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 9 Sep 2025 11:56:46 +0200 Subject: =?UTF-8?q?nutze=20deutsche=20Bezeichner=20und=20stelle=20den=20Bi?= =?UTF-8?q?lder=20Pfad=20f=C3=BCr=20JS=20bereit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.php.sample | 4 ++-- index.php | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/config.php.sample b/config.php.sample index ac09910..2ca654f 100644 --- a/config.php.sample +++ b/config.php.sample @@ -5,14 +5,14 @@ $CONFIG = array( 'dbhost' => 'localhost', 'dbuser' => 'user', 'dbpassword' => 'password', - 'icon_path_format' => 'img/$SCHULJAHR/$JAHRGANG/' + 'bilder_pfad_format' => 'img/$SCHULJAHR/$JAHRGANG/' ); /* Konfiguration für eine sqlite Datenbank * $CONFIG = array( * 'dbtype' => 'sqlite', * 'dbname' => './punktestand.sqlite', - * 'icon_path_format' => 'img/$SCHULJAHR/$JAHRGANG/' + * 'bilder_pfad_format' => 'img/$SCHULJAHR/$JAHRGANG/' * ); */ ?> diff --git a/index.php b/index.php index ceb9d29..8d314a9 100644 --- a/index.php +++ b/index.php @@ -33,12 +33,21 @@ // Funktion lade_daten($config, $schuljahr, $jahrgang) $daten = lade_daten($CONFIG, $SCHULJAHR, $JAHRGANG); - // Bereite die Klassen und Event Daten für Javascript vor + // Bereite die Klassen und Ereignisse für Javascript vor $daten_json = json_encode($daten); + // Ersetze die $JAHRGANG und $SCHULJAHR Platzhalter durch die werte der Variablen + $bilder_pfad = str_replace( + array('$JAHRGANG', '$SCHULJAHR'), + array($JAHRGANG, $SCHULJAHR), + $CONFIG['bilder_pfad_format']); + + $bilder_pfad_json = json_encode($bilder_pfad); + // Schreibe den Javascript Code mit unseren Daten in die Webseite echo ""; ?> -- cgit v1.2.3