diff options
Diffstat (limited to 'engine/lib')
-rw-r--r-- | engine/lib/export.php | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/engine/lib/export.php b/engine/lib/export.php index 22ab3f07a..69c7cb662 100644 --- a/engine/lib/export.php +++ b/engine/lib/export.php @@ -151,6 +151,23 @@ return false; } + function exportAsArray($guid) + { + + $guid = (int)$guid; + + // Initialise the array + $to_be_serialised = array(); + + // Trigger a hook to + $to_be_serialised = trigger_plugin_hook("export", "all", array("guid" => $guid), $to_be_serialised); + + // Sanity check + if ((!is_array($to_be_serialised)) || (count($to_be_serialised)==0)) throw new ExportException(sprintf(elgg_echo('ExportException:NoSuchEntity'), $guid)); + + return $to_be_serialised; + } + /** * Export a GUID. * @@ -166,18 +183,7 @@ */ function export($guid) { - $guid = (int)$guid; - - // Initialise the array - $to_be_serialised = array(); - - // Trigger a hook to - $to_be_serialised = trigger_plugin_hook("export", "all", array("guid" => $guid), $to_be_serialised); - - // Sanity check - if ((!is_array($to_be_serialised)) || (count($to_be_serialised)==0)) throw new ExportException(sprintf(elgg_echo('ExportException:NoSuchEntity'), $guid)); - - $odd = new ODDDocument($to_be_serialised); + $odd = new ODDDocument(exportAsArray($guid)); return ODD_Export($odd); } |