You are here

function sbp_paths_delete_confirm_submit in Search by Page 7

Same name and namespace in other branches
  1. 6 sbp_paths.module \sbp_paths_delete_confirm_submit()

Submit callback for sbp_paths_delete_confirm().

Actually deletes the path.

File

./sbp_paths.module, line 517
Module file for Search by Page Paths, a sub-module for Search by Page.

Code

function sbp_paths_delete_confirm_submit($form, &$form_state) {
  if (!$form_state['values']['confirm']) {
    return;
  }
  $pid = $form_state['values']['pid'];
  if (!$pid) {
    return;
  }

  // Remove it from our database, and also from current search index
  db_delete('sbpp_path')
    ->condition('pid', $pid)
    ->execute();
  $environment = intval($form_state['values']['environment']);
  search_by_page_force_remove('sbp_paths', $pid, $environment);

  // Go back to paths page
  $form_state['redirect'] = 'admin/config/search/search_by_page/edit/' . $environment . '/paths';
}