You are here

function scald_youtube_validate_id in Scald YouTube 7

Form element validation handler for YouTube identifier.

1 string reference to 'scald_youtube_validate_id'
scald_youtube_scald_add_form in ./scald_youtube.module
Implements hook_scald_add_form().

File

./scald_youtube.module, line 715
Defines a YouTube provider for Scald.

Code

function scald_youtube_validate_id($element, &$form_state) {
  $identifier = scald_youtube_parse_id($form_state['values']['identifier'], TRUE);
  if (empty($identifier['id'])) {
    form_error($element, t('Invalid YouTube video identifier.'));
  }
  elseif (scald_youtube_already_imported($identifier['id'])) {
    form_error($element, t('YouTube video already imported.'));
  }
}