Skip to content

Commit

Permalink
Merge branch 'MDL-37697-m' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Jan 28, 2013
2 parents 49c204d + c112bc6 commit 41f3d11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mod/forum/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,7 @@ function forum_subscribed_users($course, $forum, $groupid=0, $context = null, $f
*/
function forum_get_course_forum($courseid, $type) {
// How to set up special 1-per-course forums
global $CFG, $DB, $OUTPUT;
global $CFG, $DB, $OUTPUT, $USER;

if ($forums = $DB->get_records_select("forum", "course = ? AND type = ?", array($courseid, $type), "id ASC")) {
// There should always only be ONE, but with the right combination of
Expand All @@ -2965,6 +2965,9 @@ function forum_get_course_forum($courseid, $type) {
$forum = new stdClass();
$forum->course = $courseid;
$forum->type = "$type";
if (!empty($USER->htmleditor)) {
$forum->introformat = $USER->htmleditor;
}
switch ($forum->type) {
case "news":
$forum->name = get_string("namenews", "forum");
Expand Down

0 comments on commit 41f3d11

Please sign in to comment.