From 3e9b5d5a902d61344c7917dc4379e8f4e1f122a2 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 20 Jan 2003 08:09:25 +0000 Subject: [PATCH] Moved session lang setting into setup.php (works on all pages) --- index.php | 4 ---- lib/setup.php | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index 45b6adfd37..896c55704c 100644 --- a/index.php +++ b/index.php @@ -23,10 +23,6 @@ } } - if (isset($lang)) { - $SESSION->lang = $lang; - save_session("SESSION"); - } $currlang = current_language(); $langs = get_list_of_languages(); $langmenu = popup_form ("$CFG->wwwroot/?lang=", $langs, "chooselang", $currlang, "", "", "", true); diff --git a/lib/setup.php b/lib/setup.php index 430a45ecbd..17cecc9b99 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -144,6 +144,11 @@ /// then use the one from the default language. Otherwise (and this is the /// majority of cases), use the stored locale specified by admin. + if (isset($lang)) { + $SESSION->lang = $lang; + save_session("SESSION"); + } + if (!empty($SESSION->lang) and ($SESSION->lang != $CFG->lang) ) { $CFG->locale = get_string("locale"); } else if (!empty($USER->lang) and ($USER->lang != $CFG->lang) ) { -- 2.39.5