MDL-35814 improve confirmation when deleting enrol instances
This commit is contained in:
+5
-1
@@ -105,7 +105,11 @@ if ($canconfig and $action and confirm_sesskey()) {
|
||||
$yesurl = new moodle_url('/enrol/instances.php', array('id'=>$course->id, 'action'=>'delete', 'instance'=>$instance->id, 'confirm'=>1,'sesskey'=>sesskey()));
|
||||
$displayname = $plugin->get_instance_name($instance);
|
||||
$users = $DB->count_records('user_enrolments', array('enrolid'=>$instance->id));
|
||||
$message = get_string('deleteinstanceconfirm', 'enrol', array('name'=>$displayname, 'users'=>$users));
|
||||
if ($users) {
|
||||
$message = markdown_to_html(get_string('deleteinstanceconfirm', 'enrol', array('name'=>$displayname, 'users'=>$users)));
|
||||
} else {
|
||||
$message = markdown_to_html(get_string('deleteinstancenousersconfirm', 'enrol', array('name'=>$displayname)));
|
||||
}
|
||||
echo $OUTPUT->confirm($message, $yesurl, $PAGE->url);
|
||||
echo $OUTPUT->footer();
|
||||
die();
|
||||
|
||||
+4
-1
@@ -35,7 +35,10 @@ $string['configenrolplugins'] = 'Please select all required plugins and arrange
|
||||
$string['custominstancename'] = 'Custom instance name';
|
||||
$string['defaultenrol'] = 'Add instance to new courses';
|
||||
$string['defaultenrol_desc'] = 'It is possible to add this plugin to all new courses by default.';
|
||||
$string['deleteinstanceconfirm'] = 'Do you really want to delete enrol plugin instance "{$a->name}" with {$a->users} enrolled users?';
|
||||
$string['deleteinstanceconfirm'] = 'Do you really want to delete enrol plugin instance "{$a->name}"?
|
||||
|
||||
All {$a->users} users currently enrolled via this instance will be unenrolled and course-related data including users\' grades, group membership or forum subscriptions may be deleted.';
|
||||
$string['deleteinstancenousersconfirm'] = 'Do you really want to delete enrol plugin instance "{$a->name}"?';
|
||||
$string['durationdays'] = '{$a} days';
|
||||
$string['enrol'] = 'Enrol';
|
||||
$string['enrolcandidates'] = 'Not enrolled users';
|
||||
|
||||
Reference in New Issue
Block a user