You are here

function fillpdf_field_edit_submit in FillPDF 5

Same name and namespace in other branches
  1. 6 fillpdf.admin.inc \fillpdf_field_edit_submit()
  2. 7.2 fillpdf.admin.inc \fillpdf_field_edit_submit()
  3. 7 fillpdf.admin.inc \fillpdf_field_edit_submit()

File

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

Code

function fillpdf_field_edit_submit($form_id, &$form_values) {
  if ($form_values['field']) {
    if ($form_values['op'] == t('Delete')) {
      return 'admin/content/fillpdf/form/' . $form_values['form']->fid . '/delete/' . $form_values['field']->name;
    }
    $edit_field = (object) $form_values;
    fillpdf_update_field($form_values['form'], $edit_field, $form_values['field']->pdf_key);
  }
  else {

    //add a new field
    $edit_field = (object) $form_values;
    db_query("INSERT INTO {fillpdf_fields} (fid, label, pdf_key, value) VALUES(%d, '%s', '%s', '%s')", $form_values['form']->fid, $form_values['label'], $form_values['pdf_key'], $form_values['value']);
  }
  return 'admin/content/fillpdf/form/' . $form_values['form']->fid;
}