message MDL-24972 made search box smaller and added highlighting of currently selected user

This commit is contained in:
Andrew Davis
2010-11-02 03:05:11 +00:00
parent 37a75bee9f
commit a402c30923
4 changed files with 15 additions and 9 deletions
+11 -6
View File
@@ -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 '<tr><td colspan="3">&nbsp;</td></tr>';
@@ -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 = '<strong>'.$fullnamelink.' ('.$contact->messagecount.')</strong>';
@@ -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 '</td>';
echo '<td class="link">&nbsp;'.$strcontact.$strblock.'&nbsp;'.$strhistory.'</td>';
+1 -1
View File
@@ -5,7 +5,7 @@
<table cellpadding="5" class="message_form">
<tr>
<td colspan="3" class="message_heading mdl-left">
<input type="text" name="combinedsearch" size="50" id="combinedsearch" value="<?php echo $combinedsearchstring; ?>" />
<input type="text" name="combinedsearch" size="40" id="combinedsearch" value="<?php echo $combinedsearchstring; ?>" />
<input type="submit" name="combinedsubmit" value="<?php print_string('searchcombined','message') ?>" />
<a href="contacts.php?advanced=1" id="advancedcontactsearchlink"><?php print_string('advanced') ?></a>
</td>
+2 -2
View File
@@ -12,7 +12,7 @@
</tr>
<tr>
<td><label for="name"><?php print_string('name') ?></label></td>
<td><input type="text" name="name" size="50" id="name" value="<? echo $personsearch ?>" /></td>
<td><input type="text" name="name" size="40" id="name" value="<? echo $personsearch ?>" /></td>
<td><input type="submit" name="personsubmit" value="<?php print_string('searchforperson','message') ?>" /></td>
</tr>
<tr>
@@ -29,7 +29,7 @@
</tr>
<tr>
<td><label for="keywords"><?php print_string('keywords', 'message') ?></label></td>
<td><input type="text" name="keywords" id="keywords" size="50" value="<? echo $messagesearch ?>" /></td>
<td><input type="text" name="keywords" id="keywords" size="40" value="<? echo $messagesearch ?>" /></td>
<td><input type="submit" name="keywordssubmit" value="<?php print_string('searchmessages','message') ?>" /></td>
</tr>
+1
View File
@@ -28,6 +28,7 @@ table.message .searchresults td {padding:5px;}
.message .contactselector {width:24%;float:left;}
.message .contactselector .contact {text-align:left;}
.message .contactselector .messageselecteduser {font-weight:bold;}
.message .messagearea {padding-left:1%;border-left:1px solid LightGrey;width:74%;float:right;min-height:200px;}
.message .messagearea .messagehistorytype {clear:both;padding-bottom:20px;}