MDL-55813 message: add online/offline help icons on preferences page

This commit is contained in:
Ryan Wyllie
2016-10-07 16:26:40 +08:00
committed by Mark Nelson
parent fadb831658
commit 7b477f5982
4 changed files with 30 additions and 7 deletions
+5 -3
View File
@@ -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';
@@ -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;
}
}
@@ -99,8 +99,14 @@
<td class="align-bottom">
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">{{#str}} online, message {{/str}}</div>
<div class="span6">{{#str}} offline, message {{/str}}</div>
<div class="span6">
{{#str}} loggedin, message {{/str}}
{{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}}
</div>
<div class="span6">
{{#str}} loggedoff, message {{/str}}
{{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}}
</div>
</div>
</div>
</td>
@@ -120,8 +120,14 @@
<td class="align-bottom">
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">{{#str}} online, message {{/str}}</div>
<div class="span6">{{#str}} offline, message {{/str}}</div>
<div class="span6">
{{#str}} loggedin, message {{/str}}
{{#onlinehelphtml}}{{{.}}}{{/onlinehelphtml}}
</div>
<div class="span6">
{{#str}} loggedoff, message {{/str}}
{{#offlinehelphtml}}{{{.}}}{{/offlinehelphtml}}
</div>
</div>
</div>
</td>