Skip to content
Browse files

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

  • Loading branch information...
1 parent 18496c5 commit a900458749b62babbffa3c738fff6ed17923f5c4 moodler committed Dec 29, 2002
Showing with 16 additions and 1 deletion.
  1. +6 −0 doc/index.php
  2. +10 −1 doc/top.php
View
6 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;
View
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));
?>

0 comments on commit a900458

Please sign in to comment.
Something went wrong with that request. Please try again.