<?php /** * Elgg Message board: delete message action * * @package ElggMessageBoard */ $annotation_id = (int) get_input('annotation_id'); $message = elgg_get_annotation_from_id($annotation_id); if ($message && $message->canEdit() && $message->delete()) { remove_from_river_by_annotation($annotation_id); system_message(elgg_echo("messageboard:deleted")); } else { system_message(elgg_echo("messageboard:notdeleted")); } forward(REFERER);
/** * Delete the annotation. * * @return bool */ function delete() { remove_from_river_by_annotation($this->id); return elgg_delete_metastring_based_object_by_id($this->id, 'annotations'); }
/** * Delete a given annotation. * * @param $id int The id */ function delete_annotation($id) { global $CONFIG; $id = (int) $id; $access = get_access_sql_suffix(); $annotation = get_annotation($id); if (trigger_elgg_event('delete', 'annotation', $annotation)) { remove_from_river_by_annotation($id); return delete_data("DELETE from {$CONFIG->dbprefix}annotations where id={$id} and {$access}"); } return FALSE; }