diff options
-rw-r--r-- | views/default/annotation/default.php | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php index 30e1cef68..869900afa 100644 --- a/views/default/annotation/default.php +++ b/views/default/annotation/default.php @@ -5,9 +5,43 @@ * @uses $vars['annotation'] */ -$owner = get_user($vars['annotation']->owner_guid); +$annotation = $vars['annotation']; + +$owner = get_entity($annotation->owner_guid); +if (!$owner) { + return true; +} $icon = elgg_view_entity_icon($owner, 'tiny'); +$owner_link = "<a href=\"{$owner->getURL()}\">$owner->name</a>"; + +$delete_action = elgg_extract('delete_action', $vars, ''); + +$text = elgg_view("output/longtext", array("value" => $annotation->value)); + +$friendlytime = elgg_view_friendly_time($annotation->time_created); + +$delete_button = ''; +if ($delete_action && $annotation->canEdit()) { + $url = elgg_http_add_url_query_elements($delete_action, array( + 'annotation_id' => $annotation->id, + )); + $delete_button = elgg_view("output/confirmlink", array( + 'href' => $url, + 'text' => elgg_echo('delete'), + 'confirm' => elgg_echo('deleteconfirm') + )); + $delete_button = "<span class=\"elgg-button elgg-button-delete\">$delete_button</span>"; +} -$info = elgg_view("output/longtext", array("value" => $vars['annotation']->value)); +$body = <<<HTML +<div class="mbn"> + $delete_button + $owner_link + <span class="elgg-subtext"> + $friendlytime + </span> + $text +</div> +HTML; -echo elgg_view_image_block($icon, $info); +echo elgg_view_image_block($icon, $body); |