mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
FIxes some course language problems
This commit is contained in:
parent
e1e88c7177
commit
0d1db48ee0
1 changed files with 14 additions and 0 deletions
|
@ -13,6 +13,13 @@
|
||||||
require_login(0, false); // Script is useless unless they're logged in
|
require_login(0, false); // Script is useless unless they're logged in
|
||||||
|
|
||||||
if ($post = data_submitted()) {
|
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)) {
|
if (empty($SESSION->fromurl)) {
|
||||||
$errordestination = "$CFG->wwwroot/mod/forum/view.php?f=$post->forum";
|
$errordestination = "$CFG->wwwroot/mod/forum/view.php?f=$post->forum";
|
||||||
|
@ -269,6 +276,13 @@
|
||||||
if (($post->userid <> $USER->id) and !isteacher($forum->course)) {
|
if (($post->userid <> $USER->id) and !isteacher($forum->course)) {
|
||||||
error("You can't delete other people's posts!");
|
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
|
if (isset($confirm)) { // User has confirmed the delete
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue