It's now possible to choose a documentation language on the fly!

This commit is contained in:
moodler 2002-12-29 16:28:41 +00:00
parent 18496c590b
commit a900458749
2 changed files with 16 additions and 1 deletions

View File

@ -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;

View File

@ -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));
?>