Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

token_token_list

Definition

token_token_list($type = 'all')
contributions/token/token.module, line 94

Description

Sample implementation of hook_token_list(). Documents the individual tokens handled by your module.

Parameters

type A flag indicating the class of substitution tokens to return information on. If this is set to 'all', a complete list is being built and your module should return its full list, regardless of type. Global tokens should always be returned, regardless of the $type passed in.

Return value

A keyed array listing the substitution tokens. Elements should be in the form of: $list[$type][$token] = $description

Code

<?php
function token_token_list($type = 'all') {
  $tokens['global']['user-name']    = t('The name of the currently logged in user.');
  $tokens['global']['user-id']      = t('The user ID of the currently logged in user.');
  $tokens['global']['user-mail']    = t('The email address of the currently logged in user.');
  $tokens['global']['site-url']     = t('The url of the current Drupal website.');
  $tokens['global']['site-name']    = t('The name of the current Drupal website.');
  $tokens['global']['site-slogan']  = t('The slogan of the current Drupal website.');
  $tokens['global']['site-mail']    = t('The contact email address for the current Drupal website.');
  $tokens['global']['site-date']    = t("The current date on the site's server.");
  return $tokens;
}
?>