You are here

function amazons3_field_widget_uri in AmazonS3 7.2

Return the destination URI for a file field.

Parameters

array $field: A field array.

array $instance: A field instance array.

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

Return value

string A file directory URI with tokens replaced.

See also

file_field_widget_uri()

token_replace()

1 call to amazons3_field_widget_uri()
amazons3_field_widget_form_alter in ./amazons3.module
Implements hook_field_widget_form_alter().

File

./amazons3.module, line 416
Hook implementations for the AmazonS3 module.

Code

function amazons3_field_widget_uri(array $field, array $instance, array $data = array()) {
  $uri_scheme = $field['settings']['uri_scheme'];
  $file_directory = isset($instance['settings']['file_directory']) ? $instance['settings']['file_directory'] : NULL;
  $bucket = isset($field['settings']['amazons3_bucket']) ? $field['settings']['amazons3_bucket'] : NULL;
  return amazons3_upload_location($uri_scheme, $bucket, $file_directory, $data);
}