4.7.x system.module confirm_form($form_id, $form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm')
5.x system.module confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm')
6.x system.module confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm')
7.x system.module confirm_form($form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm')
23 calls to confirm_form()
aggregator_admin_remove_feed in modules/aggregator.module
block_box_delete in modules/block.module
Menu callback; confirm deletion of custom blocks.
comment_delete in modules/comment.module
Menu callback; delete a comment.
comment_multiple_delete_confirm in modules/comment.module
List the selected comments and verify that the admin really wants to delete them.
contact_admin_delete in modules/contact.module
Category delete page.

... See full list

File

modules/system.module, line 1263
Configuration system that lets administrators modify the workings of the site.

Code

function confirm_form($form_id, $form, $question, $path, $description = NULL, $yes = NULL, $no = NULL, $name = 'confirm') {

  $description = ($description) ? $description : t('This action cannot be undone.');
  drupal_set_title($question);
  $form['#attributes'] = array('class' => 'confirmation');
  $form['description'] = array('#value' => $description);
  $form[$name] = array('#type' => 'hidden', '#value' => 1);

  $form['actions'] = array('#prefix' => '<div class="container-inline">', '#suffix' => '</div>');
  $form['actions']['submit'] = array('#type' => 'submit', '#value' => $yes ? $yes : t('Confirm'));
  $form['actions']['cancel'] = array('#value' => l($no ? $no : t('Cancel'), $path));
  return drupal_get_form($form_id, $form, 'confirm_form');
}