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 |
* Defines message providers (types of messages being sent)
|
|
|
19 |
*
|
|
|
20 |
* The providers defined on this file are processed and registered into
|
|
|
21 |
* the Moodle DB after any install or upgrade operation. All plugins
|
|
|
22 |
* support this.
|
|
|
23 |
*
|
|
|
24 |
* For more information, take a look to the documentation available:
|
|
|
25 |
* - Message API: {@link http://docs.moodle.org/dev/Message_API}
|
|
|
26 |
* - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
|
|
|
27 |
*
|
|
|
28 |
* @package core
|
|
|
29 |
* @category message
|
|
|
30 |
* @copyright 2008 onwards Martin Dougiamas http://dougiamas.com
|
|
|
31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
32 |
*/
|
|
|
33 |
|
|
|
34 |
defined('MOODLE_INTERNAL') || die();
|
|
|
35 |
|
|
|
36 |
$messageproviders = array (
|
|
|
37 |
|
|
|
38 |
'newlogin' => array (
|
|
|
39 |
'defaults' => [
|
|
|
40 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
41 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
42 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
43 |
],
|
|
|
44 |
),
|
|
|
45 |
|
|
|
46 |
// Notices that an admin might be interested in.
|
|
|
47 |
'notices' => array (
|
|
|
48 |
'defaults' => [
|
|
|
49 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
50 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
51 |
],
|
|
|
52 |
'capability' => 'moodle/site:config',
|
|
|
53 |
),
|
|
|
54 |
|
|
|
55 |
// Important errors that an admin ought to know about.
|
|
|
56 |
'errors' => array (
|
|
|
57 |
'defaults' => [
|
|
|
58 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
59 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
60 |
],
|
|
|
61 |
'capability' => 'moodle/site:config',
|
|
|
62 |
),
|
|
|
63 |
|
|
|
64 |
// Cron-based notifications about available moodle and/or additional plugin updates.
|
|
|
65 |
'availableupdate' => array(
|
|
|
66 |
'defaults' => [
|
|
|
67 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
68 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
69 |
],
|
|
|
70 |
'capability' => 'moodle/site:config',
|
|
|
71 |
),
|
|
|
72 |
|
|
|
73 |
'instantmessage' => array (
|
|
|
74 |
'defaults' => array(
|
|
|
75 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
76 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
77 |
),
|
|
|
78 |
),
|
|
|
79 |
|
|
|
80 |
'backup' => array (
|
|
|
81 |
'defaults' => [
|
|
|
82 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
83 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
84 |
],
|
|
|
85 |
'capability' => 'moodle/site:config'
|
|
|
86 |
),
|
|
|
87 |
|
|
|
88 |
// Course creation request notification
|
|
|
89 |
'courserequested' => array (
|
|
|
90 |
'defaults' => [
|
|
|
91 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
92 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
93 |
],
|
|
|
94 |
'capability' => 'moodle/site:approvecourse'
|
|
|
95 |
),
|
|
|
96 |
|
|
|
97 |
// Course request approval notification.
|
|
|
98 |
'courserequestapproved' => array (
|
|
|
99 |
'capability' => 'moodle/course:request',
|
|
|
100 |
'defaults' => [
|
|
|
101 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
102 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
103 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
104 |
],
|
|
|
105 |
),
|
|
|
106 |
|
|
|
107 |
// Course request rejection notification.
|
|
|
108 |
'courserequestrejected' => array (
|
|
|
109 |
'capability' => 'moodle/course:request',
|
|
|
110 |
'defaults' => [
|
|
|
111 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
112 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
113 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
114 |
],
|
|
|
115 |
),
|
|
|
116 |
|
|
|
117 |
// Course completed. Requires course completion configured at course level. It does not work with just activity progress.
|
|
|
118 |
'coursecompleted' => [
|
|
|
119 |
'defaults' => [
|
|
|
120 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
121 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
122 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
123 |
],
|
|
|
124 |
],
|
|
|
125 |
|
|
|
126 |
// Course content updated. New content (activities or resources) has been created or existing content updated.
|
|
|
127 |
'coursecontentupdated' => array (
|
|
|
128 |
'defaults' => array(
|
|
|
129 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
130 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
131 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
132 |
),
|
|
|
133 |
),
|
|
|
134 |
|
|
|
135 |
// Badge award notification to a badge recipient.
|
|
|
136 |
'badgerecipientnotice' => array (
|
|
|
137 |
'defaults' => array(
|
|
|
138 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
139 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
140 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
141 |
),
|
|
|
142 |
'capability' => 'moodle/badges:earnbadge'
|
|
|
143 |
),
|
|
|
144 |
|
|
|
145 |
// Badge award notification to a badge creator (mostly cron-based).
|
|
|
146 |
'badgecreatornotice' => array (
|
|
|
147 |
'defaults' => [
|
|
|
148 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
149 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
150 |
],
|
|
|
151 |
),
|
|
|
152 |
|
|
|
153 |
// A comment was left on a plan.
|
|
|
154 |
'competencyplancomment' => [
|
|
|
155 |
'defaults' => [
|
|
|
156 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
157 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
158 |
],
|
|
|
159 |
],
|
|
|
160 |
|
|
|
161 |
// A comment was left on a user competency.
|
|
|
162 |
'competencyusercompcomment' => [
|
|
|
163 |
'defaults' => [
|
|
|
164 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
165 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
166 |
],
|
|
|
167 |
],
|
|
|
168 |
|
|
|
169 |
// User insights.
|
|
|
170 |
'insights' => array (
|
|
|
171 |
'defaults' => [
|
|
|
172 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
173 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
174 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
175 |
]
|
|
|
176 |
),
|
|
|
177 |
|
|
|
178 |
// Message contact requests.
|
|
|
179 |
'messagecontactrequests' => [
|
|
|
180 |
'defaults' => [
|
|
|
181 |
// We don't need to notify in the popup output here because the message drawer
|
|
|
182 |
// already notifies users of contact requests.
|
|
|
183 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
184 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
185 |
]
|
|
|
186 |
],
|
|
|
187 |
|
|
|
188 |
// Asyncronhous backup/restore notifications.
|
|
|
189 |
'asyncbackupnotification' => array(
|
|
|
190 |
'defaults' => array(
|
|
|
191 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
192 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
193 |
)
|
|
|
194 |
),
|
|
|
195 |
|
|
|
196 |
'gradenotifications' => [
|
|
|
197 |
'defaults' => array(
|
|
|
198 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
199 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
200 |
),
|
|
|
201 |
],
|
|
|
202 |
|
|
|
203 |
// Infected files.
|
|
|
204 |
'infected' => array(
|
|
|
205 |
'defaults' => [
|
|
|
206 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
207 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
208 |
],
|
|
|
209 |
'capability' => 'moodle/site:config',
|
|
|
210 |
),
|
|
|
211 |
|
|
|
212 |
// Report builder schedules.
|
|
|
213 |
'reportbuilderschedule' => [
|
|
|
214 |
'defaults' => [
|
|
|
215 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
216 |
'email' => MESSAGE_FORCED,
|
|
|
217 |
],
|
|
|
218 |
],
|
|
|
219 |
|
|
|
220 |
// Task has reached the maximum fail delay.
|
|
|
221 |
'failedtaskmaxdelay' => [
|
|
|
222 |
'defaults' => [
|
|
|
223 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
224 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
225 |
],
|
|
|
226 |
'capability' => 'moodle/site:config',
|
|
|
227 |
],
|
|
|
228 |
|
|
|
229 |
// Course welcome message.
|
|
|
230 |
'enrolcoursewelcomemessage' => [
|
|
|
231 |
'defaults' => [
|
|
|
232 |
'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
233 |
'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
234 |
'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_ENABLED,
|
|
|
235 |
],
|
|
|
236 |
],
|
|
|
237 |
);
|