You are here

function fillpdf_field_delete_confirm in FillPDF 5

Same name and namespace in other branches
  1. 6 fillpdf.admin.inc \fillpdf_field_delete_confirm()
1 string reference to 'fillpdf_field_delete_confirm'
fillpdf_menu in ./fillpdf.module
Implementation of hook_menu().

File

./fillpdf.module, line 420
Allows mappings of PDFs to site content

Code

function fillpdf_field_delete_confirm($fid, $pdf_key) {
  $pdf_form = db_fetch_object(db_query("SELECT * FROM {fillpdf_forms} WHERE fid = %d", $fid));
  if ($pdf_key) {
    $field = db_fetch_object(db_query("SELECT * FROM {fillpdf_fields} WHERE pdf_key = '%s' AND fid = %d", $pdf_key, $fid));
  }
  if (!$field) {
    drupal_not_found();
    exit;
  }
  $form['field'] = array(
    '#type' => 'value',
    '#value' => $field,
  );
  $form['form'] = array(
    '#type' => 'value',
    '#value' => $pdf_form,
  );
  return confirm_form($form, t('Are you sure you want to delete the field %pdf_key?', array(
    '%pdf_key' => $field->pdf_key,
  )), 'admin/content/fillpdf/form/' . $pdf_form->fid, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
}