You are here

function fillpdf_form_import_form in FillPDF 7

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

Import the code and configure the DB settings.

Based loosely on Node Export's import form.

_state

Parameters

mixed $form:

mixed $pdf_form:

1 string reference to 'fillpdf_form_import_form'
fillpdf_menu in ./fillpdf.module
Implements hook_menu().

File

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

Code

function fillpdf_form_import_form($form, &$form_state, $pdf_form) {
  if (is_numeric($pdf_form)) {
    $fid = fillpdf_load($pdf_form, FALSE, FALSE);
  }
  if (!$fid) {
    drupal_not_found();
    drupal_exit();
  }
  $form['fid'] = array(
    '#type' => 'value',
    '#value' => $fid->fid,
  );
  $form['paste'] = array(
    '#type' => 'fieldset',
    '#title' => t('Paste code'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['paste']['code'] = array(
    '#type' => 'textarea',
    '#default_value' => '',
    '#rows' => 30,
    '#description' => t('Cut and paste the results of a <em>FillPDF Field Mappings export</em> here.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Import'),
    '#suffix' => l(t('Reset the form'), $_GET['q']),
  );
  return $form;
}