diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 12:13:03 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-24 12:13:03 +0000 |
commit | 49b9a706d2dfa56312627887bdb8bedb0410ec8b (patch) | |
tree | 68b4be599b196fceed25794850865b40b976940a /engine/lib | |
parent | 25206b3e3ca84573cde7598b5e8d92283d2701d5 (diff) | |
download | elgg-49b9a706d2dfa56312627887bdb8bedb0410ec8b.tar.gz elgg-49b9a706d2dfa56312627887bdb8bedb0410ec8b.tar.bz2 |
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
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); } |