You are here

function _fillpdf_admin_token_form in FillPDF 7

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

Return the render array for the token tree.

Parameters

bool $dialog: Controls whether #dialog is set. When TRUE, it will render as a link that opens a modal dialog token browser.

Return value

array The render array.

2 calls to _fillpdf_admin_token_form()
fillpdf_field_edit in ./fillpdf.admin.inc
Edit a single field.
fillpdf_form_edit in ./fillpdf.admin.inc
Edit existing PDF form.

File

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

Code

function _fillpdf_admin_token_form($dialog = FALSE) {
  $token_types = array(
    'node',
    'webform-tokens',
    'submission',
    'uc_order',
    'uc_order_product',
    'random',
    'current-date',
    'current-user',
    'site',
  );
  if (module_exists('entity_token')) {
    $entities = entity_get_info();
    foreach ($entities as $entity => $info) {
      $token_types[] = !empty($info['token type']) ? $info['token type'] : $entity;
    }
  }

  // If not using Webform Rules, then show potential Webform Tokens
  // webform:-namespaced tokens.
  if (module_exists('webform_rules') === FALSE) {
    $token_types[] = 'webform';
  }
  return array(
    '#theme' => 'token_tree',
    '#dialog' => $dialog,
    '#token_types' => $token_types,
    '#global_types' => FALSE,
  );
}