You are here

function node_multiple_delete_confirm in Drupal 6

Same name and namespace in other branches
  1. 4 modules/node.module \node_multiple_delete_confirm()
  2. 5 modules/node/node.module \node_multiple_delete_confirm()
  3. 7 modules/node/node.admin.inc \node_multiple_delete_confirm()
1 call to node_multiple_delete_confirm()
node_admin_content in modules/node/node.admin.inc
Menu callback: content administration.

File

modules/node/node.admin.inc, line 594
Content administration and module settings UI.

Code

function node_multiple_delete_confirm(&$form_state, $nodes) {
  $form['nodes'] = array(
    '#prefix' => '<ul>',
    '#suffix' => '</ul>',
    '#tree' => TRUE,
  );

  // array_filter returns only elements with TRUE values
  foreach ($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',
  );
  $form['#submit'][] = 'node_multiple_delete_confirm_submit';
  return confirm_form($form, t('Are you sure you want to delete these items?'), 'admin/content/node', t('This action cannot be undone.'), t('Delete all'), t('Cancel'));
}