You are here

function filefield_token_values in FileField 5.2

Same name and namespace in other branches
  1. 6.3 filefield.token.inc \filefield_token_values()
  2. 6.2 filefield.module \filefield_token_values()

File

./filefield.module, line 928
Defines a file field type.

Code

function filefield_token_values($type, $object = NULL) {
  if ($type == 'field') {
    $item = $object[0];
    $tokens['fid'] = $item['fid'];
    $tokens['description'] = check_plain($item['description']);
    $tokens['filename'] = check_plain($item['filename']);
    $tokens['filepath'] = check_plain($item['filepath']);
    $tokens['filemime'] = $item['filemime'];
    $tokens['filesize'] = $item['filesize'];
    $tokens['view'] = $item['view'];
    return $tokens;
  }
}