You are here

function newsletter_list_delete_submit in Newsletter 7

Same name and namespace in other branches
  1. 7.2 modules/list/includes/newsletter_list.admin.inc \newsletter_list_delete_submit()

File

includes/newsletter.admin.inc, line 709
Admin page callbacks for the newsletter module.

Code

function newsletter_list_delete_submit($form, &$form_state) {
  $id = $form_state['values']['id'];
  $deleted = entity_get_controller('newsletter_list')
    ->delete($id);
  isset($deleted) ? drupal_set_message(t('List deleted successfully'), 'status') : drupal_set_message(t('An unknown error occured,please try again'), 'error');
  $form_state['redirect'] = isset($_GET['destination']) ? drupal_get_destination() : 'admin/config/newsletter/lists';
}