From 49b9a706d2dfa56312627887bdb8bedb0410ec8b Mon Sep 17 00:00:00 2001 From: marcus Date: Tue, 24 Jun 2008 12:13:03 +0000 Subject: Closes #82: OpenDD feeds in the same vein as RSS http://trac.elgg.org/elgg/ticket/82 git-svn-id: https://code.elgg.org/elgg/trunk@1100 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/export.php | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'engine/lib') 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); } -- cgit v1.2.3