You are here

function taxonomy_access_role_delete_confirm_submit in Taxonomy Access Control 7

Form submission handler for taxonomy_role_delete_confirm().

File

./taxonomy_access.admin.inc, line 85
Administrative interface for taxonomy access control.

Code

function taxonomy_access_role_delete_confirm_submit($form, &$form_state) {
  $roles = _taxonomy_access_user_roles();
  $rid = $form_state['values']['rid'];
  if (is_numeric($rid) && $rid != DRUPAL_ANONYMOUS_RID && $rid != DRUPAL_AUTHENTICATED_RID) {
    if ($form_state['values']['confirm']) {
      $form_state['redirect'] = TAXONOMY_ACCESS_CONFIG;
      taxonomy_access_delete_role_grants($rid);
      drupal_set_message(t('All taxonomy access rules deleted for role %role.', array(
        '%role' => $roles[$rid],
      )));
    }
  }
}