From 59eaa9ac4949bbcca7e5bf25362c8089197d0384 Mon Sep 17 00:00:00 2001 From: jerome Date: Fri, 9 Jan 2009 00:56:45 +0000 Subject: [PATCH] online user block MDL-15325 optimize the display of the message icon/link (instantiation out of a loop), merged from 1.9 --- blocks/online_users/block_online_users.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/blocks/online_users/block_online_users.php b/blocks/online_users/block_online_users.php index 7c65c47732a..5d2a5c6b820 100644 --- a/blocks/online_users/block_online_users.php +++ b/blocks/online_users/block_online_users.php @@ -140,6 +140,12 @@ class block_online_users extends block_base { //Accessibility: Don't want 'Alt' text for the user picture; DO want it for the envelope/message link (existing lang string). //Accessibility: Converted
to
'; } - if (!empty($USER->id) and ($USER->id != $user->id) and !empty($CFG->messaging) and - has_capability('moodle/site:sendmessage', $context) and - !isguest() and $user->username != 'guest') { // Only when logged in and messaging active etc + if ($canshowicon and ($USER->id != $user->id) and $user->username != 'guest') { // Only when logged in and messaging active etc $this->content->text .= '
' .''. get_string('messageselectadd') .'
'; }