MDL-60811 enrol_self: Add bulk action for self enrollment on users page

This commit is contained in:
Farhan Karmali
2018-04-03 19:29:44 +05:30
parent 39fab18e27
commit ebaf979c94
8 changed files with 360 additions and 0 deletions
+19
View File
@@ -694,6 +694,25 @@ class enrol_self_plugin extends enrol_plugin {
return $options;
}
/**
* The self enrollment plugin has several bulk operations that can be performed.
* @param course_enrolment_manager $manager
* @return array
*/
public function get_bulk_operations(course_enrolment_manager $manager) {
global $CFG;
require_once($CFG->dirroot.'/enrol/self/locallib.php');
$context = $manager->get_context();
$bulkoperations = array();
if (has_capability("enrol/self:manage", $context)) {
$bulkoperations['editselectedusers'] = new enrol_self_editselectedusers_operation($manager, $this);
}
if (has_capability("enrol/self:unenrol", $context)) {
$bulkoperations['deleteselectedusers'] = new enrol_self_deleteselectedusers_operation($manager, $this);
}
return $bulkoperations;
}
/**
* Add elements to the edit instance form.
*