You are here

function cacheflush_preset_form_delete in CacheFlush 7

Same name and namespace in other branches
  1. 7.2 cacheflush.preset.inc \cacheflush_preset_form_delete()

Function for deleting presets.

Parameters

array $id: Preset ID.

array $cache_presets: List of presets.

1 call to cacheflush_preset_form_delete()
cacheflush_delete_preset_form_submit in ./cacheflush.preset.inc
Implements hook_formID_submit().

File

./cacheflush.preset.inc, line 204
Cacheflush module add/edit form for presets.

Code

function cacheflush_preset_form_delete($id, $cache_presets = array()) {

  // If delete called from list.
  if (empty($cache_presets)) {
    $cache_presets = variable_get('cacheflush_preset_list', array());
  }

  // Delete preset.
  unset($cache_presets[$id]);
  variable_set('cacheflush_preset_list', $cache_presets);
  drupal_set_message(t('Preset successfully deleted.'), 'status');

  // Rebuild menu.
  node_types_rebuild();
  menu_rebuild();
  drupal_goto("admin/config/development/cacheflush");
}