You are here

function apachesolr_search_delete_search_page_confirm_submit in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 apachesolr_search.admin.inc \apachesolr_search_delete_search_page_confirm_submit()
  2. 7 apachesolr_search.admin.inc \apachesolr_search_delete_search_page_confirm_submit()

Process content type delete confirm submissions.

File

./apachesolr_search.admin.inc, line 629
Administrative settings for searching.

Code

function apachesolr_search_delete_search_page_confirm_submit($form, &$form_state) {

  // Deletes the index configuration settings.
  // @todo Invoke a hook that allows backends and indexers to delete their stuff.
  if (!empty($form_state['values']['page_id'])) {
    $query = "DELETE FROM {apachesolr_search_page} WHERE page_id = '%s'";
    db_query($query, array(
      $form_state['values']['page_id'],
    ));

    // Sets message, logs action.
    drupal_set_message(t('The %label search page configuration has been deleted.', array(
      '%label' => $form_state['values']['label'],
    )));
    watchdog('Apache Solr', 'Deleted search page configuration "@page_id".', array(
      '@page_id' => $form_state['values']['page_id'],
    ), WATCHDOG_NOTICE);

    // Rebuilds the menu cache.
    menu_rebuild();
  }

  // Returns back to search page list page.
  $form_state['redirect'] = 'admin/settings/apachesolr/search-pages';
}