Merge branch 'MDL-69776-master' of git://github.com/jleyva/moodle
[moodle.git] / lib / db / messages.php
CommitLineData
117bd748 1<?php
5b4a78e2
PS
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/>.
120b3758 16
5b4a78e2
PS
17/**
18 * Defines message providers (types of messages being sent)
19 *
39b90b51
EL
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 http://docs.moodle.org/dev/Upgrade_API}
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
5b4a78e2
PS
32 */
33
34defined('MOODLE_INTERNAL') || die();
120b3758 35
36$messageproviders = array (
37
39b90b51 38 // Notices that an admin might be interested in
6f5e0852 39 'notices' => array (
120b3758 40 'capability' => 'moodle/site:config'
41 ),
42
39b90b51 43 // Important errors that an admin ought to know about
120b3758 44 'errors' => array (
45 'capability' => 'moodle/site:config'
17da2e6f 46 ),
120b3758 47
a77141a7
DM
48 // cron-based notifications about available moodle and/or additional plugin updates
49 'availableupdate' => array(
50 'capability' => 'moodle/site:config',
51 'defaults' => array(
52 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF
53 ),
54
55 ),
56
17da2e6f 57 'instantmessage' => array (
7a04c476
RK
58 'defaults' => array(
59 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
60 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
61 ),
17da2e6f 62 ),
6f5e0852 63
bac233d3
SH
64 'backup' => array (
65 'capability' => 'moodle/site:config'
a1708181 66 ),
67
39b90b51 68 // Course creation request notification
a1708181 69 'courserequested' => array (
70 'capability' => 'moodle/site:approvecourse'
71 ),
72
39b90b51 73 // Course request approval notification
a1708181 74 'courserequestapproved' => array (
c1343815
JL
75 'capability' => 'moodle/course:request',
76 'defaults' => array(
77 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
78 ),
a1708181 79 ),
80
39b90b51 81 // Course request rejection notification
a1708181 82 'courserequestrejected' => array (
c1343815
JL
83 'capability' => 'moodle/course:request',
84 'defaults' => array(
85 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
86 ),
f5d17c14 87 ),
bac233d3 88
417e5b9f
JL
89 // Course completed. Requires course completion configured at course level. It does not work with just activity progress.
90 'coursecompleted' => [],
91
f5d17c14
YB
92 // Badge award notification to a badge recipient.
93 'badgerecipientnotice' => array (
94 'defaults' => array(
95 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
96 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
c1343815 97 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
f5d17c14
YB
98 ),
99 'capability' => 'moodle/badges:earnbadge'
100 ),
101
102 // Badge award notification to a badge creator (mostly cron-based).
103 'badgecreatornotice' => array (
104 'defaults' => array(
105 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
106 )
36a43db8
FM
107 ),
108
109 // A comment was left on a plan.
110 'competencyplancomment' => array(),
111
112 // A comment was left on a user competency.
113 'competencyusercompcomment' => array(),
40fcb365
DM
114
115 // User insights.
116 'insights' => array (
b5b112f6
DM
117 'defaults' => [
118 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
119 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
c1343815 120 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
b5b112f6 121 ]
be016b01
MN
122 ),
123
124 // Message contact requests.
125 'messagecontactrequests' => [
126 'defaults' => [
5d61b3b3
RW
127 // We don't need to notify in the popup output here because the message drawer
128 // already notifies users of contact requests.
be016b01 129 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
c1343815 130 'airnotifier' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
be016b01
MN
131 ]
132 ],
2cd901a4
MP
133
134 // Asyncronhous backup/restore notifications.
135 'asyncbackupnotification' => array(
136 'defaults' => array(
137 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
138 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
139 )
140 ),
96663726
SR
141
142 'gradenotifications' => [
3f609c8a
SL
143 'defaults' => array(
144 'popup' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDIN + MESSAGE_DEFAULT_LOGGEDOFF,
145 'email' => MESSAGE_PERMITTED + MESSAGE_DEFAULT_LOGGEDOFF,
146 ),
96663726 147 ],
adbe92ce
NN
148
149 // Infected files.
8e0e99e4
PB
150 'infected' => array(
151 'capability' => 'moodle/site:config',
adbe92ce 152 ),
120b3758 153);