diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 09f0629cbd6..5baf85c05cd 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -656,40 +656,39 @@ function forum_make_mail_text($course, $forum, $discussion, $post, $userfrom, $u function forum_make_mail_html($course, $forum, $discussion, $post, $userfrom, $userto) { global $CFG; - if ($userto->mailformat == 1) { // HTML - - $strforums = get_string('forums', 'forum'); - $canreply = forum_user_can_post($forum, $userto); - $canunsubscribe = ! forum_is_forcesubscribed($forum->id); - - $posthtml = ''; - $posthtml .= '
'; - foreach ($CFG->stylesheets as $stylesheet) { - $posthtml .= ''."\n"; - } - $posthtml .= ''; - $posthtml .= "\n\n\n"; - - $posthtml .= "". - "wwwroot/course/view.php?id=$course->id\">$course->shortname » ". - "wwwroot/mod/forum/index.php?id=$course->id\">$strforums » ". - "wwwroot/mod/forum/view.php?f=$forum->id\">".format_string($forum->name,true).""; - if ($discussion->name == $forum->name) { - $posthtml .= "
"; - } else { - $posthtml .= " » wwwroot/mod/forum/discuss.php?d=$discussion->id\">".format_string($discussion->name,true).""; - } - $posthtml .= forum_make_mail_post($post, $userfrom, $userto, $course, false, $canreply, true, false); - - if ($canunsubscribe) { - $posthtml .= "\nwwwroot/mod/forum/subscribe.php?id=$forum->id\">".get_string("unsubscribe", "forum")."
"; - } - - return $posthtml; - - } else { + if ($userto->mailformat != 1) { // Needs to be HTML return ''; } + + $strforums = get_string('forums', 'forum'); + $canreply = forum_user_can_post($forum, $userto); + $canunsubscribe = ! forum_is_forcesubscribed($forum->id); + + $posthtml = ''; + foreach ($CFG->stylesheets as $stylesheet) { + $posthtml .= ''."\n"; + } + $posthtml .= ''; + $posthtml .= "\n\n\n"; + + $posthtml .= ''; + } else { + $posthtml .= ' » '. + format_string($discussion->name,true).''; + } + $posthtml .= forum_make_mail_post($post, $userfrom, $userto, $course, false, $canreply, true, false); + + if ($canunsubscribe) { + $posthtml .= '