You are here

function file_aliases_filefield_paths_process_file in File Aliases 5

Same name and namespace in other branches
  1. 6 file_aliases.module \file_aliases_filefield_paths_process_file()
  2. 7 modules/filefield_paths.inc \file_aliases_filefield_paths_process_file()

Implementation of hook_filefield_paths_process_file().

File

./file_aliases.module, line 53

Code

function file_aliases_filefield_paths_process_file($new, $file, $settings, $node, $update) {
  if ($new) {
    $file['filealias'] = filefield_paths_process_string($settings['filealias']['value'], 'node', $node, $settings['filealias']);
    $file['filealias'] = filefield_paths_process_string($file['filealias'], 'field', array(
      0 => $file['field'],
    ), $settings['filealias']);
    path_set_alias('filefield_paths/alias/' . $file['field']['fid'], $file['filealias']);
  }
}