diff --git a/blocks/completionstatus/details.php b/blocks/completionstatus/details.php index f8e237e9b66..dedcde42d97 100644 --- a/blocks/completionstatus/details.php +++ b/blocks/completionstatus/details.php @@ -41,7 +41,7 @@ if ($userid) { } // Check permissions. -require_login(); +require_login($course); if (!completion_can_view_data($user->id, $course)) { throw new \moodle_exception('cannotviewreport'); @@ -66,10 +66,6 @@ if (!$info->is_tracked_user($user->id)) { } } -// Display page. - -$PAGE->set_context(context_course::instance($course->id)); - // Print header. $page = get_string('completionprogressdetails', 'block_completionstatus'); $title = format_string($course->fullname) . ': ' . $page; @@ -256,8 +252,5 @@ if (empty($completions)) { echo html_writer::end_tag('tbody'); echo html_writer::end_tag('table'); } -$courseurl = new moodle_url("/course/view.php", array('id' => $course->id)); -echo html_writer::start_tag('div', array('class' => 'buttons')); -echo $OUTPUT->single_button($courseurl, get_string('returntocourse', 'block_completionstatus'), 'get'); -echo html_writer::end_tag('div'); + echo $OUTPUT->footer();