MDL-76069 enrol_manual: Fix missing breadcrumbs

This commit is contained in:
Mihail Geshoski 2022-10-27 21:56:18 +08:00
parent 046e48c49c
commit 1057a1a625
2 changed files with 8 additions and 5 deletions

View File

@ -54,6 +54,7 @@ $string['expirymessageenrolledbody'] = 'Dear {$a->user},
This is a notification that your enrolment in the course \'{$a->course}\' is due to expire on {$a->timeend}.
If you need help, please contact {$a->enroller}.';
$string['managemanualenrolements'] = 'Manage manual enrolments';
$string['manual:config'] = 'Configure manual enrol instances';
$string['manual:enrol'] = 'Enrol users';
$string['manual:manage'] = 'Manage user enrolments';

View File

@ -63,13 +63,15 @@ if (!$enrol_manual = enrol_get_plugin('manual')) {
throw new coding_exception('Can not instantiate enrol_manual');
}
$instancename = $enrol_manual->get_instance_name($instance);
$url = new moodle_url('/enrol/manual/manage.php', ['enrolid' => $instance->id]);
$title = get_string('managemanualenrolements', 'enrol_manual');
$PAGE->set_url('/enrol/manual/manage.php', array('enrolid'=>$instance->id));
$PAGE->set_url($url);
$PAGE->set_pagelayout('admin');
$PAGE->set_title($enrol_manual->get_instance_name($instance));
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
navigation_node::override_active_url(new moodle_url('/user/index.php', array('id'=>$course->id)));
navigation_node::override_active_url(new moodle_url('/enrol/instances.php', ['id' => $course->id]));
$PAGE->navbar->add($title, $url);
// Create the user selector objects.
$options = array('enrolid' => $enrolid, 'accesscontext' => $context);
@ -168,7 +170,7 @@ if ($canunenrol && optional_param('remove', false, PARAM_BOOL) && confirm_sesske
echo $OUTPUT->header();
echo $OUTPUT->heading($instancename);
echo $OUTPUT->heading($title);
$addenabled = $canenrol ? '' : 'disabled="disabled"';
$removeenabled = $canunenrol ? '' : 'disabled="disabled"';