You are here

function regcode_token_info in Registration codes 7

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

Implements hook_token_info().

File

./regcode.module, line 774
Main functionality and hooks of regcode module.

Code

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