Ejemplo n.º 1
0
 /**
  * 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>';
         }
     }
 }
Ejemplo n.º 2
0
?>

<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>&lt;knowledgebase version="1.0"&gt;
  &lt;document title="First File" src="first.html" category="category1" order="1"&gt;
  &lt;/document&gt;
  &lt;document title="Second File" src="second.html" category="category2" order="0"&gt;
    &lt;document title="Nested File" src="third.html" category="category2,category3" order="3"&gt;
    &lt;/document&gt;
  &lt;/document&gt;
&lt;/knowledgebase&gt;</pre>
		</div>