MDL-71161 mod_assign: show assign activity info

This commit is contained in:
Simey Lameze
2021-04-13 01:21:11 +08:00
committed by Jun Pataleta
parent bb5ed7d4af
commit 8d38fc7eab
+10
View File
@@ -226,6 +226,8 @@ class mod_assign_renderer extends plugin_renderer_base {
* @return string
*/
public function render_assign_header(assign_header $header) {
global $USER;
$o = '';
if ($header->subpage) {
@@ -244,6 +246,14 @@ class mod_assign_renderer extends plugin_renderer_base {
$o .= $this->output->header();
$o .= $this->output->heading($heading);
// Show the activity information output component.
$modinfo = get_fast_modinfo($header->assign->course);
$cm = $modinfo->get_cm($header->coursemoduleid);
$cmcompletion = \core_completion\cm_completion_details::get_instance($cm, $USER->id);
$activitydates = \core\activity_dates::get_dates_for_module($cm, $USER->id);
$o .= $this->output->activity_information($cm, $cmcompletion, $activitydates);
if ($header->preface) {
$o .= $header->preface;
}