]> git.mjollnir.org Git - moodle.git/commitdiff
FIxes some course language problems
authormoodler <moodler>
Tue, 13 Jul 2004 14:11:17 +0000 (14:11 +0000)
committermoodler <moodler>
Tue, 13 Jul 2004 14:11:17 +0000 (14:11 +0000)
mod/forum/post.php

index a7c2adff09a285ed952de5c7605421b3ef48a487..4a14f3836282b25cb8ff33a32f6feb0ecad2dabf 100644 (file)
     require_login(0, false);   // Script is useless unless they're logged in
 
     if ($post = data_submitted()) {
+        if (!empty($post->course)) {
+            if ($course = get_record('course', 'id', $post->course)) {
+                if (!empty($course->lang)) {
+                    $CFG->courselang = $course->lang;
+                }
+            }
+        }
 
         if (empty($SESSION->fromurl)) {
             $errordestination = "$CFG->wwwroot/mod/forum/view.php?f=$post->forum";
         if (($post->userid <> $USER->id) and !isteacher($forum->course)) {
             error("You can't delete other people's posts!");
         }
+        if (!empty($forum->course)) {
+            if ($course = get_record('course', 'id', $forum->course)) {
+                if (!empty($course->lang)) {
+                    $CFG->courselang = $course->lang;
+                }
+            }
+        }
 
         if (isset($confirm)) {    // User has confirmed the delete