function webform_submission_delete_form_submit in Webform 7.3
Same name and namespace in other branches
- 5.2 webform_submissions.inc \webform_submission_delete_form_submit()
- 6.3 includes/webform.submissions.inc \webform_submission_delete_form_submit()
- 6.2 webform_submissions.inc \webform_submission_delete_form_submit()
- 7.4 includes/webform.submissions.inc \webform_submission_delete_form_submit()
File
- includes/
webform.submissions.inc, line 363 - This file is loaded when handling submissions, either submitting new, editing, or viewing. It also contains all CRUD functions for submissions.
Code
function webform_submission_delete_form_submit($form, &$form_state) {
$node = node_load($form_state['values']['details']['nid']);
$submission = webform_get_submission($form_state['values']['details']['nid'], $form_state['values']['details']['sid']);
webform_submission_delete($node, $submission);
drupal_set_message(t('Submission deleted.'));
$form_state['redirect'] = 'node/' . $node->nid . '/webform-results';
}