aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-08 22:30:07 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-06-08 22:30:07 +0000
commit0254a2d9200ac30e7430efc1dce6005aa75ffa72 (patch)
treece1b2b51c7a2081015f0188af416fc043a4b1523
parent8ddeb1f6e37dc1647e9bee4f3cfe35adcb2ca004 (diff)
downloadelgg-0254a2d9200ac30e7430efc1dce6005aa75ffa72.tar.gz
elgg-0254a2d9200ac30e7430efc1dce6005aa75ffa72.tar.bz2
Refs #3510, #3264. Ported fix for icons of messages from deleted users to trunk.
git-svn-id: http://code.elgg.org/elgg/trunk@9143 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/messages/languages/en.php3
-rw-r--r--mod/messages/views/default/object/messages.php31
2 files changed, 24 insertions, 10 deletions
diff --git a/mod/messages/languages/en.php b/mod/messages/languages/en.php
index 8e4cd015f..2002905b7 100644
--- a/mod/messages/languages/en.php
+++ b/mod/messages/languages/en.php
@@ -88,6 +88,9 @@ $english = array(
'messages:nomessages' => "There are no messages.",
'messages:user:nonexist' => "We could not find the recipient in the user database.",
'messages:user:blank' => "You did not select someone to send this to.",
+
+ 'messages:deleted_sender' => 'Deleted user',
+
);
add_translation("en", $english); \ No newline at end of file
diff --git a/mod/messages/views/default/object/messages.php b/mod/messages/views/default/object/messages.php
index b52b86a3a..b2d127d85 100644
--- a/mod/messages/views/default/object/messages.php
+++ b/mod/messages/views/default/object/messages.php
@@ -19,11 +19,16 @@ if ($full) {
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' => "messages/compose?send_to=$user->guid",
- 'text' => $user->name,
- ));
+ if ($user) {
+ $icon = elgg_view_entity_icon($user, 'tiny');
+ $user_link = elgg_view('output/url', array(
+ 'href' => "messages/compose?send_to=$user->guid",
+ 'text' => $user->name,
+ ));
+ } else {
+ $icon = '';
+ $user_link = elgg_echo('messages:deleted_sender');
+ }
if ($message->readYet) {
$class = 'message read';
@@ -34,11 +39,17 @@ if ($message->toId == elgg_get_page_owner_guid()) {
} else {
// sent
$user = get_entity($message->toId);
- $icon = elgg_view_entity_icon($user, 'tiny');
- $user_link = elgg_view('output/url', array(
- 'href' => "messages/compose?send_to=$user->guid",
- 'text' => elgg_echo('messages:to_user', array($user->name)),
- ));
+
+ if ($user) {
+ $icon = elgg_view_entity_icon($user, 'tiny');
+ $user_link = elgg_view('output/url', array(
+ 'href' => "messages/compose?send_to=$user->guid",
+ 'text' => elgg_echo('messages:to_user', array($user->name)),
+ ));
+ } else {
+ $icon = '';
+ $user_link = elgg_echo('messages:deleted_sender');
+ }
$class = 'message read';
}