diff options
-rw-r--r-- | engine/lib/export.php | 30 | ||||
-rw-r--r-- | views/odd/export/entity.php | 5 | ||||
-rw-r--r-- | views/odd/export/metadata.php | 8 | ||||
-rw-r--r-- | views/odd/export/relationship.php | 8 | ||||
-rw-r--r-- | views/odd/pageshells/pageshell.php | 10 |
5 files changed, 40 insertions, 21 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); } diff --git a/views/odd/export/entity.php b/views/odd/export/entity.php index d6efd413c..a147a707a 100644 --- a/views/odd/export/entity.php +++ b/views/odd/export/entity.php @@ -12,5 +12,8 @@ */ $entity = $vars['entity']; - echo export($entity->guid); + $serialised = exportAsArray($vars['entity']->guid); + foreach ($serialised as $s) + echo $s; + ?>
\ No newline at end of file diff --git a/views/odd/export/metadata.php b/views/odd/export/metadata.php index dff62086a..e6f74e2d2 100644 --- a/views/odd/export/metadata.php +++ b/views/odd/export/metadata.php @@ -14,8 +14,10 @@ $m = $vars['metadata']; $uuid = $vars['uuid']; - $odd = new ODDDocument(); - $odd->addElement($m->export()); + //$odd = new ODDDocument(); + //$odd->addElement($m->export()); - echo $odd; + //echo $odd; + + echo $m->export(); ?>
\ No newline at end of file diff --git a/views/odd/export/relationship.php b/views/odd/export/relationship.php index 85387a273..28b3026d5 100644 --- a/views/odd/export/relationship.php +++ b/views/odd/export/relationship.php @@ -13,8 +13,10 @@ $r = $vars['relationship']; - $odd = new ODDDocument(); - $odd->addElement($r->export()); + //$odd = new ODDDocument(); + //$odd->addElement($r->export()); - echo $odd; + //echo $odd; + + echo $r->export(); ?>
\ No newline at end of file diff --git a/views/odd/pageshells/pageshell.php b/views/odd/pageshells/pageshell.php index 93b3e3185..92c11eadc 100644 --- a/views/odd/pageshells/pageshell.php +++ b/views/odd/pageshells/pageshell.php @@ -12,5 +12,11 @@ */ header("Content-Type: text/xml"); - echo $vars['body']; -?>
\ No newline at end of file + + +?> +<odd> +<?php +echo $vars['body']; +?> +</odd>
\ No newline at end of file |