You are here

function apachesolr_environment_edit_submit in Apache Solr Search 8

Same name and namespace in other branches
  1. 6.3 apachesolr.admin.inc \apachesolr_environment_edit_submit()
  2. 7 apachesolr.admin.inc \apachesolr_environment_edit_submit()

Submit handler for the environment edit page

_state

Parameters

array $form:

1 string reference to 'apachesolr_environment_edit_submit'
apachesolr_environment_edit_form in ./apachesolr.admin.inc
Form builder for adding/editing a Solr environment used as a menu callback.

File

./apachesolr.admin.inc, line 296
Administrative pages for the Apache Solr framework.

Code

function apachesolr_environment_edit_submit(array $form, array &$form_state) {
  apachesolr_environment_save($form_state['values']);
  if (!empty($form_state['values']['make_default'])) {
    apachesolr_set_default_environment($form_state['values']['env_id']);
  }
  cache_clear_all('apachesolr:environments', 'cache_apachesolr');
  drupal_set_message(t('The %name search environment has been saved.', array(
    '%name' => $form_state['values']['name'],
  )));
  if ($form_state['values']['op'] == t('Save')) {
    $form_state['redirect'] = 'admin/config/search/apachesolr/settings';
  }
  else {
    $form_state['redirect'] = current_path();
  }

  // Regardlessly of the destination parameter we want to go to another page
  unset($_GET['destination']);
  drupal_static_reset('drupal_get_destination');
  drupal_get_destination();
}