You are here

function name_custom_format_delete_form in Name Field 7

Same name and namespace in other branches
  1. 6 name.admin.inc \name_custom_format_delete_form()

Custom name format deletion form.

2 string references to 'name_custom_format_delete_form'
name_custom_format_edit in ./name.admin.inc
Page to edit a custom format.
name_menu in ./name.module
Implements hook_menu().

File

./name.admin.inc, line 438
General administration functions.

Code

function name_custom_format_delete_form($form, $form_state, $ncfid) {
  $name = db_query("SELECT ncf.* FROM {name_custom_format} ncf WHERE ncfid = :ncfid", array(
    ':ncfid' => $ncfid,
  ))
    ->fetchAssoc();
  if (!$name) {
    drupal_set_message(t('The custom format could not be found.'), 'error');
    drupal_goto('admin/config/content/name');
  }
  $form = array();
  $form['ncfid'] = array(
    '#type' => 'value',
    '#value' => $name['ncfid'],
  );
  $form['#name'] = $name;
  return confirm_form($form, t('Are you sure you want to delete the custom format %name ("%format")?', array(
    '%name' => $name['name'],
    '%format' => $name['format'],
  )), 'admin/config/content/name', t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}