node_multiple_delete_confirm

  1. drupal
    1. 4.7
    2. 5 node.module
    3. 6 node.admin.inc
    4. 7 node.admin.inc
Versions
4.7 – 5 node_multiple_delete_confirm()
6 node_multiple_delete_confirm(&$form_state, $nodes)
7 node_multiple_delete_confirm($form, &$form_state, $nodes)

Code

modules/node.module, line 1223

<?php
function node_multiple_delete_confirm() {
  $edit = $_POST['edit'];

  $form['nodes'] = array(
    '#prefix' => '<ul>',
    '#suffix' => '</ul>',
    '#tree' => TRUE,
  );
  // array_filter returns only elements with true values
  foreach (array_filter($edit['nodes']) as $nid => $value) {
    $title = db_result(db_query('SELECT title FROM {node} WHERE nid = %d', $nid));
    $form['nodes'][$nid] = array(
      '#type' => 'hidden',
      '#value' => $nid,
      '#prefix' => '<li>',
      '#suffix' => check_plain($title) . "</li>\n",
    );
  }
  $form['operation'] = array(
    '#type' => 'hidden',
    '#value' => 'delete',
  );

  return confirm_form('node_multiple_delete_confirm', $form, 
                      t('Are you sure you want to delete these items?'), 
                      'admin/node', t('This action cannot be undone.'), 
                      t('Delete all'), t('Cancel'));
}
?>