You are here

function uuid_link_token_info in UUID Link 7

Implements hook_token_info().

File

./uuid_link.module, line 127
Provides a filter and UI for adding links to entities that are not affected by changes in URL alias.

Code

function uuid_link_token_info() {
  $type = array(
    'name' => t('UUID Link'),
    'description' => t('UUID Link tokens.'),
    'needs-data' => 'uuid-link',
  );
  $entity_types = entity_get_info();
  $tokens = array();
  foreach ($entity_types as $entity_type => $entity_type_info) {
    $tokens[$entity_type] = array(
      'name' => t('UUID Link @entity', array(
        '@entity' => $entity_type_info['label'],
      )),
      'description' => t('Translates into an URL to the @entity entity matching the UUID.', array(
        '@entity' => $entity_type_info['label'],
      )),
      'dynamic' => TRUE,
    );
  }
  return array(
    'types' => array(
      'uuid-link' => $type,
    ),
    'tokens' => array(
      'uuid-link' => $tokens,
    ),
  );
}