You are here

function search_api_admin_form_delete_submit in Search API 7

Form submission handler for search_api_admin_server_edit().

Handles the 'Delete' button on the server and index edit forms.

See also

search_api_admin_server_edit()

search_api_admin_index_edit()

2 string references to 'search_api_admin_form_delete_submit'
search_api_admin_index_edit in ./search_api.admin.inc
Form constructor for editing an index's settings.
search_api_admin_server_edit in ./search_api.admin.inc
Form constructor for editing a server's settings.

File

./search_api.admin.inc, line 684
Administration page callbacks for the Search API module.

Code

function search_api_admin_form_delete_submit($form, &$form_state) {
  $destination = array();
  if (isset($_GET['destination'])) {
    $destination = drupal_get_destination();
    unset($_GET['destination']);
  }
  if (isset($form_state['server'])) {
    $server = $form_state['server'];
    $form_state['redirect'] = array(
      'admin/config/search/search_api/server/' . $server->machine_name . '/delete',
      array(
        'query' => $destination,
      ),
    );
  }
  elseif (isset($form_state['index'])) {
    $index = $form_state['index'];
    $form_state['redirect'] = array(
      'admin/config/search/search_api/index/' . $index->machine_name . '/delete',
      array(
        'query' => $destination,
      ),
    );
  }
}