You are here

function emimage_custom_url_data in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 contrib/emimage/providers/custom_url.inc \emimage_custom_url_data()

This function will get additional information of the image source input by the end user. It will also use a helper function to validate the source of the image.

Parameters

$field An object of type array:

$item An object of type array containing information about the image: URL; e.g. embed - which contains the full URL path.

Return value

An object of type array; which contains

See also

_validate_image_helper function

File

contrib/emimage/providers/custom_url.inc, line 43

Code

function emimage_custom_url_data($field, $item) {
  $data = array();

  // Validate the source.
  if (_emimage_custom_url_validate_image_helper($item['embed'])) {
    $data = array(
      'emimage_custom_url_data_version' => 1,
      'server' => _emimage_custom_url_get_domain_server($item['embed']),
      'file' => _emimage_custom_url_get_domain_file($item['embed']),
      'album' => _emimage_custom_url_get_domain_album($item['embed'], $data['server']),
      'owner' => $item['embed'],
    );
    $data['title'] = emimage_custom_url_image_title($data['file'], $data);
  }
  return $data;
}