]> git.mjollnir.org Git - moodle.git/commitdiff
It's now possible to choose a documentation language on the fly!
authormoodler <moodler>
Sun, 29 Dec 2002 16:28:41 +0000 (16:28 +0000)
committermoodler <moodler>
Sun, 29 Dec 2002 16:28:41 +0000 (16:28 +0000)
doc/index.php
doc/top.php

index 0c9c512a080ed4d002d5d92c400cb03658cbe0fc..9d9fe7a82edcb33ebbd79043c27cebd56157c466 100644 (file)
@@ -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;
index 4f58d44048f82cd4c3a5ecf05f30281b1d4e2757..5d8b4594585ee5908eaff2bb39460b0f368a8abf 100644 (file)
@@ -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));
     
 ?>