From 72559075c3ae983e707003c12b6425ec5938ea3f Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 28 May 2008 16:12:01 +0000 Subject: Marcus Povey * Import now does simple checks for failure git-svn-id: https://code.elgg.org/elgg/trunk@751 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/export.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engine') 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 -- cgit v1.2.3