You are here

function auditfiles_multiple_delete_confirm in Audit Files 5

Same name and namespace in other branches
  1. 6.3 notindb.admin.inc \auditfiles_multiple_delete_confirm()
  2. 6.2 notindb.admin.inc \auditfiles_multiple_delete_confirm()

Form action: Confirm deletion of selected items

1 string reference to 'auditfiles_multiple_delete_confirm'
auditfiles_notindb in ./auditfiles.module
Menu callback; audit files not in the database.

File

./auditfiles.module, line 330

Code

function auditfiles_multiple_delete_confirm() {
  $edit = $_POST;
  $form['files'] = array(
    '#prefix' => '<ul>',
    '#suffix' => '</ul>',
    '#tree' => TRUE,
  );

  // array_filter returns only elements with TRUE values
  foreach (array_filter($edit['files']) as $file) {
    $form['files'][$file] = array(
      '#type' => 'hidden',
      '#value' => $file,
      '#prefix' => '<li>',
      '#suffix' => check_plain($file) . "</li>\n",
    );
  }
  $form['operation'] = array(
    '#type' => 'hidden',
    '#value' => 'delete',
  );
  return confirm_form($form, t('Are you sure you want to delete these items?'), 'admin/logs/auditfiles/notindb', '<strong>' . t('This action cannot be undone.') . '</strong>', t('Delete all'), t('Cancel'));
}