You are here

function _emfield_field_validate_id in Embedded Media Field 6

Same name and namespace in other branches
  1. 5 emfield.module \_emfield_field_validate_id()
  2. 6.3 deprecated/emfield-deprecated.inc \_emfield_field_validate_id()
  3. 6.2 emfield.module \_emfield_field_validate_id()

Extract the id from embedded code or url.

1 call to _emfield_field_validate_id()
_emfield_emfield_field in ./emfield.cck.inc
Implementation of hook_emfield_field(). This in turn is a callback for hook_field().

File

./emfield.module, line 172
Embedded Media Field is a CCK-based framework for 3rd party media files.

Code

function _emfield_field_validate_id($field, $item, $error_field, $module, $delta = 0) {

  // Load the provider info.
  $item = _emfield_field_submit_id($field, $item, $module, $error_field);

  // Ensure we have proper provider info.
  if ($item['embed'] && !$item['provider']) {
    form_set_error($error_field, t('You have specified an invalid media URL or embed code.'));
  }
  else {
    emfield_include_invoke($module, $item['provider'], 'validate', $item['value'], $error_field);
  }
  return $item;
}