* @license COPYING, http://www.gnu.org/licenses/agpl * * Copyright 2012 Lorea Faeries * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public * License along with this program. If not, see * . */ elgg_register_event_handler('init', 'system', 'editablecomments_init'); /** * Initialise the editable comments plugin */ function editablecomments_init() { $actions_dir = elgg_get_plugins_path() . "editablecomments/actions/comments"; elgg_register_action('comments/edit', "$actions_dir/edit.php"); elgg_register_plugin_hook_handler('register', 'menu:annotation', 'editablecomments_annotation_menu'); } function editablecomments_annotation_menu($hook, $type, $return, $params) { $annotation = $params['annotation']; $id = $annotation->id; if ($annotation->canEdit()) { $return[] = new ElggMenuItem('edit_annotation', elgg_echo('edit'), "#edit-annotation-$id"); } return $return; }