function handleImport(&$context, &$doc, &$errors, &$papers, $isCommandLine) { $errors = array(); $papers = array(); $user =& $context['user']; $conference =& $context['conference']; $schedConf =& $context['schedConf']; $rootNodeName = $this->getRootNodeName($doc); $this->import('NativeImportDom'); switch ($rootNodeName) { case 'papers': $track =& $context['track']; return NativeImportDom::importPapers($conference, $schedConf, $doc->children, $track, $papers, $errors, $user, $isCommandLine); break; case 'paper': $track =& $context['track']; $result = NativeImportDom::importPaper($conference, $schedConf, $doc, $track, $paper, $errors, $user, $isCommandLine); if ($result) { $papers = array($paper); } return $result; break; default: $errors[] = array('plugins.importexport.native.import.error.unsupportedRoot', array('rootName' => $rootNodeName)); return false; break; } }