';
$timeago = format_time($now - $user->lastaccess); //bruno to calculate correctly on frontpage
if (isguestuser($user)) {
$this->content->text .= ''.$OUTPUT->user_picture($user, array('size'=>16, 'alttext'=>false));
$this->content->text .= get_string('guestuser').'
';
} else { // Not a guest user.
$this->content->text .= '';
if ($USER->id == $user->id) {
$action = ($user->uservisibility != null && $user->uservisibility == 0) ? 'show' : 'hide';
$anchortagcontents = $OUTPUT->pix_icon('t/' . $action,
get_string('online_status:' . $action, 'block_online_users'));
$anchortag = html_writer::link("", $anchortagcontents,
array('title' => get_string('online_status:' . $action, 'block_online_users'),
'data-action' => $action, 'data-userid' => $user->id, 'id' => 'change-user-visibility'));
$this->content->text .= '' . $anchortag . '
';
} else {
if ($canshowicon) { // Only when logged in and messaging active etc.
$anchortagcontents = $OUTPUT->pix_icon('t/message', get_string('messageselectadd'));
$anchorurl = new moodle_url('/message/index.php', array('id' => $user->id));
$anchortag = html_writer::link($anchorurl, $anchortagcontents,
array('title' => get_string('messageselectadd')));
$this->content->text .= ''.$anchortag.'
';
}
}
}
$this->content->text .= "\n";
}
$this->content->text .= '