From e15f35d4024a1abd40878878f5147a2709f2d170 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Thu, 3 Jul 2014 15:52:31 +0100 Subject: [PATCH 1/1] MDL-43848 messages: do not display message content in popups The user is not in control of when these popups show up and it may not be appropiate to have part of this content display whilst in the presence of other users. --- lib/moodlelib.php | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 857084b..020b368 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -10500,43 +10500,7 @@ function message_popup_window() { //if we have new messages to notify the user about if (!empty($message_users)) { - $strmessages = ''; - if (count($message_users)>1) { - $strmessages = get_string('unreadnewmessages', 'message', count($message_users)); - } else { - $message_users = reset($message_users); - - //show who the message is from if its not a notification - if (!$message_users->notification) { - $strmessages = get_string('unreadnewmessage', 'message', fullname($message_users) ); - } - - //try to display the small version of the message - $smallmessage = null; - if (!empty($message_users->smallmessage)) { - //display the first 200 chars of the message in the popup - $smallmessage = null; - if (textlib::strlen($message_users->smallmessage) > 200) { - $smallmessage = textlib::substr($message_users->smallmessage,0,200).'...'; - } else { - $smallmessage = $message_users->smallmessage; - } - - //prevent html symbols being displayed - if ($message_users->fullmessageformat == FORMAT_HTML) { - $smallmessage = html_to_text($smallmessage); - } else { - $smallmessage = s($smallmessage); - } - } else if ($message_users->notification) { - //its a notification with no smallmessage so just say they have a notification - $smallmessage = get_string('unreadnewnotification', 'message'); - } - if (!empty($smallmessage)) { - $strmessages .= '
'.s($smallmessage).'
'; - } - } - + $strmessages = get_string('unreadnewmessages', 'message', count($message_users)); $strgomessage = get_string('gotomessages', 'message'); $strstaymessage = get_string('ignore','admin'); -- 1.9.2