You are here

function pagerer_preset_delete_form_submit in Pagerer 7

Preset delete form - submission.

File

./pagerer.admin.inc, line 400
Pagerer administration

Code

function pagerer_preset_delete_form_submit($form, &$form_state) {
  $preset_name = $form_state['build_info']['args'][0];
  if (_pagerer_get_variable('core_override_preset') == $preset_name) {
    _pagerer_set_variable('core_override_preset', 'core');
    drupal_set_message(t("Preset %preset was being used as replacement of Drupal's core pager. Drupal's core pager has been reset as main pager to allow for deletion of the preset.", array(
      '%preset' => $preset_name,
    )), 'warning');
  }
  _pagerer_delete_preset($preset_name);
  drupal_set_message(t('Preset %preset has been deleted.', array(
    '%preset' => $preset_name,
  )), 'status');
  $form_state['redirect'] = _PAGERER_CONFIG_PATH;
}