2 This file is part of Moodle - http://moodle.org/
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.
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.
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/>.
18 @template core_message/default_notification_preferences
20 This template will render the default notification preferences for admin settings.
22 Classes required for JS:
25 Data attributes required for JS:
26 * All data attributes are required
28 Context variables required for this template:
29 * providers Message providers
30 * components Provider components
31 * processors Message processors
32 * preferences Saved preferences
34 Example context (json):
44 "displayname": "Assignment",
49 "name": "assign_notification",
50 "component": "mod_assign",
51 "displayname": "Assignment notifications",
52 "enabledsetting": "mod_assign_assign_notification_disable",
53 "enabledlabel": "Sending Assignment enabled status",
57 "lockedsetting": "mod_assign_assign_notification_locked[popup]",
59 "lockedlabel": "Sending Assignment via Web locked status",
60 "enabledsetting": "mod_assign_assign_notification_enabled[popup]",
62 "enabledlabel": "Sending Assignment via Web enabled status"
71 <div class="preferences-page-container">
72 <h2>{{#str}} managemessageoutputs, message {{/str}}</h2>
74 <div class="preferences-container">
75 <table class="table table-hover preference-table">
79 <th>{{#str}} enabled, core_message {{/str}}</th>
81 <th data-processor-name="{{name}}">{{{displayname}}}</th>
87 <tr class="preference-row"><th colspan="{{{colspan}}}">{{{displayname}}}</th></tr>
89 <tr class="defaultmessageoutputs">
90 <td>{{{displayname}}}</td>
92 <div data-preference="{{{enabledsetting}}}">
93 <div class="custom-control custom-switch">
94 <input type="checkbox"
95 id="{{{enabledsetting}}}"
96 name="{{{enabledsetting}}}"
97 class="custom-control-input provider_enabled"
98 {{#enabled}}checked{{/enabled}}
100 <label for="{{{enabledsetting}}}" class="custom-control-label"
101 title="{{enabledlabel}}">
102 <span class="accesshide">{{enabledlabel}}</span>
108 <td class="text-left">
109 <div data-preference="{{{enabledsetting}}}">
110 <div class="custom-control custom-switch {{#locked}} dimmed_text{{/locked}} pb-1">
111 <input type="checkbox"
112 id="{{{enabledsetting}}}"
113 name="{{{enabledsetting}}}"
114 class="custom-control-input enabled_message_setting"
115 {{#enabled}}checked{{/enabled}}
117 <label for="{{{enabledsetting}}}" class="custom-control-label"
118 title="{{enabledlabel}}">
119 {{#str}} enabled, core_message {{/str}}
123 <div data-preference="{{{lockedsetting}}}">
124 <div class="custom-control custom-switch pt-1">
125 <input type="checkbox"
126 id="{{{lockedsetting}}}"
127 name="{{{lockedsetting}}}"
128 class="custom-control-input locked_message_setting"
129 {{#locked}}checked{{/locked}}
131 <label for="{{{lockedsetting}}}" class="custom-control-label"
132 title="{{lockedlabel}}">
133 {{#str}} forced, core_message {{/str}}
147 require(['core_message/default_notification_preferences'], function(NotificationPreferences) {
148 NotificationPreferences.init();