You are here

function apachesolr_delete_index_confirm_submit in Apache Solr Search 6

Same name and namespace in other branches
  1. 5.2 apachesolr.admin.inc \apachesolr_delete_index_confirm_submit()
  2. 6.2 apachesolr.admin.inc \apachesolr_delete_index_confirm_submit()

Submit function for the "Delete the index" confirmation form.

See also

apachesolr_delete_index_confirm()

File

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

Code

function apachesolr_delete_index_confirm_submit($form, &$form_state) {
  $form_state['redirect'] = 'admin/settings/apachesolr/index';
  try {
    apachesolr_delete_index();

    // This form can't be seen by anyone without 'administer search'
    // permission, so no need to check perms before displaying a run-cron link.
    drupal_set_message(t('The Apache Solr content index has been erased. You must now !run_cron until your entire site has been re-indexed.', array(
      '!run_cron' => l(t('run cron'), 'admin/reports/status/run-cron', array(
        'query' => array(
          'destination' => 'admin/settings/apachesolr/index',
        ),
      )),
    )));
  } catch (Exception $e) {
    watchdog('Apache Solr', nl2br(check_plain($e
      ->getMessage())), NULL, WATCHDOG_ERROR);
  }
}