mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 16:32:18 +02:00
MDL-58365 block_myoverview: Show course summary in plain text
Part of MDL-55611 epic.
This commit is contained in:
parent
c755cb354c
commit
aac4653365
@ -57,14 +57,16 @@ class course_summary implements renderable, templatable {
|
||||
* Export this data so it can be used as the context for a mustache template.
|
||||
*
|
||||
* @param \renderer_base $output
|
||||
* @return stdClass
|
||||
* @return array
|
||||
*/
|
||||
public function export_for_template(renderer_base $output) {
|
||||
|
||||
$data = [];
|
||||
foreach ($this->courses as $courseid => $value) {
|
||||
foreach ($this->courses as $courseid => $course) {
|
||||
$context = \context_course::instance($courseid);
|
||||
$exporter = new course_summary_exporter($this->courses[$courseid], array('context' => $context));
|
||||
// Convert summary to plain text.
|
||||
$course->summary = content_to_text($course->summary, false);
|
||||
$exporter = new course_summary_exporter($course, array('context' => $context));
|
||||
$exportedcourse = $exporter->export($output);
|
||||
|
||||
if (isset($this->coursesprogress[$courseid])) {
|
||||
|
@ -77,6 +77,8 @@ class courses_view implements renderable, templatable {
|
||||
$enddate = $course->enddate;
|
||||
$courseid = $course->id;
|
||||
$context = \context_course::instance($courseid);
|
||||
// Convert summary to plain text.
|
||||
$course->summary = content_to_text($course->summary, false);
|
||||
$exporter = new course_summary_exporter($course, [
|
||||
'context' => $context
|
||||
]);
|
||||
|
@ -56,6 +56,6 @@
|
||||
{{/enddate}}
|
||||
</p>
|
||||
<p class="text-muted">
|
||||
{{#shortentext}} 140, {{{summary}}}{{/shortentext}}
|
||||
{{#shortentext}} 140, {{summary}}{{/shortentext}}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -54,7 +54,7 @@
|
||||
{{/enddate}}
|
||||
</p>
|
||||
<p class="text-muted">
|
||||
{{#shortentext}} 140, {{{summary}}}{{/shortentext}}
|
||||
{{#shortentext}} 140, {{summary}}{{/shortentext}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user