You are here

function custompage_ui_delete_form_submit in Custom Page 7

Same name and namespace in other branches
  1. 6 custompage_ui/custompage_ui.module \custompage_ui_delete_form_submit()

File

custompage_ui/custompage_ui.module, line 225
Custom Page Admin UI

Code

function custompage_ui_delete_form_submit($form, &$form_state) {
  $key = $form_state['values']['key'];
  $settings = variable_get('CUSTOMPAGE_UI_CONFIG', null);
  if (is_array($settings) && is_object($settings[$key])) {
    $new_settings = array_diff_key2($settings, array(
      $key => 'remove',
    ));
  }
  variable_set('CUSTOMPAGE_UI_CONFIG', $new_settings);
  drupal_flush_all_caches();
  drupal_set_message(t('The custom page: %title has been deleted.', array(
    '%title' => $form_state['values']['title'],
  )));
  $form_state['redirect'] = 'admin/structure/custompage';
  return;
}