MDL-37697 Use the user selected editor format for new course forums

This commit is contained in:
Andrew Robert Nicols 2013-01-25 12:24:21 +00:00
parent 913084399a
commit f4b106ee59

View file

@ -2956,7 +2956,7 @@ function forum_subscribed_users($course, $forum, $groupid=0, $context = null, $f
*/ */
function forum_get_course_forum($courseid, $type) { function forum_get_course_forum($courseid, $type) {
// How to set up special 1-per-course forums // 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")) { 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 // There should always only be ONE, but with the right combination of
@ -2970,6 +2970,9 @@ function forum_get_course_forum($courseid, $type) {
$forum = new stdClass(); $forum = new stdClass();
$forum->course = $courseid; $forum->course = $courseid;
$forum->type = "$type"; $forum->type = "$type";
if (!empty($USER->htmleditor)) {
$forum->introformat = $USER->htmleditor;
}
switch ($forum->type) { switch ($forum->type) {
case "news": case "news":
$forum->name = get_string("namenews", "forum"); $forum->name = get_string("namenews", "forum");