You are here

function webform_submission_delete_form in Webform 7.4

Same name and namespace in other branches
  1. 5.2 webform_submissions.inc \webform_submission_delete_form()
  2. 6.3 includes/webform.submissions.inc \webform_submission_delete_form()
  3. 6.2 webform_submissions.inc \webform_submission_delete_form()
  4. 7.3 includes/webform.submissions.inc \webform_submission_delete_form()

Confirm form to delete a single form submission.

Parameters

$form: The new form array.

$form_state: The current form state.

$node: The node for which this webform was submitted.

$submission: The submission to be deleted (from webform_submitted_data).

1 string reference to 'webform_submission_delete_form'
webform_menu in ./webform.module
Implements hook_menu().

File

includes/webform.submissions.inc, line 449
Submission handling functions.

Code

function webform_submission_delete_form($form, $form_state, $node, $submission) {
  webform_set_breadcrumb($node, $submission);

  // Set the correct page title.
  drupal_set_title(webform_submission_title($node, $submission));

  // Keep the NID and SID in the same location as the webform_client_form().
  $form['#tree'] = TRUE;
  $form['details']['nid'] = array(
    '#type' => 'value',
    '#value' => $node->nid,
  );
  $form['details']['sid'] = array(
    '#type' => 'value',
    '#value' => $submission->sid,
  );
  $question = t('Are you sure you want to delete this submission?');
  return confirm_form($form, NULL, "node/{$node->nid}/submission/{$submission->sid}", $question, t('Delete'), t('Cancel'));
}