You are here

function variablecheck_delete_confirm_submit in Variable Check 7

Delete specified variables.

1 string reference to 'variablecheck_delete_confirm_submit'
variablecheck_delete_confirm in ./variablecheck.module
Confirm to delete specified variables.

File

./variablecheck.module, line 179

Code

function variablecheck_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    db_delete('variable')
      ->condition('name', $form_state['values']['variables'], 'IN')
      ->execute();
    $count = count($form_state['values']['variables']);
    watchdog('content', 'Deleted @count variables.', array(
      '@count' => $count,
    ));
    drupal_set_message(format_plural($count, 'Deleted 1 variable.', 'Deleted @count variables.'));
  }
  $form_state['redirect'] = VARIABLECHECK_REPORT_PATH;
}