You are here

function log_token_info in Log entity 8

Implements hook_token_info().

File

./log.tokens.inc, line 16
Builds placeholder replacement tokens for log-related data.

Code

function log_token_info() {
  $type = array(
    'name' => t('Logs'),
    'description' => t('Tokens related to individual log items.'),
    'needs-data' => 'log',
  );

  // Core tokens for logs.
  $log['id'] = array(
    'name' => t("Log ID"),
    'description' => t('The unique ID of the log item.'),
  );
  $log['vid'] = array(
    'name' => t("Revision ID"),
    'description' => t("The unique ID of the log's latest revision."),
  );
  $log['type'] = array(
    'name' => t("Log type"),
  );
  $log['type-name'] = array(
    'name' => t("Log type name"),
    'description' => t("The human-readable name of the log type."),
  );
  $log['name'] = array(
    'name' => t("Name"),
  );
  $log['url'] = array(
    'name' => t("URL"),
    'description' => t("The URL of the log."),
  );
  $log['edit-url'] = array(
    'name' => t("Edit URL"),
    'description' => t("The URL of the log's edit page."),
  );

  // Chained tokens for logs.
  $log['created'] = array(
    'name' => t("Date created"),
    'type' => 'date',
  );
  $log['changed'] = array(
    'name' => t("Date changed"),
    'description' => t("The date the log was most recently updated."),
    'type' => 'date',
  );
  $log['author'] = array(
    'name' => t("Author"),
    'type' => 'user',
  );
  return array(
    'types' => array(
      'log' => $type,
    ),
    'tokens' => array(
      'log' => $log,
    ),
  );
}