You are here

function fillpdf_field_edit in FillPDF 5

Same name and namespace in other branches
  1. 6 fillpdf.admin.inc \fillpdf_field_edit()
  2. 7.2 fillpdf.admin.inc \fillpdf_field_edit()
  3. 7 fillpdf.admin.inc \fillpdf_field_edit()
1 string reference to 'fillpdf_field_edit'
fillpdf_field_edit_field in ./fillpdf.module

File

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

Code

function fillpdf_field_edit($pdf_form, $field) {
  $form['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Label'),
    '#maxlength' => 255,
    '#default_value' => $field->label,
    '#description' => t('An optional label to help you identify the field.'),
    '#weight' => 0,
  );
  $form['pdf_key'] = array(
    '#type' => 'textfield',
    '#title' => t('PDF Key'),
    '#maxlength' => 255,
    '#default_value' => $field->pdf_key,
    '#required' => TRUE,
    '#description' => t('The field key from the original PDF form.  You likely need Acrobat Pro to discover this.'),
    '#weight' => 1,
  );

  //  $form['type'] = array(
  //    '#type' => 'radios',
  //	'#options' => array('text','int'),
  //    '#title' => t('Type'),
  //    '#default_value' => ( ($field->type)?($field->type):0 ),
  //    '#description' => t('The type of PDF field.'),
  //    '#weight' => 3,
  //  );
  $form['value'] = array(
    '#type' => 'textarea',
    '#title' => t('Value'),
    '#default_value' => $field->value,
    '#description' => t('The content that will populate this field when the PDF is printed/saved.  This content pulls data via tokens, see below for available tokens.'),
    '#weight' => 4,
  );
  $form['tokens_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => 'Tokens',
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
    '#weight' => 5,
  );
  $form['tokens_fieldset']['tokens'] = array(
    '#value' => theme('token_help'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
    '#weight' => 9,
  );
  if ($field) {
    $form['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
      '#weight' => 10,
    );
  }
  $form['field'] = array(
    '#type' => 'value',
    '#value' => $field,
  );
  $form['form'] = array(
    '#type' => 'value',
    '#value' => $pdf_form,
  );
  return $form;
}