From 6597e6b7aeed0e605972a24338e1a83a5d32b8d6 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 7 Feb 2010 12:58:25 +0000 Subject: [PATCH] MDL-20601 added missing covnersion of url placeholders --- course/format/topics/format.php | 7 +++++-- course/format/weeks/format.php | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/course/format/topics/format.php b/course/format/topics/format.php index 225278076b3..d3eb1ab2b52 100644 --- a/course/format/topics/format.php +++ b/course/format/topics/format.php @@ -222,9 +222,12 @@ while ($section <= $course->numsections) { echo get_string('notavailable').''; } else { echo '
'; - $summaryformatoptions->noclean = true; if ($thissection->summary) { - echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); + $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); + $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course_section', $thissection->id); + $summaryformatoptions = new object(); + $summaryformatoptions->noclean = true; + echo format_text($summarytext, FORMAT_HTML, $summaryformatoptions); } else { echo ' '; } diff --git a/course/format/weeks/format.php b/course/format/weeks/format.php index 085ba357f40..55f387bf6b0 100644 --- a/course/format/weeks/format.php +++ b/course/format/weeks/format.php @@ -216,8 +216,11 @@ echo $OUTPUT->heading($currenttext.$weekperiod, 3, 'weekdates'); echo '
'; + $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); + $summarytext = file_rewrite_pluginfile_urls($thissection->summary, 'pluginfile.php', $coursecontext->id, 'course_section', $thissection->id); + $summaryformatoptions = new object(); $summaryformatoptions->noclean = true; - echo format_text($thissection->summary, FORMAT_HTML, $summaryformatoptions); + echo format_text($summarytext, FORMAT_HTML, $summaryformatoptions); if ($PAGE->user_is_editing() && has_capability('moodle/course:update', get_context_instance(CONTEXT_COURSE, $course->id))) { echo ' '.