You are here

function pet_token_help in Previewable email templates 7

Same name and namespace in other branches
  1. 8.4 pet.module \pet_token_help()
  2. 8 pet.module \pet_token_help()
  3. 8.3 pet.module \pet_token_help()

Helper function to provide token help to template construction form and template use form.

2 calls to pet_token_help()
pet_form in includes/pet.admin.inc
Generate the PET editing form.
pet_user_form in includes/pet.admin.inc
Multi-step form for previewing and sending a PET.

File

includes/pet.admin.inc, line 400
Contains pages for creating, editing, and deleting previewable email templates (PETs).

Code

function pet_token_help() {
  if (module_exists('token')) {
    $tokens = array(
      '#title' => t('Replacement patterns'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#description' => t('Make sure that the tokens you choose are available to your template when previewed. The list below includes the standard Nodes and Users groups, as well as global tokens. See also hook_pet_substitutions_alter().'),
    );
    $tokens['token_tree'] = array(
      '#theme' => 'token_tree',
      '#token_types' => array(
        'node',
        'user',
      ),
    );
  }
  else {
    $tokens = array(
      '#markup' => '<p>' . t('Enable the <a href="@drupal-token">Token module</a> to view the available token browser.', array(
        '@drupal-token' => 'http://drupal.org/project/token',
      )) . '</p>',
    );
  }
  return $tokens;
}