You are here

function file_aliases_filefield_process in File Aliases 6

Implements file_aliases_hook_process().

File

modules/filefield.inc, line 10
Contains FileField module integration for the File Aliases module.

Code

function file_aliases_filefield_process(&$node, &$file, &$path, &$alias, &$count) {
  $count[$file['name']] = isset($count[$file['name']]) ? $count[$file['name']] + 1 : 1;
  $target =& $node->content[$file['name']]['field']['items'][$count[$file['name']] - 1]['#item'];
  $target['origpath'] = $file['field']['filepath'];
  $target['filepath'] = $path . $alias;
  $target['filename'] = array_pop(explode('/', $alias));
}