diff options
author | Brett Profitt <brett.profitt@gmail.com> | 2011-08-24 17:06:39 -0700 |
---|---|---|
committer | Brett Profitt <brett.profitt@gmail.com> | 2011-08-24 17:06:39 -0700 |
commit | 946a4a008ab2bc3f3a530558ae47581f9d8fbbcb (patch) | |
tree | 069a3f49d498f2f81dfd6b36a61090d517fea57f /engine | |
parent | b1cbcfa842abf670c2b5805eb45bc8314836bb2d (diff) | |
download | elgg-946a4a008ab2bc3f3a530558ae47581f9d8fbbcb.tar.gz elgg-946a4a008ab2bc3f3a530558ae47581f9d8fbbcb.tar.bz2 |
Refs #3750. Added annotation menu for generic comments (delete) and default annotations (empty).
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/navigation.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/engine/lib/navigation.php b/engine/lib/navigation.php index 1305ee3de..cefe40ecf 100644 --- a/engine/lib/navigation.php +++ b/engine/lib/navigation.php @@ -373,12 +373,38 @@ function elgg_entity_menu_setup($hook, $type, $return, $params) { } /** + * Adds a delete link to "generic_comment" annotations + */ +function elgg_annotation_menu_setup($hook, $type, $return, $params) { + $annotation = $params['annotation']; + + if ($annotation->name == 'generic_comment' && $annotation->canEdit()) { + $url = elgg_http_add_url_query_elements('action/comments/delete', array( + 'annotation_id' => $annotation->id, + )); + + $options = array( + 'name' => 'delete', + 'href' => $url, + 'text' => "<span class=\"elgg-icon elgg-icon-delete\"></span>", + 'confirm' => elgg_echo('deleteconfirm'), + 'text_encode' => false + ); + $return[] = ElggMenuItem::factory($options); + } + + return $return; +} + + +/** * Navigation initialization */ function elgg_nav_init() { elgg_register_plugin_hook_handler('prepare', 'menu:site', 'elgg_site_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:river', 'elgg_river_menu_setup'); elgg_register_plugin_hook_handler('register', 'menu:entity', 'elgg_entity_menu_setup'); + elgg_register_plugin_hook_handler('register', 'menu:annotation', 'elgg_annotation_menu_setup'); } elgg_register_event_handler('init', 'system', 'elgg_nav_init'); |