You are here

function rules_link_token_info_alter in Rules Link 7

Same name and namespace in other branches
  1. 7.2 rules_link.module \rules_link_token_info_alter()

Implements hook_token_info_alter().

File

./rules_link.module, line 594
Rules Link - module file.

Code

function rules_link_token_info_alter(&$data) {
  $entities = entity_get_info();
  foreach (array_keys($entities) as $entity) {
    $entity = str_replace('_', '-', $entity);
    if (isset($data['tokens'][$entity])) {
      $data['tokens'][$entity]['rules_link_token'] = array(
        'name' => t('Rules link token'),
        'description' => t('The rules link access token for this entity.'),
        'type' => 'rules_link_token',
      );
    }
  }
}