1 |
efrain |
1 |
<?php
|
|
|
2 |
// This file is part of Moodle - http://moodle.org/
|
|
|
3 |
//
|
|
|
4 |
// Moodle is free software: you can redistribute it and/or modify
|
|
|
5 |
// it under the terms of the GNU General Public License as published by
|
|
|
6 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
7 |
// (at your option) any later version.
|
|
|
8 |
//
|
|
|
9 |
// Moodle is distributed in the hope that it will be useful,
|
|
|
10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
12 |
// GNU General Public License for more details.
|
|
|
13 |
//
|
|
|
14 |
// You should have received a copy of the GNU General Public License
|
|
|
15 |
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* Hook listener callbacks.
|
|
|
19 |
*
|
|
|
20 |
* @package core
|
|
|
21 |
* @copyright 2023 Safat Shahin <safat.shahin@moodle.com>
|
|
|
22 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
23 |
*/
|
|
|
24 |
|
|
|
25 |
defined('MOODLE_INTERNAL') || die();
|
|
|
26 |
|
|
|
27 |
$callbacks = [
|
|
|
28 |
[
|
|
|
29 |
'hook' => \core_group\hook\after_group_created::class,
|
|
|
30 |
'callback' => \core_communication\hook_listener::class . '::create_group_communication',
|
|
|
31 |
],
|
|
|
32 |
[
|
|
|
33 |
'hook' => \core_group\hook\after_group_updated::class,
|
|
|
34 |
'callback' => \core_communication\hook_listener::class . '::update_group_communication',
|
|
|
35 |
],
|
|
|
36 |
[
|
|
|
37 |
'hook' => \core_group\hook\after_group_deleted::class,
|
|
|
38 |
'callback' => \core_communication\hook_listener::class . '::delete_group_communication',
|
|
|
39 |
],
|
|
|
40 |
[
|
|
|
41 |
'hook' => \core_group\hook\after_group_membership_added::class,
|
|
|
42 |
'callback' => \core_communication\hook_listener::class . '::add_members_to_group_room',
|
|
|
43 |
],
|
|
|
44 |
[
|
|
|
45 |
'hook' => \core_group\hook\after_group_membership_removed::class,
|
|
|
46 |
'callback' => \core_communication\hook_listener::class . '::remove_members_from_group_room',
|
|
|
47 |
],
|
|
|
48 |
[
|
|
|
49 |
'hook' => \core_course\hook\after_course_created::class,
|
|
|
50 |
'callback' => \core_communication\hook_listener::class . '::create_course_communication',
|
|
|
51 |
],
|
|
|
52 |
[
|
|
|
53 |
'hook' => \core_course\hook\after_course_updated::class,
|
|
|
54 |
'callback' => \core_communication\hook_listener::class . '::update_course_communication',
|
|
|
55 |
],
|
|
|
56 |
[
|
|
|
57 |
'hook' => \core_course\hook\before_course_deleted::class,
|
|
|
58 |
'callback' => \core_communication\hook_listener::class . '::delete_course_communication',
|
|
|
59 |
],
|
|
|
60 |
[
|
|
|
61 |
'hook' => \core_user\hook\before_user_updated::class,
|
|
|
62 |
'callback' => \core_communication\hook_listener::class . '::update_user_room_memberships',
|
|
|
63 |
],
|
|
|
64 |
[
|
|
|
65 |
'hook' => \core_user\hook\before_user_deleted::class,
|
|
|
66 |
'callback' => \core_communication\hook_listener::class . '::delete_user_room_memberships',
|
|
|
67 |
],
|
|
|
68 |
[
|
|
|
69 |
'hook' => \core\hook\access\after_role_assigned::class,
|
|
|
70 |
'callback' => \core_communication\hook_listener::class . '::update_user_membership_for_role_changes',
|
|
|
71 |
],
|
|
|
72 |
[
|
|
|
73 |
'hook' => \core\hook\access\after_role_unassigned::class,
|
|
|
74 |
'callback' => \core_communication\hook_listener::class . '::update_user_membership_for_role_changes',
|
|
|
75 |
],
|
|
|
76 |
[
|
|
|
77 |
'hook' => \core_enrol\hook\after_enrol_instance_status_updated::class,
|
|
|
78 |
'callback' => \core_communication\hook_listener::class . '::update_communication_memberships_for_enrol_status_change',
|
|
|
79 |
],
|
|
|
80 |
[
|
|
|
81 |
'hook' => \core_enrol\hook\before_enrol_instance_deleted::class,
|
|
|
82 |
'callback' => \core_communication\hook_listener::class . '::remove_communication_memberships_for_enrol_instance_deletion',
|
|
|
83 |
],
|
|
|
84 |
[
|
|
|
85 |
'hook' => \core_enrol\hook\after_user_enrolled::class,
|
|
|
86 |
'callback' => \core_communication\hook_listener::class . '::add_communication_membership_for_enrolled_user',
|
|
|
87 |
],
|
|
|
88 |
[
|
|
|
89 |
'hook' => \core_enrol\hook\before_user_enrolment_updated::class,
|
|
|
90 |
'callback' => \core_communication\hook_listener::class . '::update_communication_membership_for_updated_user_enrolment',
|
|
|
91 |
],
|
|
|
92 |
[
|
|
|
93 |
'hook' => \core_enrol\hook\before_user_enrolment_removed::class,
|
|
|
94 |
'callback' => \core_communication\hook_listener::class . '::remove_communication_membership_for_unenrolled_user',
|
|
|
95 |
],
|
|
|
96 |
[
|
|
|
97 |
'hook' => \core\hook\output\before_standard_footer_html_generation::class,
|
|
|
98 |
'callback' => \core_userfeedback::class . '::before_standard_footer_html_generation',
|
|
|
99 |
],
|
|
|
100 |
[
|
|
|
101 |
'hook' => \core\hook\output\after_standard_main_region_html_generation::class,
|
|
|
102 |
'callback' => \core_message\hook_callbacks::class . '::add_messaging_widget',
|
|
|
103 |
'priority' => 0,
|
|
|
104 |
],
|
|
|
105 |
[
|
|
|
106 |
'hook' => \core\hook\task\after_failed_task_max_delay::class,
|
|
|
107 |
'callback' => core\task\failed_task_callbacks::class . '::send_failed_task_max_delay_message',
|
|
|
108 |
],
|
|
|
109 |
];
|