diff --git a/lang/en/message.php b/lang/en/message.php index 2c4975afa33..6fb25546aa7 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -83,9 +83,11 @@ $string['keywordssearchresults'] = 'Messages found: {$a}'; $string['keywordssearchresultstoomany'] = 'More than {$a} messages found. Refine your search.'; $string['loading'] = 'Loading ...'; $string['loggedin'] = 'Online'; -$string['loggedindescription'] = 'When I\'m logged in'; -$string['loggedoff'] = 'Not online'; -$string['loggedoffdescription'] = 'When I\'m offline'; +$string['loggedin_help'] = 'Configure how you would like to receive notifications when you are logged into Moodle'; +$string['loggedindescription'] = 'When you are logged into Moodle'; +$string['loggedoff'] = 'Offline'; +$string['loggedoff_help'] = 'Configure how you would like to receive notifications when you are not logged into Moodle'; +$string['loggedoffdescription'] = 'When you are not logged into Moodle'; $string['managecontacts'] = 'Manage my contacts'; $string['managemessageoutputs'] = 'Manage message outputs'; $string['messageoutputs'] = 'Message outputs'; diff --git a/message/classes/output/preferences/notification_list.php b/message/classes/output/preferences/notification_list.php index bfba030bb19..d112b4a66f0 100644 --- a/message/classes/output/preferences/notification_list.php +++ b/message/classes/output/preferences/notification_list.php @@ -162,6 +162,15 @@ class notification_list implements templatable, renderable { $context['components'][] = $notificationcomponent->export_for_template($output); } + // This is fairly nasty but we don't currently have a way to add help icons + // in templates, so we'll need to provide it in the context. + // + // We only want the first component to render with the help icon. + if (!empty($context['components'])) { + $context['components'][0]['onlinehelphtml'] = $output->help_icon('loggedin', 'message'); + $context['components'][0]['offlinehelphtml'] = $output->help_icon('loggedoff', 'message'); + } + return $context; } } diff --git a/message/templates/message_preferences.mustache b/message/templates/message_preferences.mustache index 66b82a12a7a..a108289c0cc 100644 --- a/message/templates/message_preferences.mustache +++ b/message/templates/message_preferences.mustache @@ -99,8 +99,14 @@
-
{{#str}} online, message {{/str}}
-
{{#str}} offline, message {{/str}}
+
+ {{#str}} loggedin, message {{/str}} + {{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}} +
+
+ {{#str}} loggedoff, message {{/str}} + {{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}} +
diff --git a/message/templates/preferences_notifications_list.mustache b/message/templates/preferences_notifications_list.mustache index c3b8a649d50..af0d3757149 100644 --- a/message/templates/preferences_notifications_list.mustache +++ b/message/templates/preferences_notifications_list.mustache @@ -120,8 +120,14 @@
-
{{#str}} online, message {{/str}}
-
{{#str}} offline, message {{/str}}
+
+ {{#str}} loggedin, message {{/str}} + {{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}} +
+
+ {{#str}} loggedoff, message {{/str}} + {{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}} +