diff --git a/Vue/gabarit.php b/Vue/gabarit.php index f53f2394..968e895d 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -1,13 +1,20 @@ get_full_path($activeLink); -$fullPath = explode("\ ", $fullPath); +$current_url = $_SERVER['REQUEST_URI']; +$elements = explode('/', $current_url); +$activeLink = $elements[1]; +$fullPath = $gabary->get_full_path($activeLink); +$fullPath = explode('\ ', $fullPath); $activeLevel1 = $activeLink; $activeLevel2 = sizeof($fullPath) > 1 ? $fullPath[1] : ''; @@ -17,43 +24,133 @@ $activeLevel5 = sizeof($fullPath) > 4 ? $fullPath[4] : ''; $_SESSION['firstLevelMenu'] = $activeLink; -const MAX_COMPANY_NAME_LENGTH = 20; +/* ── Constantes ── */ +defined('MAX_COMPANY_NAME_LENGTH') || define('MAX_COMPANY_NAME_LENGTH', 20); +defined('APP_VERSION') || define('APP_VERSION', date('YmdHi')); -$companyDisplayName = htmlspecialchars($_SESSION['nomSociete'], ENT_QUOTES); -$modeDev = $_SESSION['modeDev_C']; -$imgData = $_SESSION['photoAssureCrypte']; +/* ── Variables de présentation ── */ +$companyDisplayName = htmlspecialchars($_SESSION['nomSociete'] ?? '', ENT_QUOTES); +$modeDev = $_SESSION['modeDev_C']; +$imgData = $_SESSION['photoAssureCrypte']; +/* ── Infos de la vue ── */ $infovue = $gabary->getInfosVue($_SESSION['vue']); - -$_SESSION['descriptionVue'] = est_anglophone() ? $infovue['DescriptionEng'] : $infovue['Description']; -$_SESSION['titreRetour'] = est_anglophone() ? $infovue['titreRetourEng'] : $infovue['titreRetour']; +$_SESSION['descriptionVue'] = est_anglophone() ? $infovue['DescriptionEng'] : $infovue['Description']; +$_SESSION['titreRetour'] = est_anglophone() ? $infovue['titreRetourEng'] : $infovue['titreRetour']; $_SESSION['retourVue'] = $infovue['lienRetour']; - -// Pour l'exemple, on désactive le mode test, mais vous pouvez le laisser dynamique -$_SESSION['bdTests_C'] = "0"; +$descriptionVue = $_SESSION['descriptionVue']; ?> - - - - - - -
- - + - - - + + + + +