function sbp_paths_delete_confirm_submit in Search by Page 6
Same name and namespace in other branches
- 7 sbp_paths.module \sbp_paths_delete_confirm_submit()
Submit callback for sbp_paths_delete_confirm().
Actually deletes the path.
File
- ./
sbp_paths.module, line 489 - 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_query('DELETE FROM {sbpp_path} WHERE pid=%d', $pid);
$environment = intval($form_state['values']['environment']);
search_by_page_force_remove('sbp_paths', $pid, $environment);
// Go back to paths page
$form_state['redirect'] = 'admin/settings/search_by_page/edit/' . $environment . '/paths';
}