You are here

function location_token_info in Location 7.3

Implements hook_token_info().

File

./location.tokens.inc, line 11
Make tokens about location available.

Code

function location_token_info() {
  $type = array(
    'name' => t('Location', array(), array(
      'context' => 'geolocation',
    )),
    'description' => t('Tokens related to location.'),
    'needs-data' => 'location',
  );
  $location = array();

  // Core tokens for location.
  $location['name'] = array(
    'name' => t("Location Name"),
    'description' => t('Location Name (If there are multiple locations, N is the iteration, starting with 0).'),
    'dynamic' => TRUE,
  );
  $location['street'] = array(
    'name' => t("Street"),
    'description' => t("Street (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['additional'] = array(
    'name' => t("Additional"),
    'description' => t("Additional (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['city'] = array(
    'name' => t("City"),
    'description' => t("City (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['province'] = array(
    'name' => t("State/Province"),
    'description' => t("State/Province (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['province_name'] = array(
    'name' => t("State/Province Name"),
    'description' => t("State/Province Name (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['postal_code'] = array(
    'name' => t("Postal Code"),
    'description' => t("Postal Code (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['latitude'] = array(
    'name' => t("Latitude"),
    'description' => t("Latitude (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['longitude'] = array(
    'name' => t("Longitude"),
    'description' => t("Longitude (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['country'] = array(
    'name' => t("Country"),
    'description' => t("Country (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $location['country_name'] = array(
    'name' => t("Country Name"),
    'description' => t("Country Name (If there are multiple locations, N is the iteration, starting with 0)."),
    'dynamic' => TRUE,
  );
  $node = array(
    'location' => array(
      'name' => t('Location', array(), array(
        'context' => 'geolocation',
      )),
      'description' => t("The location for this node."),
      'type' => 'location',
    ),
  );
  $user = array(
    'location' => array(
      'name' => t('Location', array(), array(
        'context' => 'geolocation',
      )),
      'description' => t("The location for this user."),
      'type' => 'location',
    ),
  );
  return array(
    'types' => array(
      'location' => $type,
    ),
    'tokens' => array(
      'location' => $location,
      'user' => $user,
      'node' => $node,
    ),
  );
}