From: moodler Date: Tue, 13 Jul 2004 14:11:17 +0000 (+0000) Subject: FIxes some course language problems X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0d1db48ee0f01cfb5b8aa5185e7c7a1ce4bb0324;p=moodle.git FIxes some course language problems --- diff --git a/mod/forum/post.php b/mod/forum/post.php index a7c2adff09..4a14f38362 100644 --- a/mod/forum/post.php +++ b/mod/forum/post.php @@ -13,6 +13,13 @@ 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"; @@ -269,6 +276,13 @@ 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