function file_field_widget_uri

7.x file.field.inc file_field_widget_uri($field, $instance, $data = array())

Determines the URI for a file field instance.

Parameters

$field: A field array.

$instance: A field instance array.

$data: An array of token objects to pass to token_replace().

Return value

A file directory URI with tokens replaced.

See also

token_replace()

1 call to file_field_widget_uri()
file_field_widget_form in drupal/modules/file/file.field.inc
Implements hook_field_widget_form().

File

drupal/modules/file/file.field.inc, line 569
Field module functionality for the File module.

Code

function file_field_widget_uri($field, $instance, $data = array()) {
  $destination = trim($instance['settings']['file_directory'], '/');

  // Replace tokens.
  $destination = token_replace($destination, $data);

  return $field['settings']['uri_scheme'] . '://' . $destination;
}