You are here

function filefield_filefield_paths_update in File (Field) Paths 6

Same name and namespace in other branches
  1. 5 modules/filefield.inc \filefield_filefield_paths_update()

Implements hook_filefield_paths_update().

File

modules/filefield.inc, line 95
Provides FileField Paths integration with the FileField module.

Code

function filefield_filefield_paths_update($oid, $field) {
  $node = node_load($oid);
  $content_type = content_types($node->type);

  // Flag files for update.
  if (isset($node->{$field})) {
    foreach ($node->{$field} as &$file) {
      if (!is_array($file) || empty($file['filepath'])) {
        continue;
      }
      $file['data']['process'] = TRUE;
    }
  }

  // Set Form ID.
  $node->form_id = $node->type . '_node_form';

  // Process Node.
  filefield_paths_nodeapi($node, 'update', NULL, NULL);
}