From 21d649946f536856eca5436da9400830de8ec666 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Tue, 24 Nov 2020 11:12:33 +0100 Subject: [PATCH] Position des drapeaux --- core/core.php | 8 ++++++-- core/layout/common.css | 19 +++++++++++++------ core/layout/main.php | 3 ++- core/module/translate/translate.php | 23 ++++++----------------- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/core/core.php b/core/core.php index b99ff288..53ae5eaa 100755 --- a/core/core.php +++ b/core/core.php @@ -229,8 +229,12 @@ class common { // Auto traduction if ( $this->getData(['config','translate','activated'])) { - // Lire la langue du navigateur - $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + // Lire la langue du navigateur si pas de choix manuel + if ( isset($_COOKIE['ZWII_USER_I18N']) ) { + $lan = $_COOKIE['ZWII_USER_I18N']; + } else { + $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); + } // Changer la locale if ( $lan !== 'fr') { diff --git a/core/layout/common.css b/core/layout/common.css index ebc18957..74c49201 100755 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -714,18 +714,25 @@ li .menuSideChild { #i18nContainer { z-index: 100; - position: absolute ; + position: relative ; + float: right; width: auto; - height: 20px; - margin: 5px; - top: 5px; - right: 10px; + height: auto; + margin-top: -25px; } #i18nContainer ul { list-style: none; } +#i18nContainer li { + display: inline-block; + position: relative; +} + + + + #i18nContainer img { margin: 2px; } @@ -1689,7 +1696,7 @@ th.col12 { } .goog-text-highlight { background-color: transparent !important; - border: none !important; + border: none !important; box-shadow: none !important; } */ diff --git a/core/layout/main.php b/core/layout/main.php index 685cd902..df3c1624 100755 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -31,7 +31,6 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?> showBar(); ?> showNotification(); ?> - showi18n();?> getData(['theme', 'menu', 'position']) === 'body-first' || $this->getData(['theme', 'menu', 'position']) === 'top' ): ?> @@ -61,6 +60,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?> getData(['theme', 'header', 'position']) === 'body'): ?>
+ showi18n();?> getData(['theme','header','linkHomePage'])){ echo "" ;} ?> @@ -154,6 +154,7 @@ $lan = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); ?>
+ showi18n();?> getUrl(2); - die(); - // Traitement du changement de langue - if (isset($lan)) { - $this->seti18n($lan); - // Valeurs en sortie sans post - $this->addOutput([ - 'redirect' => helper::baseUrl(false), - 'state' => true - ]); - } else { - $this->addOutput([ - 'redirect' => helper::baseUrl(false) - ]); - } + // Transmettre le choix au noyau + setcookie('ZWII_USER_I18N', $this->getUrl(2), time() + 3600, helper::baseUrl(false, false) , '', helper::isHttps(), true); + // Valeurs en sortie sans post + $this->addOutput([ + 'redirect' => helper::baseUrl(false) + ]); } - - } \ No newline at end of file