mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
It's now possible to choose a documentation language on the fly!
This commit is contained in:
parent
18496c590b
commit
a900458749
@ -3,6 +3,12 @@
|
||||
require("../config.php");
|
||||
|
||||
optional_variable($file, ""); // docs file to view
|
||||
optional_variable($lang, ""); // override current language
|
||||
|
||||
if (!empty($lang)) {
|
||||
$SESSION->doclang = $lang;
|
||||
save_session("SESSION");
|
||||
}
|
||||
|
||||
if (empty($file)) {
|
||||
$include = false;
|
||||
|
11
doc/top.php
11
doc/top.php
@ -2,11 +2,20 @@
|
||||
|
||||
require("../config.php");
|
||||
|
||||
if (!empty($SESSION->doclang)) {
|
||||
$currlang = $SESSION->doclang;
|
||||
} else {
|
||||
$currlang = current_language();
|
||||
}
|
||||
|
||||
$langs = get_list_of_languages();
|
||||
$langmenu = popup_form ("$CFG->wwwroot/doc/?lang=", $langs, "chooselang", $currlang, "", "", "", true);
|
||||
|
||||
if (! $site = get_site()) {
|
||||
error("Site is misconfigured");
|
||||
}
|
||||
$strdocumentation = get_string("documentation");
|
||||
print_header("$site->shortname: $strdocumentation", "$site->fullname", "$strdocumentation", "", "", true, "", navmenu($site));
|
||||
print_header("$site->shortname: $strdocumentation", "$site->fullname", "$strdocumentation", "", "", true, $langmenu, navmenu($site));
|
||||
|
||||
?>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user