/** * Determines if the import is an XML or flare index and ensures it is imported accordingly. * * @param $filePath * @param \html_import\admin\HtmlImportSettings $settings */ private function routeImportToCorrectImporter($filePath, html_import\admin\HtmlImportSettings $settings) { $importType = $settings->getIndexType()->getValue(); if (strcmp('flare', $importType) == 0) { $this->import_html_from_flare($filePath, $settings); } else { if (strcmp('xml', $importType) == 0) { $this->import_html_from_xml_index($filePath, $settings); } else { echo '*** Unsupported import type: ' . $importType . '<br>'; } } }
?> <div class="wrap"> <h2><?php echo esc_html(get_admin_page_title()); ?> </h2> <form enctype="multipart/form-data" method="post" action=""> <p id="index-type"> <h3>Select the type of import index</h3> <label for="index-type-xml"><input type="radio" name="index-type" id="index-type-xml" value="xml" <?php checked(strcmp('xml', $settings->getIndexType()->getValue()), 0, true); ?> />Confluence XML</label><br> <a href="#" target="_self" id="showXML" onclick="javascript: jQuery('#showXML').hide('fast'); jQuery('#hideXML').show('fast'); jQuery('#SampleXML').show('fast');">Show XML Example</a> <a href="#" target="_self" id="hideXML" style="display:none;" onclick="javascript: jQuery('#showXML').show('fast'); jQuery('#hideXML').hide('fast'); jQuery('#SampleXML').hide('fast');">Hide XML Example</a> <div id="SampleXML" style="display:none;"> <pre><knowledgebase version="1.0"> <document title="First File" src="first.html" category="category1" order="1"> </document> <document title="Second File" src="second.html" category="category2" order="0"> <document title="Nested File" src="third.html" category="category2,category3" order="3"> </document> </document> </knowledgebase></pre> </div>