You are here

function link_token_values in Link 6.2

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

File

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

Code

function link_token_values($type, $object = NULL) {
  if ($type == 'field') {
    $item = $object[0];
    $tokens['url'] = $item['url'];
    $tokens['title'] = $item['title'];
    $tokens['view'] = isset($item['view']) ? $item['view'] : '';
    $host = @parse_url($item['url']);
    $tokens['host'] = isset($host['host']) ? $host['host'] : '';
    return $tokens;
  }
}