MDL-37717 warn teachers before disabling or deleting their enrolment method
[moodle.git] / enrol / manual / edit_form.php
index 834aee7..bfc09a7 100644 (file)
@@ -65,6 +65,10 @@ class enrol_manual_edit_form extends moodleform {
         $mform->addElement('hidden', 'courseid');
         $mform->setType('courseid', PARAM_INT);
 
+        if (enrol_accessing_via_instance($instance)) {
+            $mform->addElement('static', 'selfwarn', get_string('instanceeditselfwarning', 'core_enrol'), get_string('instanceeditselfwarningtext', 'core_enrol'));
+        }
+
         $this->add_action_buttons(true, ($instance->id ? null : get_string('addinstance', 'enrol')));
 
         $this->set_data($instance);