You are here

function token_custom_delete_confirm_form_submit in Custom Tokens 7

Same name and namespace in other branches
  1. 7.2 token_custom.admin.inc \token_custom_delete_confirm_form_submit()

File

./token_custom.admin.inc, line 219
Page callbacks and admin forms of the token_custom module.

Code

function token_custom_delete_confirm_form_submit($form, &$form_state) {
  if (token_custom_delete($form_state['token_custom']['token']->machine_name)) {
    drupal_set_message(t('Token <em>@machine_name</em> deleted.', array(
      '@machine_name' => $form_state['token_custom']['token']->machine_name,
    )));
  }
  else {
    drupal_set_message(t('There was a problem deleting token <em>@machine_name</em>. Please contact the site administrator.', array(
      '@machine_name' => $form_state['token_custom']['token']->machine_name,
    )), 'error');
  }
  $form_state['redirect'] = 'admin/structure/token-custom';
}