diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-08-25 10:00:38 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-08-25 10:00:38 -0700 |
commit | dccc333c765bb28da55b4a55d9c916acdb88413a (patch) | |
tree | bdd26a0b4cd85241a19b7fcb2c0770f0ac3eb9f0 /views/default/annotation | |
parent | ec7b94a64aef23b85866ecdac8e8acc712d29bb6 (diff) | |
parent | 003cb81c7888f4d2fd763e5814027c6f8d71186f (diff) | |
download | elgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.gz elgg-dccc333c765bb28da55b4a55d9c916acdb88413a.tar.bz2 |
Merge branch 'master' of github.com:brettp/Elgg
Diffstat (limited to 'views/default/annotation')
-rw-r--r-- | views/default/annotation/default.php | 25 | ||||
-rw-r--r-- | views/default/annotation/generic_comment.php | 18 |
2 files changed, 14 insertions, 29 deletions
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 = "<a href=\"{$owner->getURL()}\">$owner->name</a>"; -$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' => "<span class=\"elgg-icon elgg-icon-delete right\"></span>", - 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, - )); -} - $body = <<<HTML <div class="mbn"> - $delete_button + $menu $owner_link <span class="elgg-subtext"> $friendlytime diff --git a/views/default/annotation/generic_comment.php b/views/default/annotation/generic_comment.php index 69520d102..a4fbf904e 100644 --- a/views/default/annotation/generic_comment.php +++ b/views/default/annotation/generic_comment.php @@ -29,23 +29,17 @@ $entity_title = $entity->title ? $entity->title : elgg_echo('untitled'); $entity_link = "<a href=\"{$entity->getURL()}\">$entity_title</a>"; if ($full_view) { - - $delete_button = ''; - if ($comment->canEdit()) { - $url = "action/comments/delete?annotation_id=$comment->id"; - $delete_button = elgg_view("output/confirmlink", array( - 'href' => $url, - 'text' => "<span class=\"elgg-icon elgg-icon-delete right\"></span>", - 'confirm' => elgg_echo('deleteconfirm'), - 'text_encode' => false, - )); - } + $menu = elgg_view_menu('annotation', array( + 'annotation' => $comment, + 'sort_by' => 'priority', + 'class' => 'elgg-menu-hz right', + )); $comment_text = elgg_view("output/longtext", array("value" => $comment->value)); $body = <<<HTML <div class="mbn"> - $delete_button + $menu $commenter_link <span class="elgg-subtext"> $friendlytime |