You are here

function countries_token_info in Countries 7

Same name and namespace in other branches
  1. 8 countries.tokens.inc \countries_token_info()
  2. 7.2 countries.tokens.inc \countries_token_info()

Implements hook_token_info().

File

./countries.tokens.inc, line 11
Builds placeholder replacement tokens for country-related data.

Code

function countries_token_info() {
  $types['country'] = array(
    'name' => t('Countries'),
    'description' => t('Tokens related to individual countries.'),
    'needs-data' => 'country',
  );
  $types['default-country'] = array(
    'name' => t('Default country'),
    'description' => t('Tokens related to the sites default country.'),
    'type' => 'country',
  );
  $country['cid'] = array(
    'name' => t('Country ID'),
    'description' => t("The unique ID of the country."),
  );
  $country['name'] = array(
    'name' => t("Name"),
    'description' => t("The name of the country."),
  );
  $country['official-name'] = array(
    'name' => t("Country official name"),
    'description' => t("The official name of the country."),
  );
  $country['iso2'] = array(
    'name' => t("Country iso2 code"),
    'description' => t("The iso2 code of the country."),
  );
  $country['iso3'] = array(
    'name' => t("Country iso3 code"),
    'description' => t("The iso3 code of the country."),
  );
  $country['numcode'] = array(
    'name' => t("Country numeric iso code"),
    'description' => t("The numeric iso code of the country."),
  );
  $country['continent'] = array(
    'name' => t("Country continent"),
    'description' => t("The continent name of the country."),
  );
  $country['continent-code'] = array(
    'name' => t("Country continent code"),
    'description' => t("The continent code of the country."),
  );
  $country['enabled'] = array(
    'name' => t("Country status"),
    'description' => t("The status of the country."),
  );
  return array(
    'types' => $types,
    'tokens' => array(
      'country' => $country,
    ),
  );
}