3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * Definition of core event handler
20 * and description of all events throws from core.
24 * @copyright 2007 onwards Martin Dougiamas http://dougiamas.com
25 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28 defined('MOODLE_INTERNAL') || die();
30 /* List of handlers */
35 * portfolio queued event - for non interactive file transfers
36 * NOTE: this is a HACK, please do not add any more things like this here
37 * (it is just abusing cron to do very time consuming things which is wrong any way)
39 * TODO: this has to be moved into separate queueing framework....
41 'portfolio_send' => array (
42 'handlerfile' => '/lib/portfolio.php',
43 'handlerfunction' => 'portfolio_handle_event', // argument to call_user_func(), could be an array
49 /* no more here please, core should not consume any events!!!!!!! */
55 /* List of events thrown from Moodle core
57 ==== user related events ====
59 user_created - object user table record
60 user_updated - object user table record
61 user_deleted - object user table record
62 user_logout - full $USER object
64 ==== course related events ====
66 course_category_updated - object course_categories table record
67 course_category_created - object course_categories table record
68 course_category_deleted - object course_categories table record
70 course_created - object course table record
71 course_updated - object course table record
72 course_content_removed - object course table record + context property
73 course_deleted - object course table record + context property
75 user_enrolled - object record from user_enrolments table + courseid,enrol
76 user_enrol_modified - object record from user_enrolments table + courseid,enrol
77 user_unenrolled - object record from user_enrolments table + courseid,enrol,lastenrol
79 ==== cohort related events ===
82 cohort_added - object cohort table record
83 cohort_updated - object cohort table record
84 cohort_deleted - object cohort table record
86 cohort_member_added - object cohortid, userid properties
87 cohort_member_removed - object cohortid, userid properties
89 ==== group related events ====
91 groups_group_created - object groups_group table record
92 groups_group_updated - object groups_group table record
93 groups_group_deleted - object groups_group table record
95 groups_member_added - object userid, groupid properties
96 groups_member_removed - object userid, groupid properties
98 groups_grouping_created - object groups_grouping table record
99 groups_grouping_updated - object groups_grouping table record
100 groups_grouping_deleted - object groups_grouping table record
102 groups_members_removed - object courseid+userid - removed all users (or one user) from all groups in course
103 groups_groupings_groups_removed - int course id - removed all groups from all groupings in course
104 groups_groups_deleted - int course id - deleted all course groups
105 groups_groupings_deleted - int course id - deleted all course groupings
107 ==== role related events ====
109 role_assigned - object role_assignments table record
110 role_unassigned - object role_assignments table record
112 ==== activity module events ====
114 mod_deleted - int courseid, int cmid, text modulename - happens when a module is deleted
115 mod_created - int courseid, int cmid, text modulename - happens when a module is created
116 mod_updated - int courseid, int cmid, text modulename - happens when a module is updated