diff --git a/doc/index.php b/doc/index.php index 0c9c512a080..9d9fe7a82ed 100644 --- a/doc/index.php +++ b/doc/index.php @@ -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; diff --git a/doc/top.php b/doc/top.php index 4f58d44048f..5d8b4594585 100644 --- a/doc/top.php +++ b/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)); ?>