<div class="wdm_note"> Each language must be stored, and queried, on it's own Solr index.<br/> - Language awareness: each language can be configured with it's own schema.xml: language specific filters, analysers, stemmers .... <br/> - Easy to understand: each schema.xml has the same stucture, except for the language specific settings <br/> - Fully featured: autocompletion and suggestions work out of the box by language <br/> - Custom: each language can have a totally custom schema.xml if necessary <br/> </div> <?php $option_indexes = new OptionIndexes(); $solr_indexes = $option_indexes->get_indexes(); $languages = $ml_plugin->get_languages(); foreach ($solr_indexes as $solr_index_indice => $solr_index) { ?> <div class="wdm_row"> <div class='col_left'> Solr index '<?php echo $solr_index['index_name']; ?> ' </div> <div class='col_right'> Is indexing: <select name='<?php
?> <?php global $response_object, $google_recaptcha_site_key, $google_recaptcha_token; $is_submit_button_form_temporary_index = isset($_POST['submit_button_form_temporary_index']); $form_data = WpSolrExtensions::extract_form_data($is_submit_button_form_temporary_index, array('managed_solr_service_id' => array('default_value' => '', 'can_be_empty' => false))); ?> <div id="solr-hosting-tab"> <?php // Options data. Loaded after the POST, to be sure it contains the posted data. $option_data = OptionIndexes::get_option_data(WpSolrExtensions::OPTION_INDEXES); $subtabs = array(); // Create the tabs from the Solr indexes already configured foreach ($option_object->get_indexes() as $index_indice => $index) { $subtabs[$index_indice] = isset($index['index_name']) ? $index['index_name'] : 'Index with no name'; } $subtabs['new_index'] = count($option_object->get_indexes()) > 0 ? $license_manager->show_premium_link(OptionLicenses::LICENSE_PACKAGE_CORE, 'Configure another index', false) : 'Configure your first index'; // Create subtabs on the left side $subtab = wpsolr_admin_sub_tabs($subtabs); ?> <div id="solr-results-options" class="wdm-vertical-tabs-content"> <?php $is_new_index = false; if ('new_index' === $subtab) { $is_new_index = true; $subtab = $option_object->generate_uuid(); $option_data['solr_indexes'][$subtab] = array();
function wpsolr_admin_tabs($current = 'solr_indexes') { // Get default search solr index indice WpSolrExtensions::require_once_wpsolr_extension(WpSolrExtensions::OPTION_INDEXES, true); $option_indexes = new OptionIndexes(); $default_search_solr_index = $option_indexes->get_default_search_solr_index(); $nb_indexes = count($option_indexes->get_indexes()); $are_there_indexes = $nb_indexes > 0; $tabs = array(); $tabs['solr_indexes'] = $are_there_indexes ? '1. Define your Solr Indexes' : '1. Define your Solr Index'; if ($are_there_indexes) { $tabs['solr_option'] = sprintf("2. Define your search with '%s'", !isset($default_search_solr_index) ? $are_there_indexes ? "<span class='text_error'>No index selected</span>" : '' : $option_indexes->get_index_name($default_search_solr_index)); $tabs['solr_plugins'] = '3. Define which plugins to work with'; $tabs['solr_operations'] = '4. Send your data'; } echo '<div id="icon-themes" class="icon32"><br></div>'; echo '<h2 class="nav-tab-wrapper">'; foreach ($tabs as $tab => $name) { $class = $tab == $current ? ' nav-tab-active' : ''; echo "<a class='nav-tab{$class}' href='admin.php?page=solr_settings&tab={$tab}'>{$name}</a>"; } echo '</h2>'; }
?> <?php global $response_object, $google_recaptcha_site_key, $google_recaptcha_token; $is_submit_button_form_temporary_index = isset($_POST['submit_button_form_temporary_index']); $form_data = WpSolrExtensions::extract_form_data($is_submit_button_form_temporary_index, array('managed_solr_service_id' => array('default_value' => '', 'can_be_empty' => false))); ?> <div id="solr-hosting-tab"> <?php // Options data. Loaded after the POST, to be sure it contains the posted data. $option_data = OptionIndexes::get_option_data(WpSolrExtensions::OPTION_INDEXES); $subtabs = array(); // Create the tabs from the Solr indexes already configured foreach ($option_object->get_indexes() as $index_indice => $index) { $subtabs[$index_indice] = isset($index['index_name']) ? $index['index_name'] : 'Index with no name'; } $subtabs['new_index'] = count($option_object->get_indexes()) > 0 ? 'Configure another index' : 'Configure your first index'; // Create subtabs on the left side $subtab = wpsolr_admin_sub_tabs($subtabs); ?> <div id="solr-results-options" class="wdm-vertical-tabs-content"> <?php $is_new_index = false; if ('new_index' === $subtab) { $is_new_index = true; $subtab = $option_object->generate_uuid(); $option_data['solr_indexes'][$subtab] = array();