From 946a4a008ab2bc3f3a530558ae47581f9d8fbbcb Mon Sep 17 00:00:00 2001 From: Brett Profitt Date: Wed, 24 Aug 2011 17:06:39 -0700 Subject: Refs #3750. Added annotation menu for generic comments (delete) and default annotations (empty). --- views/default/annotation/default.php | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'views/default/annotation/default.php') diff --git a/views/default/annotation/default.php b/views/default/annotation/default.php index a21fdee51..0e626ad9a 100644 --- a/views/default/annotation/default.php +++ b/views/default/annotation/default.php @@ -2,9 +2,9 @@ /** * Elgg default annotation view * + * @note To add or remove from the annotation menu, register handlers for the menu:annotation hook. + * * @uses $vars['annotation'] - * @uses $vars['delete_action'] A custom action for the delete button. - * The annotation ID is passed as 'annotation_id'. */ $annotation = $vars['annotation']; @@ -16,28 +16,19 @@ if (!$owner) { $icon = elgg_view_entity_icon($owner, 'tiny'); $owner_link = "getURL()}\">$owner->name"; -$delete_action = elgg_extract('delete_action', $vars, ''); +$menu = elgg_view_menu('annotation', array( + 'annotation' => $annotation, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz right', +)); $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' => "", - 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, - )); -} - $body = << - $delete_button + $menu $owner_link $friendlytime -- cgit v1.2.3