aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 16:12:01 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-28 16:12:01 +0000
commit72559075c3ae983e707003c12b6425ec5938ea3f (patch)
tree2f2ad1892a48cfb66ecfd1fecf60cfa9cd0cd91d
parent684996f42d9691834b39c316bdd8ac22a716dd45 (diff)
downloadelgg-72559075c3ae983e707003c12b6425ec5938ea3f.tar.gz
elgg-72559075c3ae983e707003c12b6425ec5938ea3f.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Import now does simple checks for failure git-svn-id: https://code.elgg.org/elgg/trunk@751 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--engine/lib/export.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/engine/lib/export.php b/engine/lib/export.php
index 4953fab91..b0d7ae3a5 100644
--- a/engine/lib/export.php
+++ b/engine/lib/export.php
@@ -198,6 +198,8 @@
$IMPORTED_OBJECT_COUNTER = 0;
$document = ODD_Import($xml);
+ if (!$document)
+ throw new ImportException("No OpenDD elements found in import data, import failed.");
foreach ($document as $element)
__process_element($element);
@@ -207,5 +209,18 @@
return true;
}
+
+
+ /**
+ * Register the OpenDD import action
+ */
+ function export_init()
+ {
+ global $CONFIG;
+
+ register_action("import/odd", false);
+ }
+ // Register a startup event
+ register_event_handler('init','system','export_init',100);
?> \ No newline at end of file