Instead of using doclang, use $SESSION->lang, and make it override other

language settings.  This should fix documentation display, but also will
be how setting registration languages and login languages works
This commit is contained in:
moodler 2003-01-19 12:32:55 +00:00
parent 69ae05837c
commit 3db3acfb99
3 changed files with 8 additions and 8 deletions

View File

@ -8,7 +8,7 @@
optional_variable($lang, ""); // override current language
if (!empty($lang)) {
$SESSION->doclang = $lang;
$SESSION->lang = $lang;
save_session("SESSION");
}

View File

@ -2,11 +2,7 @@
require("../config.php");
if (!empty($SESSION->doclang)) {
$currlang = $SESSION->doclang;
} else {
$currlang = current_language();
}
$currlang = current_language();
$langs = get_list_of_languages();
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);

View File

@ -897,10 +897,14 @@ function clean_filename($string) {
function current_language() {
/// Returns the code for the current language
global $CFG, $USER;
global $CFG, $USER, $SESSION;
if (isset($USER->lang)) { // User language can override site language
if (isset($SESSION->lang)) { // Session language can override other settings
return $SESSION->lang;
} else if (isset($USER->lang)) { // User language can override site language
return $USER->lang;
} else {
return $CFG->lang;
}