MDL-71161 mod_book: Display activity information output component

This commit is contained in:
Jun Pataleta 2021-03-25 16:34:11 +08:00
parent 8d38fc7eab
commit 6b46ce4c48

View File

@ -208,6 +208,12 @@ book_view($book, $chapter, $islastchapter, $course, $cm, $context);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($book->name));
// Render the activity information.
$cminfo = cm_info::create($cm);
$cmcompletion = \core_completion\cm_completion_details::get_instance($cminfo, $USER->id);
$activitydates = \core\activity_dates::get_dates_for_module($cminfo, $USER->id);
echo $OUTPUT->activity_information($cminfo, $cmcompletion, $activitydates);
// Info box.
if ($book->intro) {
echo $OUTPUT->box(format_module_intro('book', $book, $cm->id), 'generalbox', 'intro');