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

This commit is contained in:
Peter Dias 2021-09-22 10:57:24 +08:00
parent 94886e96e7
commit a292bb9ea7
2 changed files with 6 additions and 13 deletions

View File

@ -86,12 +86,13 @@ if (empty($noheader)) {
$PAGE->set_title("$course->shortname: ".format_string($scorm->name));
$PAGE->set_heading($course->fullname);
$PAGE->activityheader->set_attrs([
'hidecompletion' => true,
'description' => ''
]);
$PAGE->navbar->add($strreport, new moodle_url('/mod/scorm/report.php', array('id' => $cm->id)));
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($scorm->name));
}
}
// Open the selected Scorm report and display it.

View File

@ -136,17 +136,9 @@ if (empty($preventskip) && empty($launch) && (has_capability('mod/scorm:skipview
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);
// Let the module handle the display.
$PAGE->activityheader->set_description('');
echo $OUTPUT->header();
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($scorm->name));
}
// Display any activity information (eg completion requirements / dates).
$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);
if (!empty($action) && confirm_sesskey() && has_capability('mod/scorm:deleteownresponses', $contextmodule)) {
if ($action == 'delete') {
$confirmurl = new moodle_url($PAGE->url, array('action' => 'deleteconfirm'));