diff options
author | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 01:24:37 +0000 |
---|---|---|
committer | cash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2011-03-01 01:24:37 +0000 |
commit | 3237b492070d6deb54b59353f5a566946361d776 (patch) | |
tree | 2c55266ca3bae58ab635906a75ba4caa057e2dab /views/default/annotation | |
parent | 2a1ef15bcd4a315f2eb64bfed7953768648d2ab7 (diff) | |
download | elgg-3237b492070d6deb54b59353f5a566946361d776.tar.gz elgg-3237b492070d6deb54b59353f5a566946361d776.tar.bz2 |
improved the default annotation view
git-svn-id: http://code.elgg.org/elgg/trunk@8513 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'views/default/annotation')
-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); |