]> git.mjollnir.org Git - moodle.git/commitdiff
Use session-specified language if possible
authormoodler <moodler>
Sun, 29 Dec 2002 16:26:44 +0000 (16:26 +0000)
committermoodler <moodler>
Sun, 29 Dec 2002 16:26:44 +0000 (16:26 +0000)
lib/moodlelib.php

index cc4d0da8f802f68dd359b018a7e5fb9a99acca98..8483994e91a4e7f6c8c78bb538c791b176f8cfa0 100644 (file)
@@ -965,14 +965,19 @@ function document_file($file, $include=true) {
 /// Can include a given document file (depends on second
 /// parameter) or just return info about it
 
-    global $CFG;
+    global $CFG, $SESSION;
 
     if (empty($file)) {
         echo "Error 404";
         return false;
     }
 
-    $lang = current_language();
+    if (!empty($SESSION->doclang)) {
+        $lang = $SESSION->doclang;
+    } else {
+        $lang = current_language();
+    }
+
     $file = clean_filename($file);
 
     $info->filepath = "$CFG->dirroot/lang/$lang/docs/$file";