aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2013-02-09 08:43:52 -0500
committerCash Costello <cash.costello@gmail.com>2013-02-09 08:43:52 -0500
commit359571fec63b62a666413f507775aeb17cd55f37 (patch)
tree5c1d574f9c3843ad64db5cdc765b7904af9718cc
parent269d3621531a80b13221a2f6e663efe2ad20ccaa (diff)
downloadelgg-359571fec63b62a666413f507775aeb17cd55f37.tar.gz
elgg-359571fec63b62a666413f507775aeb17cd55f37.tar.bz2
Fixes #5052 using name for annotations and using correct class for export
-rw-r--r--engine/classes/ElggExtender.php2
-rw-r--r--engine/lib/annotations.php19
2 files changed, 11 insertions, 10 deletions
diff --git a/engine/classes/ElggExtender.php b/engine/classes/ElggExtender.php
index d94bad837..25aba354f 100644
--- a/engine/classes/ElggExtender.php
+++ b/engine/classes/ElggExtender.php
@@ -171,7 +171,7 @@ abstract class ElggExtender extends ElggData {
public function export() {
$uuid = get_uuid_from_object($this);
- $meta = new ODDMetadata($uuid, guid_to_uuid($this->entity_guid), $this->attributes['name'],
+ $meta = new ODDMetaData($uuid, guid_to_uuid($this->entity_guid), $this->attributes['name'],
$this->attributes['value'], $this->attributes['type'], guid_to_uuid($this->owner_guid));
$meta->setAttribute('published', date("r", $this->time_created));
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) {