// 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();
    if (!$option_object->has_index_type_temporary()) {
        // No temporary index yet: display the form to create one.
        WpSolrExtensions::require_with(WpSolrExtensions::get_option_template_file(WpSolrExtensions::OPTION_MANAGED_SOLR_SERVERS, 'template-temporary-account-form.php'), array('managed_solr_service_id' => $form_data['managed_solr_service_id']['value'], 'response_error' => isset($response_object) && !OptionManagedSolrServer::is_response_ok($response_object) ? OptionManagedSolrServer::get_response_error_message($response_object) : '', 'google_recaptcha_site_key' => isset($google_recaptcha_site_key) ? $google_recaptcha_site_key : '', 'google_recaptcha_token' => isset($google_recaptcha_token) ? $google_recaptcha_token : '', 'total_nb_indexes' => $option_object->get_nb_indexes()));
    }
} else {
    // Verify that current subtab is a Solr index indice.
    if (!$option_object->has_index($subtab)) {
        // Use the first subtab element
        $subtab = key($subtabs);
    }
}
?>