mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-9983, adding triggers for certain events, no handler implemented
This commit is contained in:
parent
52bb13dc9f
commit
e513826187
@ -87,6 +87,9 @@
|
||||
fix_course_sortorder($category->id);
|
||||
}
|
||||
}
|
||||
|
||||
// MDL-9983
|
||||
events_trigger('category_updated', $category);
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,6 +71,9 @@
|
||||
delete_course($course->id);
|
||||
fix_course_sortorder(); //update course count in catagories
|
||||
|
||||
// MDL-9983
|
||||
events_trigger('course_deleted', $course);
|
||||
|
||||
print_heading( get_string("deletedcourse", "", format_string($course->shortname)) );
|
||||
|
||||
print_continue("category.php?id=$course->category");
|
||||
|
@ -106,11 +106,12 @@
|
||||
redirect($CFG->wwwroot."/$CFG->admin/roles/assign.php?contextid=$context->id");
|
||||
}
|
||||
|
||||
} else {
|
||||
} else {
|
||||
if (!update_course($data)) {
|
||||
print_error('coursenotupdated');
|
||||
}
|
||||
|
||||
// MDL-9983
|
||||
events_trigger('course_updated', $data);
|
||||
redirect($CFG->wwwroot."/course/view.php?id=$course->id");
|
||||
}
|
||||
}
|
||||
|
@ -149,7 +149,9 @@
|
||||
/// Finally delete the category itself
|
||||
if (delete_records('course_categories', 'id', $deletecat->id)) {
|
||||
notify(get_string('categorydeleted', '', format_string($deletecat->name)));
|
||||
}
|
||||
// MLD-9983
|
||||
events_trigger('category_deleted', $deletecat);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$strdeletecategorycheck = get_string('deletecategorycheck','', format_string($deletecat->name));
|
||||
|
@ -67,6 +67,12 @@ if ($success) {
|
||||
if (! $success) {
|
||||
print_error('erroraddremoveuser', 'group', groups_home_url($courseid));
|
||||
}
|
||||
|
||||
// MDL-9983
|
||||
$eventdata = new object();
|
||||
$eventdata -> groupid = $groupid;
|
||||
$eventdata -> userid = $userid;
|
||||
events_trigger('group_user_removed', $eventdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +83,8 @@ if ($delete) {
|
||||
error('Sesskey error');
|
||||
}
|
||||
if (groups_delete_group($id)) {
|
||||
// MDL-9983
|
||||
events_trigger('group_deleted', $id);
|
||||
redirect(groups_home_url($course->id, null, $groupingid, false));
|
||||
} else {
|
||||
print_error('erroreditgroup', 'group', groups_home_url($course->id));
|
||||
@ -108,8 +110,12 @@ if ($editform->is_cancelled()) {
|
||||
$data->id = $id;
|
||||
if ($groupingid) {
|
||||
$success = $success && groups_add_group_to_grouping($id, $groupingid);
|
||||
}
|
||||
}
|
||||
}
|
||||
// MDL-9983
|
||||
if ($success) {
|
||||
events_trigger('group_created', $data);
|
||||
}
|
||||
}
|
||||
} elseif ($groupingid != $newgrouping) { // Moving group to new grouping
|
||||
$success = $success && groups_remove_group_from_grouping($id, $groupingid);
|
||||
$success = $success && groups_add_group_to_grouping($id, $newgrouping);
|
||||
@ -121,6 +127,10 @@ if ($editform->is_cancelled()) {
|
||||
} elseif (!groups_update_group($data, $course->id)) {
|
||||
print_error('groupnotupdated');
|
||||
}
|
||||
// MDL-9983
|
||||
if ($success) {
|
||||
events_trigger('group_updated', $data);
|
||||
}
|
||||
}
|
||||
// Handle file upload
|
||||
if ($success) {
|
||||
|
@ -346,6 +346,12 @@ function groups_add_member($groupid, $userid) {
|
||||
$useradded = groups_db_add_member($groupid, $userid);
|
||||
}
|
||||
if ($useradded) {
|
||||
|
||||
// MDL-9983
|
||||
$eventdata = new object();
|
||||
$eventdata -> groupid = $groupid;
|
||||
$eventdata -> userid = $userid;
|
||||
events_trigger('group_user_added', $eventdata);
|
||||
$useradded = groups_db_set_group_modified($groupid);
|
||||
}
|
||||
return $useradded;
|
||||
|
@ -113,6 +113,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
// MDL-9983
|
||||
$eventdata = new object();
|
||||
$eventdata -> user = $USER;
|
||||
$eventdata -> newpassword = $data -> newpassword1;
|
||||
events_trigger('password_changed', $eventdata);
|
||||
|
||||
redirect("$CFG->wwwroot/user/view.php?id=$user->id&course=$course->id");
|
||||
}
|
||||
|
||||
|
@ -100,6 +100,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// MDL-9983
|
||||
events_trigger('user_updated', $usernew);
|
||||
}
|
||||
|
||||
//update preferences
|
||||
|
Loading…
x
Reference in New Issue
Block a user