MDL-61255 core_message: add warning when notifications not migrated

This commit is contained in:
Mark Nelson 2018-04-10 16:26:01 +08:00
parent 78348dfc4e
commit 23de6f3a2d
2 changed files with 9 additions and 0 deletions

View file

@ -84,6 +84,7 @@ $string['nomessagesfound'] = 'No messages were found';
$string['noreply'] = 'Do not reply to this message'; $string['noreply'] = 'Do not reply to this message';
$string['noncontacts'] = 'Non-contacts'; $string['noncontacts'] = 'Non-contacts';
$string['nonotifications'] = 'You have no notifications'; $string['nonotifications'] = 'You have no notifications';
$string['notificationdatahasnotbeenmigrated'] = 'Your notifications are temporarily unavailable due to upgrades in the notification infrastructure. Please wait for them to be migrated.';
$string['notificationwindow'] = 'Notification window'; $string['notificationwindow'] = 'Notification window';
$string['notificationpreferences'] = 'Notification preferences'; $string['notificationpreferences'] = 'Notification preferences';
$string['notificationimage'] = 'Notification image'; $string['notificationimage'] = 'Notification image';

View file

@ -65,6 +65,14 @@ $context = [
echo $OUTPUT->header(); echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('notifications', 'message')); echo $OUTPUT->heading(get_string('notifications', 'message'));
// Display a message if the notifications have not been migrated yet.
if (!get_user_preferences('core_message_migrate_data', false, $userid)) {
$notify = new \core\output\notification(get_string('notificationdatahasnotbeenmigrated', 'message'),
\core\output\notification::NOTIFY_WARNING);
echo $OUTPUT->render($notify);
}
echo $renderer->render_from_template('message_popup/notification_area', $context); echo $renderer->render_from_template('message_popup/notification_area', $context);
echo $OUTPUT->footer(); echo $OUTPUT->footer();