Browse files

Messages block: Incorrect link to user profile

The block incorrectly links to site profile in the current pageid.
This doens't make sense in a number of different scenarios, but
most notably if the user who messaged isn't enrolled in the current
course. Instead link to the profile at site context like the messaging
popup does.

Fixes: MDL-18279 MDL-6890 MDL-5887
  • Loading branch information...
1 parent 57a049c commit acb1e9fc07ad7225f0422e230259ddd95a0feb87 poltawski committed Mar 22, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 blocks/messages/block_messages.php
@@ -42,8 +42,8 @@ function get_content() {
$this->content->text .= '<ul class="list">';
foreach ($users as $user) {
$timeago = format_time(time() - $user->lastaccess);
- $this->content->text .= '<li class="listentry"><div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->instance->pageid.'" title="'.$timeago.'">';
- $this->content->text .= print_user_picture($user, $this->instance->pageid, $user->picture, 0, true, false, '', false);
+ $this->content->text .= '<li class="listentry"><div class="user"><a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.SITEID.'" title="'.$timeago.'">';
+ $this->content->text .= print_user_picture($user, SITEID, $user->picture, 0, true, false, '', false);
$this->content->text .= fullname($user).'</a></div>';
$this->content->text .= '<div class="message"><a href="'.$CFG->wwwroot.'/message/discussion.php?id='.$user->id.'" onclick="\'message_'.$user->id.'\'; return openpopup(\'/message/discussion.php?id='.$user->id.'\', \'message_'.$user->id.'\', \'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500\', 0);"><img class="iconsmall" src="'.$CFG->pixpath.'/t/message.gif" alt="" />&nbsp;'.$user->count.'</a>';
$this->content->text .= '</div></li>';

0 comments on commit acb1e9f

Please sign in to comment.