MDL-54698 message: fix message preferences context blocknoncontacts

This commit is contained in:
Ryan Wyllie
2016-10-07 16:26:40 +08:00
committed by Mark Nelson
parent c4624a76c9
commit 7e12045152
2 changed files with 2 additions and 2 deletions
-1
View File
@@ -3227,7 +3227,6 @@ EOD;
if (isloggedin()) {
$context = [
'userid' => $USER->id,
'blocknoncontacts' => get_user_preferences('message_blocknoncontacts', '', $USER->id),
'urls' => [
'preferences' => (new moodle_url('/message/edit.php', ['id' => $USER->id]))->out(),
],
+2 -1
View File
@@ -253,7 +253,8 @@ class core_message_renderer extends plugin_renderer_base {
$preferences = get_all_message_preferences($readyprocessors, $providers, $user);
$notificationlistoutput = new \core_message\output\preferences\message_notification_list($readyprocessors, $providers, $preferences, $user);
$context = $notificationlistoutput->export_for_template($this);
$context['blocknoncontacts'] = get_user_preferences('message_blocknoncontacts', '', $user->id) ? true : false;
return $this->render_from_template('message/message_preferences', $notificationlistoutput->export_for_template($this));
return $this->render_from_template('message/message_preferences', $context);
}
}