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
|
|
|
/**
|
2014-04-11 14:28:18 +08:00
|
|
|
* Definition of core event observers.
|
2010-08-03 08:07:49 +00:00
|
|
|
*
|
2014-04-11 14:28:18 +08:00
|
|
|
* The observers defined in this file are notified when respective events are triggered. All plugins
|
2012-04-01 22:48:17 +02:00
|
|
|
* support this.
|
|
|
|
*
|
|
|
|
* For more information, take a look to the documentation available:
|
2014-04-11 14:28:18 +08:00
|
|
|
* - Events API: {@link http://docs.moodle.org/dev/Event_2}
|
2012-04-01 22:48:17 +02:00
|
|
|
* - 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
|
|
|
|
2014-04-11 14:28:18 +08:00
|
|
|
// List of legacy event handlers.
|
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
|
|
|
$handlers = array(
|
2014-04-11 14:28:18 +08:00
|
|
|
// No more old events!
|
2008-07-24 08:38:03 +00:00
|
|
|
);
|
|
|
|
|
2014-04-11 14:28:18 +08:00
|
|
|
// List of events_2 observers.
|
|
|
|
|
2013-07-30 15:34:07 +08:00
|
|
|
$observers = array(
|
2007-05-14 09:30:56 +00:00
|
|
|
|
2013-07-30 15:34:07 +08:00
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\course_module_completion_updated',
|
|
|
|
'callback' => 'core_badges_observer::course_module_criteria_review',
|
2013-08-02 11:03:31 +08:00
|
|
|
),
|
2017-11-28 08:03:02 -05:00
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\badge_awarded',
|
|
|
|
'callback' => 'core_badges_observer::badge_criteria_review',
|
|
|
|
),
|
2013-08-02 11:03:31 +08:00
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\course_completed',
|
|
|
|
'callback' => 'core_badges_observer::course_criteria_review',
|
2013-08-19 17:03:39 +08:00
|
|
|
),
|
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\user_updated',
|
|
|
|
'callback' => 'core_badges_observer::profile_criteria_review',
|
2016-02-19 14:46:37 +08:00
|
|
|
),
|
2016-03-31 17:47:38 +13:00
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\cohort_member_added',
|
|
|
|
'callback' => 'core_badges_observer::cohort_criteria_review',
|
|
|
|
),
|
2019-01-17 11:35:57 +08:00
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\competency_evidence_created',
|
|
|
|
'callback' => 'core_badges_observer::competency_criteria_review',
|
|
|
|
),
|
2016-04-06 15:46:56 +08:00
|
|
|
// Competencies.
|
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\course_completed',
|
|
|
|
'callback' => 'core_competency\api::observe_course_completed',
|
|
|
|
),
|
|
|
|
array(
|
|
|
|
'eventname' => '\core\event\course_module_completion_updated',
|
|
|
|
'callback' => 'core_competency\api::observe_course_module_completion_updated',
|
|
|
|
),
|
2013-07-30 15:34:07 +08:00
|
|
|
);
|
2008-07-06 17:57:06 +00:00
|
|
|
|
2014-04-11 14:28:18 +08:00
|
|
|
// List of all events triggered by Moodle can be found using Events list report.
|