You are here

function fillpdf_form_overview in FillPDF 5

1 call to fillpdf_form_overview()
fillpdf_field_edit_field in ./fillpdf.module

File

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

Code

function fillpdf_form_overview(&$pdf_form) {
  drupal_set_title(check_plain($pdf_form->title));
  $result = db_query("SELECT * FROM {fillpdf_fields} WHERE fid = %d ", $pdf_form->fid);
  $header = array(
    t('Label'),
    t('PDF Key'),
    t('Value'),
    array(
      'data' => t('Operations'),
      'colspan' => '2',
    ),
  );
  $rows = array();
  while ($field = db_fetch_object($result)) {
    $row = array();
    $row[] = check_plain($field->label);
    $row[] = check_plain($field->pdf_key);
    $row[] = $field->value;
    $row[] = l(t('Edit'), "admin/content/fillpdf/form/{$pdf_form->fid}/edit/{$field->pdf_key}");
    $row[] = l(t('Delete'), "admin/content/fillpdf/form/{$pdf_form->fid}/delete/{$field->pdf_key}");
    $rows[] = $row;
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No fields available.'),
        'colspan' => '5',
        'class' => 'message',
      ),
    );
  }
  return theme('table', $header, $rows, array(
    'id' => 'fillpdf_fields',
  ));
}