diff --git a/message/lib.php b/message/lib.php
index d53435d4a6c..27e724c46ec 100644
--- a/message/lib.php
+++ b/message/lib.php
@@ -302,7 +302,7 @@ function message_get_contacts($user1=null, &$user2=null) {
return array($onlinecontacts, $offlinecontacts, $strangers);
}
-function message_print_contacts($onlinecontacts, $offlinecontacts, $strangers, $refresh=true, $contactselecturl=null, $minmessages=0, $showactionlinks=true, $titletodisplay=null) {
+function message_print_contacts($onlinecontacts, $offlinecontacts, $strangers, $refresh=true, $contactselecturl=null, $minmessages=0, $showactionlinks=true, $titletodisplay=null, $user2=null) {
global $CFG, $PAGE, $OUTPUT;
$countonlinecontacts = count($onlinecontacts);
@@ -335,7 +335,7 @@ function message_print_contacts($onlinecontacts, $offlinecontacts, $strangers, $
foreach ($onlinecontacts as $contact) {
if ($minmessages==0 || $contact->messagecount>=$minmessages) {
- message_print_contactlist_user($contact, IS_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks);
+ message_print_contactlist_user($contact, IS_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks, $user2);
}
}
}
@@ -351,7 +351,7 @@ function message_print_contacts($onlinecontacts, $offlinecontacts, $strangers, $
foreach ($offlinecontacts as $contact) {
if ($minmessages==0 || $contact->messagecount>=$minmessages) {
- message_print_contactlist_user($contact, IS_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks);
+ message_print_contactlist_user($contact, IS_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks, $user2);
}
}
echo '
| |
';
@@ -365,7 +365,7 @@ function message_print_contacts($onlinecontacts, $offlinecontacts, $strangers, $
foreach ($strangers as $stranger) {
if ($minmessages==0 || $stranger->messagecount>=$minmessages) {
- message_print_contactlist_user($stranger, IS_NOT_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks);
+ message_print_contactlist_user($stranger, IS_NOT_CONTACT, IS_NOT_BLOCKED, $contactselecturl, $showactionlinks, $user2);
}
}
}
@@ -1601,11 +1601,16 @@ function message_get_participants() {
* @param $incontactlist is the user a contact of ours?
* @param $selectcontacturl string the url to send the user to when a contact's name is clicked
*/
-function message_print_contactlist_user($contact, $incontactlist = true, $isblocked = false, $selectcontacturl = null, $showactionlinks = true) {
+function message_print_contactlist_user($contact, $incontactlist = true, $isblocked = false, $selectcontacturl = null, $showactionlinks = true, $selecteduser=null) {
global $OUTPUT, $USER;
$fullname = fullname($contact);
$fullnamelink = $fullname;
+ $linkclass = '';
+ if (!empty($selecteduser) && $contact->id==$selecteduser->id) {
+ $linkclass = 'messageselecteduser';
+ }
+
/// are there any unread messages for this contact?
if ($contact->messagecount > 0 ){
$fullnamelink = ''.$fullnamelink.' ('.$contact->messagecount.')';
@@ -1641,7 +1646,7 @@ function message_print_contactlist_user($contact, $incontactlist = true, $isbloc
$link = new moodle_url("/message/index.php?id=$contact->id");
$action = new popup_action('click', $link, "message_$contact->id", $popupoptions);
}
- echo $OUTPUT->action_link($link, $fullnamelink, $action, array('title'=>get_string('sendmessageto', 'message', $fullname)));
+ echo $OUTPUT->action_link($link, $fullnamelink, $action, array('class'=>$linkclass,'title'=>get_string('sendmessageto', 'message', $fullname)));
echo '';
echo ' '.$strcontact.$strblock.' '.$strhistory.' | ';
diff --git a/message/search.html b/message/search.html
index b202ffbffdf..79c51122e82 100644
--- a/message/search.html
+++ b/message/search.html
@@ -5,7 +5,7 @@