Index: token.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/token/token.module,v retrieving revision 1.5 diff -u -p -r1.5 token.module --- token.module 3 Jan 2007 03:39:47 -0000 1.5 +++ token.module 19 Jan 2007 10:56:32 -0000 @@ -5,6 +5,15 @@ include_once('token_node.inc'); include_once('token_user.inc'); /** + * Implements hook_help(). + */ +function token_help($section) { + if ($section == 'admin/modules#description') { + return t('Provides a shared API for replacement of textual wildcards and placeholders with actual data.'); + } +} + +/** * Return the value of $original, with all instances of placeholder * tokens replaced by their proper values. * @@ -126,13 +135,14 @@ function token_token_values($type, $obje switch ($type) { case 'global': - $values['[user-name]'] = $user->uid ? $user->name : variable_get('anonymous', t('Anonymous')); - $values['[user-id]'] = $user->uid ? $user->uid : 0; - $values['[user-mail]'] = $user->uid ? $user->mail : ''; - $values['[site-url]'] = $base_url; - $values['[site-name]'] = variable_get('site_name', t('Drupal')); - $values['[site-slogan]'] = variable_get('site_slogan', ''); - $values['[site-mail]'] = variable_get('site_mail', ''); + $values['[user-name]'] = $user->uid ? $user->name : variable_get('anonymous', t('Anonymous')); + $values['[user-id]'] = $user->uid ? $user->uid : 0; + $values['[user-mail]'] = $user->uid ? $user->mail : ''; + $values['[site-url]'] = $base_url; + $values['[site-name]'] = variable_get('site_name', t('Drupal')); + $values['[site-slogan]'] = variable_get('site_slogan', ''); + $values['[site-mail]'] = variable_get('site_mail', ''); + $values['[site-date]'] = date(variable_get('date_format_medium', 'D, m/d/Y - H:i')); break; } return $values; @@ -153,13 +163,14 @@ function token_token_values($type, $obje * in the form of: $list[$type][$token] = $description */ 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']['[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; } @@ -178,4 +189,4 @@ function _token_get_id($type = 'global', default: return md5(serialize($object)); } -} \ No newline at end of file +}