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 |
/**
|
|
|
19 |
* Notificationeabc enrolment plugin.
|
|
|
20 |
*
|
|
|
21 |
* This plugin notifies users when an event occurs on their enrolments (enrol, unenrol, update enrolment)
|
|
|
22 |
*
|
|
|
23 |
* @package enrol_notificationeabc
|
|
|
24 |
* @copyright 2017 e-ABC Learning
|
|
|
25 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
26 |
* @author Osvaldo Arriola <osvaldo@e-abclearning.com>
|
|
|
27 |
*/
|
|
|
28 |
|
|
|
29 |
defined('MOODLE_INTERNAL') || die();
|
|
|
30 |
|
|
|
31 |
if ($ADMIN->fulltree) {
|
|
|
32 |
|
|
|
33 |
// General settings.
|
|
|
34 |
|
|
|
35 |
// Enrol notification.
|
|
|
36 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
37 |
'enrol_notificationeabc/activeenrolalert',
|
|
|
38 |
get_string('activeenrolalert', 'enrol_notificationeabc'),
|
|
|
39 |
get_string('activeenrolalert_help', 'enrol_notificationeabc'),
|
|
|
40 |
'',
|
|
|
41 |
'1')
|
|
|
42 |
);
|
|
|
43 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
44 |
'enrol_notificationeabc/activarglobal',
|
|
|
45 |
get_string('activarglobal', 'enrol_notificationeabc'),
|
|
|
46 |
get_string('activarglobal_help', 'enrol_notificationeabc'),
|
|
|
47 |
'')
|
|
|
48 |
);
|
|
|
49 |
$settings->add(new admin_setting_heading(
|
|
|
50 |
'enrol_notificationeabc_settings',
|
|
|
51 |
'',
|
|
|
52 |
get_string('pluginname_desc', 'enrol_notificationeabc'),
|
|
|
53 |
'')
|
|
|
54 |
);
|
|
|
55 |
$settings->add(new admin_setting_confightmleditor(
|
|
|
56 |
'enrol_notificationeabc/location',
|
|
|
57 |
get_string('location', 'enrol_notificationeabc'),
|
|
|
58 |
get_string('location_help', 'enrol_notificationeabc'),
|
|
|
59 |
'')
|
|
|
60 |
);
|
|
|
61 |
|
|
|
62 |
// Unenrol notification.
|
|
|
63 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
64 |
'enrol_notificationeabc/activeunenrolalert',
|
|
|
65 |
get_string('activeunenrolalert', 'enrol_notificationeabc'),
|
|
|
66 |
get_string('activeunenrolalert_help', 'enrol_notificationeabc'),
|
|
|
67 |
'',
|
|
|
68 |
'1')
|
|
|
69 |
);
|
|
|
70 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
71 |
'enrol_notificationeabc/activarglobalunenrolalert',
|
|
|
72 |
get_string('activarglobalunenrolalert', 'enrol_notificationeabc'),
|
|
|
73 |
get_string('activarglobalunenrolalert_help', 'enrol_notificationeabc'),
|
|
|
74 |
'')
|
|
|
75 |
);
|
|
|
76 |
$settings->add(new admin_setting_confightmleditor(
|
|
|
77 |
'enrol_notificationeabc/unenrolmessage',
|
|
|
78 |
get_string('unenrolmessage', 'enrol_notificationeabc'),
|
|
|
79 |
get_string('unenrolmessage_help', 'enrol_notificationeabc'),
|
|
|
80 |
'')
|
|
|
81 |
);
|
|
|
82 |
|
|
|
83 |
// Update enrol notification.
|
|
|
84 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
85 |
'enrol_notificationeabc/activeenrolupdatedalert',
|
|
|
86 |
get_string('activeenrolupdatedalert', 'enrol_notificationeabc'),
|
|
|
87 |
get_string('activeenrolupdatedalert_help', 'enrol_notificationeabc'),
|
|
|
88 |
'',
|
|
|
89 |
'1')
|
|
|
90 |
);
|
|
|
91 |
$settings->add(new admin_setting_configcheckbox(
|
|
|
92 |
'enrol_notificationeabc/activarglobalenrolupdated',
|
|
|
93 |
get_string('activarglobalenrolupdated', 'enrol_notificationeabc'),
|
|
|
94 |
get_string('activarglobalenrolupdated_help', 'enrol_notificationeabc'),
|
|
|
95 |
'')
|
|
|
96 |
);
|
|
|
97 |
$settings->add(new admin_setting_confightmleditor(
|
|
|
98 |
'enrol_notificationeabc/updatedenrolmessage',
|
|
|
99 |
get_string('updatedenrolmessage', 'enrol_notificationeabc'),
|
|
|
100 |
get_string('updatedenrolmessage_help', 'enrol_notificationeabc'),
|
|
|
101 |
'')
|
|
|
102 |
);
|
|
|
103 |
$settings->add(new admin_setting_configtext(
|
|
|
104 |
'enrol_notificationeabc/emailsender',
|
|
|
105 |
get_string('emailsender', 'enrol_notificationeabc'),
|
|
|
106 |
get_string('emailsender_help', 'enrol_notificationeabc'),
|
|
|
107 |
'')
|
|
|
108 |
);
|
|
|
109 |
$settings->add(new admin_setting_configtext(
|
|
|
110 |
'enrol_notificationeabc/namesender',
|
|
|
111 |
get_string('namesender', 'enrol_notificationeabc'),
|
|
|
112 |
get_string('namesender_help', 'enrol_notificationeabc'),
|
|
|
113 |
'')
|
|
|
114 |
);
|
|
|
115 |
}
|