MDL-36631 usability: Core edit for new messaging icons

This commit is contained in:
Frederic Massart 2012-11-21 15:19:45 +08:00
parent 00a398fbc6
commit f2bba619b3
3 changed files with 18 additions and 24 deletions

View file

@ -1270,7 +1270,10 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
echo $OUTPUT->user_picture($USER, array('size' => 20, 'courseid' => SITEID)); echo $OUTPUT->user_picture($USER, array('size' => 20, 'courseid' => SITEID));
} else { } else {
echo $OUTPUT->user_picture($user, array('size' => 20, 'courseid' => SITEID)); echo $OUTPUT->user_picture($user, array('size' => 20, 'courseid' => SITEID));
echo ' ';
$link = new moodle_url("/message/index.php?id=$user->id");
echo $OUTPUT->action_link($link, fullname($user), null, array('title' =>
get_string('sendmessageto', 'message', fullname($user))));
$return = false; $return = false;
$script = null; $script = null;
@ -1279,27 +1282,12 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
} else { } else {
message_contact_link($user->id, 'add', $return, $script, $includeicontext); message_contact_link($user->id, 'add', $return, $script, $includeicontext);
} }
echo ' ';
if ($isblocked) { if ($isblocked) {
message_contact_link($user->id, 'unblock', $return, $script, $includeicontext); message_contact_link($user->id, 'unblock', $return, $script, $includeicontext);
} else { } else {
message_contact_link($user->id, 'block', $return, $script, $includeicontext); message_contact_link($user->id, 'block', $return, $script, $includeicontext);
} }
$popupoptions = array(
'height' => MESSAGE_DISCUSSION_HEIGHT,
'width' => MESSAGE_DISCUSSION_WIDTH,
'menubar' => false,
'location' => false,
'status' => true,
'scrollbars' => true,
'resizable' => true);
$link = new moodle_url("/message/index.php?id=$user->id");
//$action = new popup_action('click', $link, "message_$user->id", $popupoptions);
$action = null;
echo $OUTPUT->action_link($link, fullname($user), $action, array('title' => get_string('sendmessageto', 'message', fullname($user))));
} }
} }
@ -1351,14 +1339,14 @@ function message_contact_link($userid, $linktype='add', $return=false, $script=n
$iconpath = 't/block'; $iconpath = 't/block';
break; break;
case 'unblock': case 'unblock':
$iconpath = 't/userblue'; $iconpath = 't/unblock';
break; break;
case 'remove': case 'remove':
$iconpath = 'i/cross_red_big'; $iconpath = 't/removecontact';
break; break;
case 'add': case 'add':
default: default:
$iconpath = 't/addgreen'; $iconpath = 't/addcontact';
} }
$img = '<img src="'.$OUTPUT->pix_url($iconpath).'" class="iconsmall" alt="'.$safealttext.'" />'; $img = '<img src="'.$OUTPUT->pix_url($iconpath).'" class="iconsmall" alt="'.$safealttext.'" />';
@ -1405,9 +1393,9 @@ function message_history_link($userid1, $userid2, $return=false, $keywords='', $
} }
if ($linktext == 'icon') { // Icon only if ($linktext == 'icon') { // Icon only
$fulllink = '<img src="'.$OUTPUT->pix_url('t/log') . '" class="iconsmall" alt="'.$strmessagehistory.'" />'; $fulllink = '<img src="'.$OUTPUT->pix_url('t/messages') . '" class="iconsmall" alt="'.$strmessagehistory.'" />';
} else if ($linktext == 'both') { // Icon and standard name } else if ($linktext == 'both') { // Icon and standard name
$fulllink = '<img src="'.$OUTPUT->pix_url('t/log') . '" class="iconsmall" alt="" />'; $fulllink = '<img src="'.$OUTPUT->pix_url('t/messages') . '" class="iconsmall" alt="" />';
$fulllink .= '&nbsp;'.$strmessagehistory; $fulllink .= '&nbsp;'.$strmessagehistory;
} else if ($linktext) { // Custom name } else if ($linktext) { // Custom name
$fulllink = $linktext; $fulllink = $linktext;
@ -1831,8 +1819,7 @@ function message_print_message_history($user1,$user2,$search='',$messagelimit=0,
echo html_writer::end_tag('td'); echo html_writer::end_tag('td');
echo html_writer::start_tag('td', array('align' => 'center')); echo html_writer::start_tag('td', array('align' => 'center'));
echo html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/left'), 'alt' => get_string('from'))); echo html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('i/twoway'), 'alt' => ''));
echo html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url('t/right'), 'alt' => get_string('to')));
echo html_writer::end_tag('td'); echo html_writer::end_tag('td');
echo html_writer::start_tag('td', array('align' => 'center', 'id' => 'user2')); echo html_writer::start_tag('td', array('align' => 'center', 'id' => 'user2'));

View file

@ -60,6 +60,10 @@ table.message .searchresults td {padding:5px;}
.messagesearchresults {margin-bottom:40px;} .messagesearchresults {margin-bottom:40px;}
.messagesearchresults td {padding:0px 10px 0px 20px;} .messagesearchresults td {padding:0px 10px 0px 20px;}
.messagesearchresults td span {white-space:nowrap;} .messagesearchresults td span {white-space:nowrap;}
.messagesearchresults td img.userpicture { padding-right: .45em; vertical-align: text-bottom; }
.dir-rtl .messagesearchresults td img.userpicture { padding-left: .45em; padding-right: 0; }
.messagesearchresults td span img { padding: 0 0 0 .45em; vertical-align: text-bottom; }
.dir-rtl .messagesearchresults td span img { padding: 0 .45em 0 0; }
#newmessageoverlay {background-color:LightGrey;border:1px solid black;padding:20px;position:fixed;bottom:0;right:0;} #newmessageoverlay {background-color:LightGrey;border:1px solid black;padding:20px;position:fixed;bottom:0;right:0;}
#newmessageoverlay #usermessage {padding:10px;} #newmessageoverlay #usermessage {padding:10px;}

View file

@ -8,6 +8,7 @@ required changes:
deprecation: deprecation:
* i/roles: Use t/assignroles instead * i/roles: Use t/assignroles instead
* t/userblue: Previously used to unblock a user, use t/unblock.
optional changes: optional changes:
* new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365) * new optional boolean parameter $withlinks for public function login_info() in lib/outputrenderers.php (MDL-31365)
@ -20,6 +21,8 @@ optional changes:
* new icon t/cohorts (sized 12x12), to prevent the use of i/cohorts which is 16x16. * new icon t/cohorts (sized 12x12), to prevent the use of i/cohorts which is 16x16.
* new icons t/sort_asc, t/sort_desc to use for ordering in table headers. * new icons t/sort_asc, t/sort_desc to use for ordering in table headers.
* new class 'iconsort' for icons used for ordering in table headers. * new class 'iconsort' for icons used for ordering in table headers.
* new icons t/addcontact, t/removecontact and t/messages, previously t/addgreen, t/delete and t/log were used in messaging.
* new icons t/unblock and i/twoway.
=== 2.3 === === 2.3 ===