MDL-72413 folder: Use the common module for setting the header

This commit is contained in:
Peter Dias 2021-09-21 16:16:18 +08:00
parent 7e5b0f6289
commit 93782ecdb9
2 changed files with 1 additions and 15 deletions

View File

@ -47,10 +47,7 @@ class mod_folder_renderer extends plugin_renderer_base {
}
if (trim($folder->intro)) {
if ($folder->display != FOLDER_DISPLAY_INLINE) {
$output .= $this->output->box(format_module_intro('folder', $folder, $cm->id),
'generalbox', 'intro');
} else if ($cm->showdescription) {
if ($folder->display == FOLDER_DISPLAY_INLINE && $cm->showdescription) {
// for "display inline" do not filter, filters run at display time.
$output .= format_module_intro('folder', $folder, $cm->id, false);
}

View File

@ -69,21 +69,10 @@ $PAGE->set_title($course->shortname.': '.$folder->name);
$PAGE->set_heading($course->fullname);
$PAGE->set_activity_record($folder);
$output = $PAGE->get_renderer('mod_folder');
echo $output->header();
if (!$PAGE->has_secondary_navigation()) {
echo $output->heading(format_string($folder->name), 2);
}
// Render the activity information.
$cminfo = cm_info::create($cm);
$completiondetails = \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, $completiondetails, $activitydates);
echo $output->display_folder($folder);
echo $output->footer();