Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed typo leading to bug 2723

  • Loading branch information...
commit 9fe1f87bbee57d9e34faf7801f28b292087480f1 1 parent 75aa6f4
gustav_delius authored
Showing with 30 additions and 30 deletions.
  1. +30 −30 mod/forum/post.php
60 mod/forum/post.php
View
@@ -48,7 +48,7 @@
$post->id = $post->edit;
if (forum_update_post($post)) {
- add_to_log($course->id, "forum", "update post",
+ add_to_log($course->id, "forum", "update post",
"discuss.php?d=$post->discussion&parent=$post->id", "$post->id", $cm->id);
$message = get_string("postupdated", "forum");
@@ -60,14 +60,14 @@
redirect(forum_go_back_to("discuss.php?d=$post->discussion#$post->id"), $message.$subscribemessage, $timemessage);
} else {
- error(get_string("couldnotupdate", "forum"), $errordestination);
+ error(get_string("couldnotupdate", "forum"), $errordestination);
}
exit;
} else if ($post->discussion) { // Adding a new post to an existing discussion
if ($post->id = forum_add_new_post($post)) {
- add_to_log($course->id, "forum", "add post",
+ add_to_log($course->id, "forum", "add post",
"discuss.php?d=$post->discussion&parent=$post->id", "$post->id", $cm->id);
$message = get_string("postadded", "forum", format_time($CFG->maxeditingtime));
@@ -80,7 +80,7 @@
redirect(forum_go_back_to("discuss.php?d=$post->discussion#$post->id"), $message.$subscribemessage, $timemessage);
} else {
- error(get_string("couldnotadd", "forum"), $errordestination);
+ error(get_string("couldnotadd", "forum"), $errordestination);
}
exit;
@@ -90,7 +90,7 @@
$discussion->intro = $post->message;
if ($discussion->id = forum_add_discussion($discussion)) {
- add_to_log($course->id, "forum", "add discussion",
+ add_to_log($course->id, "forum", "add discussion",
"discuss.php?d=$discussion->id", "$discussion->id", $cm->id);
$message = get_string("postadded", "forum", format_time($CFG->maxeditingtime));
@@ -103,7 +103,7 @@
redirect(forum_go_back_to("view.php?f=$post->forum"), $message.$subscribemessage, $timemessage);
} else {
- error(get_string("couldnotadd", "forum"), $errordestination);
+ error(get_string("couldnotadd", "forum"), $errordestination);
}
exit;
}
@@ -292,7 +292,7 @@
if (isset($confirm)) { // User has confirmed the delete
if ($post->totalscore) {
- notice(get_string("couldnotdeleteratings", "forum"),
+ notice(get_string("couldnotdeleteratings", "forum"),
forum_go_back_to("discuss.php?d=$post->discussion"));
} else if (record_exists("forum_posts", "parent", $delete)) {
@@ -305,23 +305,23 @@
}
if (! $post->parent) { // post is a discussion topic as well, so delete discussion
if ($forum->type == "single") {
- notice("Sorry, but you are not allowed to delete that discussion!",
+ notice("Sorry, but you are not allowed to delete that discussion!",
forum_go_back_to("discuss.php?d=$post->discussion"));
}
forum_delete_discussion($discussion);
- add_to_log($discussion->course, "forum", "delete discussion",
+ add_to_log($discussion->course, "forum", "delete discussion",
"view.php?id=$cm->id", "$forum->id", $cm->id);
- redirect("view.php?f=$discussion->forum",
+ redirect("view.php?f=$discussion->forum",
get_string("deleteddiscussion", "forum"), 1);
} else if (forum_delete_post($post)) {
- add_to_log($discussion->course, "forum", "delete post",
+ add_to_log($discussion->course, "forum", "delete post",
"discuss.php?d=$post->discussion", "$post->id", $cm->id);
- redirect(forum_go_back_to("discuss.php?d=$post->discussion"),
+ redirect(forum_go_back_to("discuss.php?d=$post->discussion"),
get_string("deletedpost", "forum"), 1);
} else {
error("An error occurred while deleting record $post->id");
@@ -334,10 +334,10 @@
forum_set_return();
print_header();
- notice_yesno(get_string("deletesure", "forum"),
+ notice_yesno(get_string("deletesure", "forum"),
"post.php?delete=$delete&confirm=$delete",
$_SERVER["HTTP_REFERER"]);
-
+
echo "<CENTER><HR>";
forum_print_post($post, $forum->course, $ownpost=false, $reply=false, $link=false);
}
@@ -346,7 +346,7 @@
} else if (isset($prune)) { // Teacher is pruning
-
+
if (! $post = forum_get_post_full($prune)) {
error("Post ID was incorrect");
}
@@ -364,7 +364,7 @@
}
if (isset($_REQUEST['name'])) { // User has confirmed the prune
-
+
$newdiscussion->course = $discussion->course;
$newdiscussion->forum = $discussion->forum;
$newdiscussion->name = $name;
@@ -373,11 +373,11 @@
$newdiscussion->groupid = $discussion->groupid;
$newdiscussion->assessed = $discussion->assessed;
$newdiscussion->usermodified = $post->userid;
-
+
if (!$newid = insert_record('forum_discussions', $newdiscussion)) {
error('Could not create new discussion');
}
-
+
$newpost->id = $post->id;
$newpost->parent = 0;
$newpost->subject = $name;
@@ -387,22 +387,22 @@
}
forum_change_discussionid($post->id, $newid);
-
+
// set timemodified to time of last post in each discussion
$lastpost = get_record_sql("SELECT MAX(modified) AS time
- FROM {$CFG->prefix}forum_posts
+ FROM {$CFG->prefix}forum_posts
WHERE discussion = '$discussion->id'");
set_field('forum_discussions', 'timemodified', $lastpost->time, 'id', $discussion->id);
$lastpost = get_record_sql("SELECT MAX(modified) AS time
- FROM {$CFG->prefix}forum_posts
+ FROM {$CFG->prefix}forum_posts
WHERE discussion = '$newid'");
- set_field('forum_discussions', 'timemodified', $lastpost->time, 'id', $newid);
+ set_field('forum_discussions', 'timemodified', $lastpost->time, 'id', $newid);
if (!$cm = get_coursemodule_from_instance("forum", $forum->id, $forum->course)) { // For the logs
$cm->id = 0;
}
- add_to_log($discussion->course, "forum", "prune post",
+ add_to_log($discussion->course, "forum", "prune post",
"discuss.php?d=$newid", "$post->id", $cm->id);
redirect(forum_go_back_to("discuss.php?d=$newid"), get_string("prunedpost", "forum"), 1);
@@ -412,16 +412,16 @@
$course = get_record('course', 'id', $forum->course);
$strforums = get_string("modulenameplural", "forum");
print_header_simple("$discussion->name: $post->subject", "",
- "<a href=\"../forum/index.php?id=$course->id\">$strforums</a> ->
- <a href=\"view.php?f=$forum->id\">$forum->name</a> ->
+ "<a href=\"../forum/index.php?id=$course->id\">$strforums</a> ->
+ <a href=\"view.php?f=$forum->id\">$forum->name</a> ->
<a href=\"discuss.php?d=$discussion->id\">$post->subject</a> -> ".
get_string("prune", "forum"), '', "", true, "", navmenu($course, $cm));
-
+
print_heading(get_string('pruneheading', 'forum'));
echo '<center>';
-
+
include('prune.html');
-
+
forum_print_post($post, $forum->course, $ownpost=false, $reply=false, $link=false);
}
@@ -434,7 +434,7 @@
}
- // To get here they need to edit a post, and the $post
+ // To get here they need to edit a post, and the $post
// variable will be loaded with all the particulars,
// so bring up the form.
@@ -491,7 +491,7 @@
if (!empty($parent)) {
forum_print_post($parent, $course->id, $ownpost=false, $reply=false, $link=false);
if (empty($post->edit)) {
- forum_print_posts_threaded($parent->id, $course, 0, false, false);
+ forum_print_posts_threaded($parent->id, $course->id, 0, false, false);
}
echo "<center>";
echo "<H2>".get_string("yourreply", "forum").":</H2>";
Please sign in to comment.
Something went wrong with that request. Please try again.