You are here

function regcode_token_info in Registration codes 8

Same name and namespace in other branches
  1. 7.2 regcode.module \regcode_token_info()
  2. 7 regcode.module \regcode_token_info()

Implements hook_token_info().

File

./regcode.tokens.inc, line 14
Token support for the regcode module.

Code

function regcode_token_info() {
  $type = [
    'name' => t('Registration Codes'),
    'description' => t('Replacement tokens for registration codes'),
    'needs-data' => 'regcode',
  ];
  $regcode['created'] = [
    'name' => t("Code creation time"),
    'description' => t("The date the regcode was created."),
    'type' => 'date',
  ];
  $regcode['lastused'] = [
    'name' => t("Code last used time"),
    'description' => t("The date the regcode was used last."),
    'type' => 'date',
  ];
  $regcode['begins'] = [
    'name' => t("Code activation date"),
    'description' => t("The date the regcode gets activated."),
    'type' => 'date',
  ];
  $regcode['expires'] = [
    'name' => t("Code expiry date"),
    'description' => t("The date the regcode expires."),
    'type' => 'date',
  ];
  $regcode['code'] = [
    'name' => t("Registration code"),
    'description' => t("One single registration code"),
  ];
  $regcode['regurl'] = [
    'name' => t("Registration URL"),
    'description' => t("Link to the registration page with regcode included"),
  ];
  $regcode['is_active'] = [
    'name' => t("State of the regcode"),
    'description' => t("Whether the code is active"),
  ];
  $regcode['maxuses'] = [
    'name' => t("Maximum usage count"),
    'description' => t("Maximum times a code can be used"),
  ];
  $regcode['uses'] = [
    'name' => t("Current usage count"),
    'description' => t("Number of times the code already has been used"),
  ];
  return [
    'types' => [
      'regcode' => $type,
    ],
    'tokens' => [
      'regcode' => $regcode,
    ],
  ];
}