You are here

function video_cck_google_asset_search in Asset 6

Same name and namespace in other branches
  1. 5.2 contrib/asset_emfield/providers/google.inc \video_cck_google_asset_search()

Implementation of hook_provider_asset_search().

File

contrib/asset_emfield/providers/google.inc, line 6

Code

function video_cck_google_asset_search($op = 'info', $type = NULL, $a3 = NULL) {
  switch ($op) {
    case 'info':
      $types['video_cck_google_search'] = array(
        'type' => 'video_cck_google_search',
        'name' => t('Google Video Search'),
        'module' => 'asset_emfield',
        'emfield_provider' => 'google',
      );
      return $types;
    case 'url':
      $value = urlencode($a3);
      switch ($type['type']) {
        case 'video_cck_google_search':
        default:
          return 'http://video.google.com/videofeed?type=search&q=' . $value . '+site%3Avideo.google.com&so=0&num=20&output=rss';
      }
      break;
    case 'feed item':
      $asset = $a3;
      $asset->type = 'emfield_video';
      $asset->emfield = array(
        0 => array(
          'embed' => $asset->guid,
        ),
      );
      $asset->formatters = asset_get_formatters($asset);
      asset_emfield_invoke('submit', $asset);
      return $asset;
  }
}