|
35 | 35 | global $CFG;
|
36 | 36 | require_once(dirname(__FILE__) . '/lib.php');
|
37 | 37 | require_once($CFG->libdir . '/portfoliolib.php');
|
38 |
| - |
| 38 | +require_once($CFG->dirroot.'/lib/portfolio/formats.php'); |
39 | 39 | /**
|
40 | 40 | * Get all discussions in a moodleoverflow instance.
|
41 | 41 | *
|
@@ -1160,7 +1160,6 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
|
1160 | 1160 | $post->course = $course->id;
|
1161 | 1161 | $post->moodleoverflow = $moodleoverflow->id;
|
1162 | 1162 | $mcid = $modulecontext->id;
|
1163 |
| - $post->message = file_rewrite_pluginfile_urls($post->message, 'pluginfile.php', $mcid, 'mod_moodleoverflow', 'post', $post->id); |
1164 | 1163 |
|
1165 | 1164 | // Check if the user has the capability to see posts.
|
1166 | 1165 | if (!moodleoverflow_user_can_see_post($moodleoverflow, $discussion, $post, $cm)) {
|
@@ -1450,8 +1449,12 @@ function moodleoverflow_print_post($post, $discussion, $moodleoverflow, $cm, $co
|
1450 | 1449 | $mustachedata->canreview = capabilities::has(capabilities::REVIEW_POST, $modulecontext);
|
1451 | 1450 | $mustachedata->withinreviewperiod = $reviewable;
|
1452 | 1451 |
|
1453 |
| - // Prepare the post. |
1454 |
| - $options = (array) portfolio_format_text_options() + ['context' => $modulecontext]; |
| 1452 | + // Prepare the post by formatting it's content. |
| 1453 | + $post->message = file_rewrite_pluginfile_urls($post->message, 'pluginfile.php', $mcid, 'mod_moodleoverflow', |
| 1454 | + 'post', $post->id, ['includetoken' => true]); |
| 1455 | + $options = new stdClass(); |
| 1456 | + $options->para = true; |
| 1457 | + $options->context = $modulecontext; |
1455 | 1458 | $mustachedata->postcontent = format_text($post->message, $post->messageformat, $options);
|
1456 | 1459 |
|
1457 | 1460 | // Load the attachments.
|
|
0 commit comments