MDL-65974 course: move format renderers to outputs

This commit is contained in:
Ferran Recio 2020-10-22 09:22:54 +02:00
parent 1c839f9072
commit 8e7dc42440
49 changed files with 3553 additions and 1958 deletions

View file

@ -652,13 +652,13 @@ class dndupload_ajax_processor {
$resp->error = self::ERROR_OK;
$resp->elementid = 'module-' . $mod->id;
$courserenderer = $PAGE->get_renderer('core', 'course');
$completioninfo = new completion_info($this->course);
$info = get_fast_modinfo($this->course);
$sr = null;
$modulehtml = $courserenderer->course_section_cm($this->course, $completioninfo,
$mod, null, array());
$resp->fullcontent = $courserenderer->course_section_cm_list_item($this->course, $completioninfo, $mod, $sr);
$format = course_get_format($this->course);
$renderer = $format->get_renderer($PAGE);
$modinfo = $format->get_modinfo();
$section = $modinfo->get_section_info($mod->sectionnum);
// Get the new element html content.
$resp->fullcontent = $renderer->course_section_updated_cm_item($format, $section, $mod);
echo $OUTPUT->header();
echo json_encode($resp);