From: moodler Date: Sun, 29 Dec 2002 16:28:41 +0000 (+0000) Subject: It's now possible to choose a documentation language on the fly! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a900458749b62babbffa3c738fff6ed17923f5c4;p=moodle.git It's now possible to choose a documentation language on the fly! --- diff --git a/doc/index.php b/doc/index.php index 0c9c512a08..9d9fe7a82e 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 4f58d44048..5d8b459458 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)); ?>