Skip to content

Commit

Permalink
It's now possible to choose a documentation language on the fly!
Browse files Browse the repository at this point in the history
  • Loading branch information
moodler committed Dec 29, 2002
1 parent 18496c5 commit a900458
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 6 additions & 0 deletions doc/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 10 additions & 1 deletion doc/top.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.