2009-11-01 11:31:16 +00:00
|
|
|
<?php
|
2010-08-03 08:07:49 +00:00
|
|
|
// 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/>.
|
2007-05-14 09:30:56 +00:00
|
|
|
|
2010-08-03 08:07:49 +00:00
|
|
|
/**
|
2012-02-17 15:32:41 +13:00
|
|
|
* Definition of core event handler and description of all events throws from core.
|
2010-08-03 08:07:49 +00:00
|
|
|
*
|
2012-04-01 22:48:17 +02:00
|
|
|
* The handlers defined on this file are processed and registered into
|
|
|
|
* the Moodle DB after any install or upgrade operation. All plugins
|
|
|
|
* support this.
|
|
|
|
*
|
|
|
|
* For more information, take a look to the documentation available:
|
|
|
|
* - Events API: {@link http://docs.moodle.org/dev/Events_API}
|
|
|
|
* - Upgrade API: {@link http://docs.moodle.org/dev/Upgrade_API}
|
|
|
|
*
|
|
|
|
* @package core
|
|
|
|
* @category event
|
2012-01-17 13:50:58 +08:00
|
|
|
* @copyright 2007 onwards Martin Dougiamas http://dougiamas.com
|
2012-04-01 22:48:17 +02:00
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
2010-08-03 08:07:49 +00:00
|
|
|
*/
|
2007-05-14 09:30:56 +00:00
|
|
|
|
2010-08-03 08:07:49 +00:00
|
|
|
defined('MOODLE_INTERNAL') || die();
|
2008-07-06 17:57:06 +00:00
|
|
|
|
|
|
|
/* List of handlers */
|
|
|
|
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
$handlers = array(
|
2008-07-24 08:38:03 +00:00
|
|
|
|
2008-07-28 14:35:01 +00:00
|
|
|
/*
|
|
|
|
* portfolio queued event - for non interactive file transfers
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
* 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....
|
|
|
|
*/
|
2008-07-28 14:35:01 +00:00
|
|
|
'portfolio_send' => array (
|
|
|
|
'handlerfile' => '/lib/portfolio.php',
|
|
|
|
'handlerfunction' => 'portfolio_handle_event', // argument to call_user_func(), could be an array
|
2010-09-15 15:55:18 +00:00
|
|
|
'schedule' => 'cron',
|
|
|
|
'internal' => 0,
|
2008-07-28 14:35:01 +00:00
|
|
|
),
|
2008-07-24 08:38:03 +00:00
|
|
|
|
2008-07-28 14:35:01 +00:00
|
|
|
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
/* no more here please, core should not consume any events!!!!!!! */
|
2008-07-24 08:38:03 +00:00
|
|
|
);
|
|
|
|
|
2007-05-14 09:30:56 +00:00
|
|
|
|
2008-07-06 17:57:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* 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
|
2010-11-08 02:54:42 +00:00
|
|
|
user_logout - full $USER object
|
2008-07-06 17:57:06 +00:00
|
|
|
|
|
|
|
==== 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
|
2010-09-19 13:09:48 +00:00
|
|
|
course_content_removed - object course table record + context property
|
|
|
|
course_deleted - object course table record + context property
|
2008-07-06 17:57:06 +00:00
|
|
|
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
user_enrolled - object record from user_enrolments table + courseid,enrol
|
2011-10-23 20:02:31 +02:00
|
|
|
user_enrol_modified - object record from user_enrolments table + courseid,enrol
|
MDL-21782 reworked enrolment framework, the core infrastructure is in place, the basic plugins are all implemented; see the tracker issue for list of unfinished bits, expect more changes and improvements during the next week
AMOS START
MOV [sendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage,enrol_self]
MOV [configsendcoursewelcomemessage,core_admin],[sendcoursewelcomemessage_desc,enrol_self]
MOV [enrolstartdate,core],[enrolstartdate,enrol_self]
MOV [enrolenddate,core],[enrolenddate,enrol_self]
CPY [welcometocourse,core],[welcometocourse,enrol_self]
CPY [welcometocoursetext,core],[welcometocoursetext,enrol_self]
MOV [notenrollable,core],[notenrollable,core_enrol]
MOV [enrolenddaterror,core],[enrolenddaterror,enrol_self]
MOV [enrolmentkeyhint,core],[passwordinvalidhint,enrol_self]
MOV [coursemanager,core_admin],[coursecontact,core_admin]
MOV [configcoursemanager,core_admin],[coursecontact_desc,core_admin]
MOV [enrolledincourserole,core],[enrolledincourserole,enrol_manual]
MOV [enrolme,core],[enrolme,core_enrol]
MOV [unenrol,core],[unenrol,core_enrol]
MOV [unenrolme,core],[unenrolme,core_enrol]
MOV [enrolmentnew,core],[enrolmentnew,core_enrol]
MOV [enrolmentnewuser,core],[enrolmentnewuser,core_enrol]
MOV [enrolments,core],[enrolments,core_enrol]
MOV [enrolperiod,core],[enrolperiod,core_enrol]
MOV [unenrolroleusers,core],[unenrolroleusers,core_enrol]
AMOS END
2010-06-21 15:30:49 +00:00
|
|
|
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
|
|
|
|
|
2008-07-06 17:57:06 +00:00
|
|
|
==== 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
|
|
|
|
|
2008-07-06 22:54:46 +00:00
|
|
|
groups_members_removed - object courseid+userid - removed all users (or one user) from all groups in course
|
2008-07-06 17:57:06 +00:00
|
|
|
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
|
|
|
|
|
2010-05-20 07:59:13 +00:00
|
|
|
==== role related events ====
|
2008-07-06 19:30:12 +00:00
|
|
|
|
|
|
|
role_assigned - object role_assignments table record
|
|
|
|
role_unassigned - object role_assignments table record
|
|
|
|
|
2010-07-08 02:27:58 +00:00
|
|
|
==== activity module events ====
|
2010-03-22 02:56:45 +00:00
|
|
|
|
2010-07-08 02:27:58 +00:00
|
|
|
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
|
2010-03-22 02:56:45 +00:00
|
|
|
|
2008-07-06 17:57:06 +00:00
|
|
|
*/
|