diff options
author | Cash Costello <cash.costello@gmail.com> | 2013-02-09 08:43:52 -0500 |
---|---|---|
committer | Cash Costello <cash.costello@gmail.com> | 2013-02-09 08:43:52 -0500 |
commit | 359571fec63b62a666413f507775aeb17cd55f37 (patch) | |
tree | 5c1d574f9c3843ad64db5cdc765b7904af9718cc /engine/lib | |
parent | 269d3621531a80b13221a2f6e663efe2ad20ccaa (diff) | |
download | elgg-359571fec63b62a666413f507775aeb17cd55f37.tar.gz elgg-359571fec63b62a666413f507775aeb17cd55f37.tar.bz2 |
Fixes #5052 using name for annotations and using correct class for export
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/annotations.php | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/engine/lib/annotations.php b/engine/lib/annotations.php index e5566a00a..41a736aa1 100644 --- a/engine/lib/annotations.php +++ b/engine/lib/annotations.php @@ -441,20 +441,20 @@ function elgg_list_entities_from_annotation_calculation($options) { } /** - * Handler called by trigger_plugin_hook on the "export" event. + * Export the annotations for the specified entity * * @param string $hook 'export' - * @param string $entity_type 'all' + * @param string $type 'all' * @param mixed $returnvalue Default return value - * @param mixed $params List of params to export + * @param mixed $params Parameters determining what annotations to export * * @elgg_plugin_hook export all * - * @return mixed + * @return array * @throws InvalidParameterException * @access private */ -function export_annotation_plugin_hook($hook, $entity_type, $returnvalue, $params) { +function export_annotation_plugin_hook($hook, $type, $returnvalue, $params) { // Sanity check values if ((!is_array($params)) && (!isset($params['guid']))) { throw new InvalidParameterException(elgg_echo('InvalidParameterException:GUIDNotForExport')); @@ -465,11 +465,12 @@ function export_annotation_plugin_hook($hook, $entity_type, $returnvalue, $param } $guid = (int)$params['guid']; + $options = array('guid' => $guid, 'limit' => 0); + if (isset($params['name'])) { + $options['annotation_name'] = $params['name']; + } - $result = elgg_get_annotations(array( - 'guid' => $guid, - 'limit' => 0, - )); + $result = elgg_get_annotations($options); if ($result) { foreach ($result as $r) { |