You are here

function link_token_values in Link 7

Same name and namespace in other branches
  1. 6.2 link.module \link_token_values()
  2. 6 link.module \link_token_values()

Implements hook_token_values().

File

./link.module, line 1532
Defines simple link field types.

Code

function link_token_values($type, $object = NULL) {

  // @todo hook_token_values() no longer exists, this should be rewritten as
  // hook_tokens().
  if ($type === 'field') {
    $item = $object[0];
    $tokens['url'] = $item['url'];
    $tokens['title'] = $item['title'];
    $tokens['view'] = isset($item['view']) ? $item['view'] : '';
    return $tokens;
  }
}