You are here

function access_grant_multiple_delete_confirm_submit in Access Control Kit 7

Form submission handler for access_grant_multiple_delete_confirm().

See also

access_grant_multiple_delete_confirm()

1 string reference to 'access_grant_multiple_delete_confirm_submit'
access_grant_multiple_delete_confirm in ./access_grants.admin.inc
Form constructor for the access grant multiple delete confirmation form.

File

./access_grants.admin.inc, line 788
Access grants administrative UI for the access control kit module.

Code

function access_grant_multiple_delete_confirm_submit($form, &$form_state) {
  if ($form_state['values']['confirm']) {
    foreach (array_keys($form_state['values']['grants']) as $gid) {
      access_grant_delete($gid);
    }
    $count = count($form_state['values']['grants']);
    watchdog('access', 'Deleted @count access grants.', array(
      '@count' => $count,
    ));
    drupal_set_message(format_plural($count, 'Deleted 1 access grant.', 'Deleted @count access grants.'));
  }
  $form_state['redirect'] = 'admin/access';
}