From 21c49d8e53c717bf97fd51ba1331e661573cf3d9 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 20 Jan 2024 21:22:16 +0100 Subject: [PATCH] 1410 changement d'id --- core/class/layout.class.php | 2 +- core/class/router.class.php | 2 +- core/core.js.php | 93 +++++++++++++++++++++++-------------- core/layout/common.css | 4 +- 4 files changed, 62 insertions(+), 39 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 429b748..79f8e83 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -501,7 +501,7 @@ class layout extends common $this->getData(['theme', 'menu', 'selectSpace']) === true ) { if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) { - $itemsRight .= '
  • '; $itemsRight .= ''; foreach ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group')) as $courseId => $value) { $itemsRight .= ''; diff --git a/core/class/router.class.php b/core/class/router.class.php index 659fd50..84e98d1 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -364,7 +364,7 @@ class core extends common $css .= '.button.buttonGreen, button[type=submit] {background-color: ' . $colors['normal'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:hover, button[type=submit]:hover {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}.button.buttonGreen:active, button[type=submit]:active {background-color: ' . $colors['darken'] . ';color: ' . $colors['text'] . ';}'; $colors = helper::colorVariants($this->getData(['admin', 'backgroundBlockColor'])); $css .= '.buttonTab, .block {border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}.buttonTab, .block h4 {background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';}'; - $css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=password],select:not(#barSelectCourse),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}'; + $css .= 'table tr,input[type=email],input[type=date],input[type=time],input[type=month],input[type=week],input[type=datetime-local],input[type=text],input[type=password],select:not(#barSelectCourse),select:not(#menuSelectCourse),select:not(#barSelectPage),textarea:not(.editorWysiwyg), textarea:not(.editorWysiwygComment),.inputFile{background-color: ' . $colors['normal'] . ';color:' . $colors['text'] . ';border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . ';}'; // Bordure du contour TinyMCE $css .= '.mce-tinymce{border: 1px solid ' . $this->getData(['admin', 'borderBlockColor']) . '!important;}'; // Enregistre la personnalisation diff --git a/core/core.js.php b/core/core.js.php index 29a5294..02ebebb 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -23,15 +23,15 @@ core.alert = function (text) { .append( $("").text(text), $("
    ") - .addClass("lightboxButtons") - .append( - $("") - .addClass("button") - .text("Ok") - .on("click", function () { - lightbox.close(); - }) - ) + .addClass("lightboxButtons") + .append( + $("") + .addClass("button") + .text("Ok") + .on("click", function () { + lightbox.close(); + }) + ) ) }(jQuery)); // Validation de la lightbox avec le bouton entrée @@ -67,29 +67,29 @@ core.confirm = function (text, yesCallback, noCallback) { .append( $("").text(text), $("
    ") - .addClass("lightboxButtons") - .append( - $("") - .addClass("button grey") - .text("") - .on("click", function () { - lightbox.options('button', true); - lightbox.close(); - if (typeof noCallback !== "undefined") { - noCallback(); - } - }), - $("") - .addClass("button") - .text("") - .on("click", function () { - lightbox.options('button', true); - lightbox.close(); - if (typeof yesCallback !== "undefined") { - yesCallback(); - } - }) - ) + .addClass("lightboxButtons") + .append( + $("") + .addClass("button grey") + .text("") + .on("click", function () { + lightbox.options('button', true); + lightbox.close(); + if (typeof noCallback !== "undefined") { + noCallback(); + } + }), + $("") + .addClass("button") + .text("") + .on("click", function () { + lightbox.options('button', true); + lightbox.close(); + if (typeof yesCallback !== "undefined") { + yesCallback(); + } + }) + ) ) }(jQuery)); // Callback lors d'un clic sur le fond et sur la croix de fermeture @@ -525,7 +525,7 @@ $(document).ready(function () { /** - * Sélection d'une langue du site + * Sélection d'un espace du site */ $("select#barSelectCourse").on("change", function () { // La langue courante ne déclenche pas de chargement @@ -538,14 +538,37 @@ $(document).ready(function () { var currentUrl = url.href.split("/"); // Change si différent, corrige le problème avec le thème et le rechargement de la langue. if ((currentUrl !== "?theme" || - currentUrl !== "theme") && + currentUrl !== "theme") && langSelected[6] !== langSession ) { //$(location).attr("href", langUrl); var select = document.getElementById("barSelectCourse"); var selectedOption = select.options[select.selectedIndex]; if (selectedOption.value !== "") { - window.location = selectedOption.value; } + window.location = selectedOption.value; + } + } + }); + + $("select#menuSelectCourse").on("change", function () { + // La langue courante ne déclenche pas de chargement + var langSelected = $(this).val(); + var langSelected = langSelected.split("/"); + // Lit le cookie de langue + var langSession = ""; + // Découpe l'URL pour exclure le changement de page avec le thème + var url = window.location; + var currentUrl = url.href.split("/"); + // Change si différent, corrige le problème avec le thème et le rechargement de la langue. + if ((currentUrl !== "?theme" || + currentUrl !== "theme") && + langSelected[6] !== langSession + ) { + var select = document.getElementById("menuSelectCourse"); + var selectedOption = select.options[select.selectedIndex]; + if (selectedOption.value !== "") { + window.location = selectedOption.value; + } } }); diff --git a/core/layout/common.css b/core/layout/common.css index f9cfbe0..e75cfc6 100644 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -604,11 +604,11 @@ nav li ul li { text-align: left; } -nav li ul #barSelectCourse { +nav li ul #menuSelectCourse { text-align: left; } -nav #barSelectCourse { +nav #menuSelectCourse { width: 150px; border: 0; color: #111112;