You are here

function apachesolr_multilingual_environment_edit_form_submit in Apache Solr Multilingual 6.3

Same name and namespace in other branches
  1. 7 apachesolr_multilingual.module \apachesolr_multilingual_environment_edit_form_submit()
1 string reference to 'apachesolr_multilingual_environment_edit_form_submit'
apachesolr_multilingual_form_apachesolr_environment_edit_form_alter in ./apachesolr_multilingual.module
Implements hook_form_alter().

File

./apachesolr_multilingual.module, line 833
Multilingual search using Apache Solr.

Code

function apachesolr_multilingual_environment_edit_form_submit($form, &$form_state) {
  $environment = apachesolr_multilingual_environment_load($form['env_id']['#value']);
  $reindex = FALSE;
  if ($form_state['values']['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_map_language_neutral'] != $environment['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_map_language_neutral']) {
    $reindex = TRUE;
  }
  if ($form_state['values']['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_translations'] != $environment['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_translations']) {
    $reindex = TRUE;
  }
  if ($form_state['values']['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_unpublished_translations'] != $environment['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_unpublished_translations']) {
    $reindex = TRUE;
  }
  if ($form_state['values']['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_term_translations'] != $environment['conf']['apachesolr_multilingual_index_settings']['apachesolr_multilingual_clir']['apachesolr_multilingual_index_term_translations']) {
    $reindex = TRUE;
  }
  if ($reindex) {
    drupal_set_message(t('The changes requires you to !link_reindex your content.', array(
      '!link_reindex' => l(t('re-index'), 'admin/settings/apachesolr/settings/' . $form['env_id']['#default_value'] . '/index'),
    )), 'warning');
  }
}