From a292bb9ea74ca57fa1077ea9a417f3bf2f8769e2 Mon Sep 17 00:00:00 2001 From: Peter Dias Date: Wed, 22 Sep 2021 10:57:24 +0800 Subject: [PATCH] MDL-72413 scorm: Use the common module for setting the header --- mod/scorm/report.php | 7 ++++--- mod/scorm/view.php | 12 ++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/mod/scorm/report.php b/mod/scorm/report.php index 8e4aeab26c7..a883fd0b6ad 100644 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -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. diff --git a/mod/scorm/view.php b/mod/scorm/view.php index f83ccef99f4..6728929ec93 100644 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -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'));