You are here

function rng_token_info in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 rng.tokens.inc \rng_token_info()
  2. 3.x rng.tokens.inc \rng_token_info()

Implements hook_token_info().

File

./rng.tokens.inc, line 13
Builds tokens for RNG.

Code

function rng_token_info() {

  // Token types.
  $tokens['types']['registration'] = [
    'name' => t('Registrations'),
    'description' => t('Tokens for registrations.'),
    'needs-data' => 'registration',
  ];

  // Tokens.
  $tokens['tokens']['registration']['id'] = [
    'name' => t("ID"),
    'description' => t("Unique ID of the registration."),
  ];
  $tokens['tokens']['registration']['created'] = [
    'name' => t("Created"),
    'description' => t("The date the registration was created."),
    'type' => 'date',
  ];
  $tokens['tokens']['registration']['changed'] = [
    'name' => t("Updated"),
    'description' => t("The date the registration was last updated."),
    'type' => 'date',
  ];
  $tokens['tokens']['registration']['url'] = [
    'name' => t("URL"),
    'description' => t("The URL of the registration view page."),
    'type' => 'url',
  ];
  $tokens['tokens']['registration']['edit-url'] = [
    'name' => t("Edit URL"),
    'description' => t("The URL of the registration edit page."),
    'type' => 'url',
  ];
  return $tokens;
}