You are here

function revisioning_token_info in Revisioning 7

Same name and namespace in other branches
  1. 8 revisioning_tokens.inc \revisioning_token_info()

Implements hook_token_info().

File

./revisioning_tokens.inc, line 13
Add tokens pertaining to the Revisioning module.

Code

function revisioning_token_info() {
  $info = array();

  // First specify token type(s).
  $info['types']['revision'] = array(
    'name' => t("Revisions"),
    'description' => t('Tokens related to revisions of individual content items, or "node revisions".'),
    'needs-data' => 'node',
  );

  // Then specify the tokens.
  $info['tokens']['revision']['revision-author'] = array(
    'name' => t("Revision author"),
    'description' => t("The author (or editor) of the revision"),
    'type' => 'user',
  );
  $info['tokens']['revision']['revision-body'] = array(
    'name' => t("Revision body"),
    'description' => t("The main body text of the revision"),
  );
  $info['tokens']['revision']['revision-created'] = array(
    'name' => t("Revision timestamp"),
    'description' => t("The date and time the revision was created."),
    'type' => 'date',
  );
  $info['tokens']['revision']['revision-title'] = array(
    'name' => t("Revision title"),
    'description' => t("The title of the revision"),
  );
  $info['tokens']['revision']['revision-vid'] = array(
    'name' => t("Revision ID"),
    'description' => t("The unique ID of the revision"),
  );
  return $info;
}