You are here

function apachesolr_environment_edit_test_submit in Apache Solr Search 8

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

Submit handler for the test button in the environment edit page

_state

Parameters

array $form:

1 string reference to 'apachesolr_environment_edit_test_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 251
Administrative pages for the Apache Solr framework.

Code

function apachesolr_environment_edit_test_submit(array $form, array &$form_state) {
  $ping = apachesolr_server_status($form_state['values']['url'], $form_state['values']['service_class']);
  if ($ping) {
    drupal_set_message(t('Your site has contacted the Apache Solr server.'));
  }
  else {
    drupal_set_message(t('Your site was unable to contact the Apache Solr server.'), 'error');
  }
  $form_state['rebuild'] = TRUE;
}