mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
MDL-65974 course: move format renderers to outputs
This commit is contained in:
parent
1c839f9072
commit
8e7dc42440
49 changed files with 3553 additions and 1958 deletions
|
@ -3420,12 +3420,15 @@ function mod_duplicate_activity($course, $cm, $sr = null) {
|
|||
|
||||
$resp = new stdClass();
|
||||
if ($newcm) {
|
||||
$courserenderer = $PAGE->get_renderer('core', 'course');
|
||||
$completioninfo = new completion_info($course);
|
||||
$modulehtml = $courserenderer->course_section_cm($course, $completioninfo,
|
||||
$newcm, null, array());
|
||||
|
||||
$resp->fullcontent = $courserenderer->course_section_cm_list_item($course, $completioninfo, $newcm, $sr);
|
||||
$format = course_get_format($course);
|
||||
$renderer = $format->get_renderer($PAGE);
|
||||
$modinfo = $format->get_modinfo();
|
||||
$section = $modinfo->get_section_info($newcm->sectionnum);
|
||||
|
||||
// Get the new element html content.
|
||||
$resp->fullcontent = $renderer->course_section_updated_cm_item($format, $section, $newcm);
|
||||
|
||||
$resp->cmid = $newcm->id;
|
||||
} else {
|
||||
// Trigger a redirect.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue