You are here

function variablecheck_delete_confirm in Variable Check 7

Confirm to delete specified variables.

1 call to variablecheck_delete_confirm()
variablecheck_check_variables_form in ./variablecheck.module
Helper that displays a form which allows users to delete variables that fail to unserialize, causing ugly Notices on production sites.

File

./variablecheck.module, line 156

Code

function variablecheck_delete_confirm($form, &$form_state, $variables) {
  $form['variables'] = array(
    '#prefix' => '<ul>',
    '#suffix' => '</ul>',
    '#tree' => TRUE,
  );
  foreach ($variables as $variable) {
    $form['variables'][$variable] = array(
      '#type' => 'hidden',
      '#value' => $variable,
      '#prefix' => '<li>',
      '#suffix' => check_plain($variable) . "</li>\n",
    );
  }
  $form['#submit'][] = 'variablecheck_delete_confirm_submit';
  $confirm_question = format_plural(count($variables), 'Are you sure you want to delete this variable?', 'Are you sure you want to delete these variables?');
  return confirm_form($form, $confirm_question, VARIABLECHECK_REPORT_PATH, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}