readYet = true; } if ($message->toId == elgg_get_page_owner_guid()) { // received $user = get_entity($message->fromId); $icon = elgg_view_entity_icon($user, 'tiny'); $user_link = elgg_view('output/url', array( 'href' => "pg/messages/compose?send_to=$user->guid", 'text' => $user->name, )); if ($message->readYet) { $class = 'message read'; } else { $class = 'message unread'; } } else { // sent $user = get_entity($message->toId); $icon = elgg_view_entity_icon($user, 'tiny'); $user_link = elgg_view('output/url', array( 'href' => "pg/messages/compose?send_to=$user->guid", 'text' => elgg_echo('messages:to_user', array($user->name)), )); $class = 'message read'; } $timestamp = elgg_view_friendly_time($message->time_created); $subject_info = ''; if (!$full) { $subject_info .= "guid}\" />"; } $subject_info .= elgg_view('output/url', array( 'href' => $message->getURL(), 'text' => $message->title, )); $delete_link = elgg_view("output/confirmlink", array( 'href' => "action/messages/delete?guid=" . $message->getGUID(), 'text' => "", 'confirm' => elgg_echo('deleteconfirm'), 'text_encode' => false, )); $body = <<$user_link
$subject_info
$timestamp
$delete_link
HTML; if ($full) { echo elgg_view_image_block($icon, $body, array('class' => $class)); echo elgg_view('output/longtext', array('value' => $message->description)); } else { echo elgg_view_image_block($icon, $body, array('class' => $class)); }