From a900458749b62babbffa3c738fff6ed17923f5c4 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 29 Dec 2002 16:28:41 +0000 Subject: [PATCH] It's now possible to choose a documentation language on the fly! --- doc/index.php | 6 ++++++ doc/top.php | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) 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)); ?> -- 2.39.5