Skip to content

Commit

Permalink
MDL-72413 lti: Use the common module for setting the header
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Dias committed Dec 13, 2021
1 parent b79bbcb commit 65ae3c1
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions mod/lti/view.php
Expand Up @@ -106,25 +106,17 @@
$PAGE->set_title($pagetitle);
$PAGE->set_heading($course->fullname);

// Print the page header.
echo $OUTPUT->header();

if ($lti->showtitlelaunch) {
// Print the main part of the page.
if (!$PAGE->has_secondary_navigation()) {
echo $OUTPUT->heading(format_string($lti->name, true, array('context' => $context)));
}
$activityheader = $PAGE->activityheader;
if (!$lti->showtitlelaunch) {
$header['title'] = '';
}

// 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 ($lti->showdescriptionlaunch && $lti->intro) {
echo $OUTPUT->box(format_module_intro('lti', $lti, $cm->id), 'generalbox description', 'intro');
if (!$lti->showdescriptionlaunch) {
$header['description'] = '';
}
$activityheader->set_attrs($header ?? []);

// Print the page header.
echo $OUTPUT->header();

if ($typeid) {
$config = lti_get_type_type_config($typeid);
Expand Down

0 comments on commit 65ae3c1

Please sign in to comment.