You are here

function fillpdf_field_edit_field in FillPDF 5

1 string reference to 'fillpdf_field_edit_field'
fillpdf_menu in ./fillpdf.module
Implementation of hook_menu().

File

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

Code

function fillpdf_field_edit_field() {
  $fid = arg(4);
  $pdf_key = arg(6);
  if (is_numeric($fid)) {
    $pdf_form = db_fetch_object(db_query("SELECT * FROM {fillpdf_forms} WHERE fid = %d", $fid));
  }
  if (!$pdf_form) {
    drupal_not_found();
    exit;
  }
  if (arg(5) == 'add') {
    drupal_set_title(check_plain($pdf_form->title));
  }
  else {
    if (arg(5) != 'edit') {
      return fillpdf_form_overview($pdf_form);
    }
    else {
      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;
        }
        drupal_set_title(check_plain($field->label));

        //$type = $field->type;
      }
    }
  }
  return drupal_get_form('fillpdf_field_edit', $pdf_form, $field);
}