mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
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:
parent
69ae05837c
commit
3db3acfb99
@ -8,7 +8,7 @@
|
||||
optional_variable($lang, ""); // override current language
|
||||
|
||||
if (!empty($lang)) {
|
||||
$SESSION->doclang = $lang;
|
||||
$SESSION->lang = $lang;
|
||||
save_session("SESSION");
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user