You are here

function fillpdf_form_edit_submit in FillPDF 6

Same name and namespace in other branches
  1. 5 fillpdf.module \fillpdf_form_edit_submit()
  2. 7.2 fillpdf.admin.inc \fillpdf_form_edit_submit()
  3. 7 fillpdf.admin.inc \fillpdf_form_edit_submit()

Submit Edit or Delete for existing PDF form

File

./fillpdf.admin.inc, line 364
Allows mappings of PDFs to site content

Code

function fillpdf_form_edit_submit($form, &$form_state) {
  if ($form_state['values']['op'] == t('Delete')) {
    $form_state['redirect'] = "admin/content/fillpdf/{$form['#pdf_form']->fid}/delete";
    return;
  }
  else {
    db_query('UPDATE {fillpdf_forms} SET title = "%s", destination_path = "%s", replacements = "%s", destination_redirect = %d  WHERE fid = %d', $form_state['values']['title'], trim($form_state['values']['destination_path']), $form_state['values']['replacements'], $form_state['values']['destination_redirect'], $form['#pdf_form']->fid);
    $form_state['redirect'] = "admin/content/fillpdf/{$form['#pdf_form']->fid}";
    drupal_set_message('Successfully updated form');

    //$form_state['nid'] = $node->nid;
  }
}