You are here

function config_pages_form_submit_delete in Config Pages 7

Form API submit callback for the delete button.

1 string reference to 'config_pages_form_submit_delete'
config_pages_edit_form in ./config_pages.admin.inc
Form callback: create or edit a config_pages.

File

./config_pages.admin.inc, line 434
ConfigPages editing UI.

Code

function config_pages_form_submit_delete(&$form, &$form_state) {
  if (empty($form_state['storage']['delete_confirmation'])) {
    $form_state['rebuild'] = TRUE;
    $form_state['storage']['delete_confirmation'] = TRUE;
  }
  else {
    unset($form_state['storage']['delete_confirmation']);
    if (empty($form_state['storage'])) {
      unset($form_state['storage']);
      drupal_set_message(t('Configuration page was cleared.'));
    }
    entity_delete('config_pages', $form['#config_pages']->config_pages_id);
  }
}