You are here

function audio_filefield_paths_get_fields in File (Field) Paths 6

Implements hook_filefield_paths_get_fields().

File

modules/audio.inc, line 51
Provides FileField Paths integration with the Audio module.

Code

function audio_filefield_paths_get_fields(&$node, &$ffp) {
  if (is_object($node) && isset($node->audio['file'])) {
    $node->audio['file'] = (array) $node->audio['file'];
    $ffp['#files'][] = array(
      'field' => &$node->audio['file'],
      'module' => 'audio',
      'name' => 'audio',
      'new' => isset($node->audio['file']->source),
    );
    $ffp['#types']['audio'] = TRUE;
  }
}