events.php 4.14 KB
Newer Older
1
<?php
moodler's avatar
moodler committed
2

3
4
5
6
7
8
9
10
11
12
13
14
15
16
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
moodler's avatar
moodler committed
17

18
19
20
21
22
23
24
25
26
/**
 * Definition of core event handler
 * and description of all events throws from core.
 *
 * @package    core
 * @subpackage event
 * @copyright  2007 onwards Martin Dougiamas  http://dougiamas.com
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
moodler's avatar
moodler committed
27

28
defined('MOODLE_INTERNAL') || die();
29
30
31

/* List of handlers */

32
$handlers = array(
33

34
35
/*
 * portfolio queued event - for non interactive file transfers
36
37
38
39
40
 * NOTE: this is a HACK, please do not add any more things like this here
 *       (it is just abusing cron to do very time consuming things which is wrong any way)
 *
 * TODO: this has to be moved into separate queueing framework....
 */
41
42
43
    'portfolio_send' => array (
        'handlerfile'      => '/lib/portfolio.php',
        'handlerfunction'  => 'portfolio_handle_event',    // argument to call_user_func(), could be an array
44
45
        'schedule'         => 'cron',
        'internal'         => 0,
46
    ),
47

48

49
/* no more here please, core should not consume any events!!!!!!! */
50
51
);

moodler's avatar
moodler committed
52

53
54
55
56
57
58
59
60
61


/* List of events thrown from Moodle core

==== user related events ====

user_created - object user table record
user_updated - object user table record
user_deleted - object user table record
62
user_logout - full $USER object
63
64
65
66
67
68
69
70
71

==== course related events ====

course_category_updated - object course_categories table record
course_category_created - object course_categories table record
course_category_deleted - object course_categories table record

course_created - object course table record
course_updated - object course table record
72
73
course_content_removed - object course table record + context property
course_deleted - object course table record + context property
74

75
user_enrolled - object record from user_enrolments table + courseid,enrol
76
user_enrol_modified - object record from user_enrolments table + courseid,enrol
77
78
79
80
81
82
83
84
85
86
87
88
user_unenrolled - object record from user_enrolments table + courseid,enrol,lastenrol

==== cohort related events ===


cohort_added - object cohort table record
cohort_updated - object cohort table record
cohort_deleted - object cohort table record

cohort_member_added - object cohortid, userid properties
cohort_member_removed - object cohortid, userid properties

89
90
91
92
93
94
95
96
97
98
99
100
101
==== group related events ====

groups_group_created - object groups_group table record
groups_group_updated - object groups_group table record
groups_group_deleted - object groups_group table record

groups_member_added   - object userid, groupid properties
groups_member_removed - object userid, groupid properties

groups_grouping_created - object groups_grouping table record
groups_grouping_updated - object groups_grouping table record
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
104
105
106
groups_groupings_groups_removed - int course id - removed all groups from all groupings in course
groups_groups_deleted           - int course id - deleted all course groups
groups_groupings_deleted        - int course id - deleted all course groupings

107
==== role related events ====
108
109
110
111

role_assigned         - object role_assignments table record
role_unassigned       - object role_assignments table record

112
==== activity module events ====
113

114
115
116
mod_deleted - int courseid, int cmid, text modulename - happens when a module is deleted
mod_created - int courseid, int cmid, text modulename - happens when a module is created
mod_updated - int courseid, int cmid, text modulename - happens when a module is updated
117

118
*/