From d00ee47e77b3924126decf93e9e2f859e1935e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Garnier?= Date: Sat, 14 Jan 2023 17:19:05 +0100 Subject: [PATCH] Correction de lien --- Config/Config.php | 1 + Controller/UserController.php | 13 +++++++++++++ View/src/JS/baseMulti.js | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Config/Config.php b/Config/Config.php index 34f03da9..c0d58393 100644 --- a/Config/Config.php +++ b/Config/Config.php @@ -42,6 +42,7 @@ $vues['queue'] = 'View/src/pages/Multijoueur/FileAttente.php'; $vues['lobby'] = 'View/src/pages/Multijoueur/Lobby.php'; $vues['lobbyEnd'] = 'View/src/pages/Multijoueur/LobbyEnd.php'; $vues['gameEnd'] = 'View/src/pages/Multijoueur/GameEnd.php'; +$vues['dashboard'] = 'View/src/pages/Multijoueur/Dashboard.html'; // Enigme $vues['enigmePage'] = 'View/src/pages/Enigme/EnigmePage.php'; diff --git a/Controller/UserController.php b/Controller/UserController.php index 3ce7ac3a..7ceb6462 100644 --- a/Controller/UserController.php +++ b/Controller/UserController.php @@ -73,6 +73,9 @@ class UserController case "skipEnigme": $this->skipEnigme(); break; + case "goToDashboard": + $this->goToDashboard(); + break; default: $error = "Action non valide"; require($rep . $vues['erreur']); @@ -106,6 +109,16 @@ class UserController require($rep . $vues['erreur']); } } + public function goToDashboard() + { + try { + global $rep, $vues; + require($rep . $vues['dashboard']); + } catch (Exception $e) { + $error = $e->getMessage(); + require($rep . $vues['erreur']); + } + } public function goToSolo() { try { diff --git a/View/src/JS/baseMulti.js b/View/src/JS/baseMulti.js index 93b34ab5..23d4b649 100644 --- a/View/src/JS/baseMulti.js +++ b/View/src/JS/baseMulti.js @@ -131,5 +131,5 @@ function displayHelp() { * It opens a new window with the name dashboard.html and the size of 1000x450. */ function dashboard() { - window.open("dashboard.html", "", "width=1000, height=450"); + window.open("index.php?action=goToDashboard", "", "width=1000, height=450"); } \ No newline at end of file