* Deprecated get_entities_from_annotations(). Use elgg_get_entities_from_annotations().
* Reorganized directory file path to rely on GUID instead of username.
* annotation_id column added to the river database table.
+ * remove_from_river_by_annotation() added.
* unregister_elgg_event_handler() and unregister_plugin_hook() added. #1465
Services API:
$annotation = get_annotation($id);
if (trigger_elgg_event('delete', 'annotation', $annotation)) {
- return delete_data("DELETE from {$CONFIG->dbprefix}annotations where id=$id and $access");
+ remove_from_river_by_annotation($id);
+ return delete_data("DELETE from {$CONFIG->dbprefix}annotations where id=$id and $access");
}
- return false;
+ return FALSE;
}
/**
}
/** Register the hook */
-register_plugin_hook("export", "all", "export_annotation_plugin_hook", 2);
\ No newline at end of file
+register_plugin_hook("export", "all", "export_annotation_plugin_hook", 2);
return delete_data("delete from {$CONFIG->dbprefix}river where object_guid = {$object_guid}");
}
+/**
+ * Removes all items relating to a particular annotation being acted upon from the river
+ *
+ * @param int annotation_id The ID of the annotation
+ * @return true|false Depending on success
+ */
+function remove_from_river_by_annotation($annotation_id) {
+ // Sanitise
+ $annotation_id = (int) $annotation_id;
+
+ // Load config
+ global $CONFIG;
+
+ // Remove
+ return delete_data("delete from {$CONFIG->dbprefix}river where annotation_id = {$annotation_id}");
+}
+
/**
* Sets the access ID on river items for a particular object
*
}
return '';
-}
\ No newline at end of file
+}