Only in video_filter: drupalvideo diff -urp video_filter_orig/video_filter.codecs.inc video_filter/video_filter.codecs.inc --- video_filter_orig/video_filter.codecs.inc 2008-08-27 08:26:33.246714278 -0600 +++ video_filter/video_filter.codecs.inc 2008-08-27 08:09:51.455842268 -0600 @@ -7,30 +7,35 @@ function video_filter_codec_info() $codecs['youtube'] = array( 'name' => t('YouTube'), + 'sample_url' => 'http://www.youtube.com/watch?v=uN1qUeId', 'callback' => 'video_filter_youtube', 'regexp' => '/youtube\.com\/watch\?v=([a-z0-9\-_]+)/i', 'ratio' => 425 / 355, ); $codecs['google'] = array( 'name' => t('Google Video'), + 'sample_url' => 'http://video.google.com/videoplay?docid=-uN1qUeId', 'callback' => 'video_filter_google', 'regexp' => '/video\.google\.com\/videoplay\?docid=(\-?[0-9]+)/', 'ratio' => 400 / 326, ); $codecs['godtube'] = array( 'name' => t('GodTube'), + 'sample_url' => 'http://www.godtube.com/view_video.php?viewkey=uN1qUeId', 'callback' => 'video_filter_godtube', 'regexp' => '/godtube\.com\/view_video\.php\?viewkey=([a-z0-9]+)/', 'ratio' => 300 / 270, ); $codecs['dailymotion'] = array( 'name' => t('DailyMotion'), + 'sample_url' => 'http://www.dailymotion.com/us/featured/video/x59_some_title', 'callback' => 'video_filter_dailymotion', 'regexp' => '/dailymotion\.com\/.*video\/([a-z0-9]+)/i', 'ratio' => 420 / 336, ); $codecs['eyespot'] = array( 'name' => t('Eyespot'), + 'sample_url' => 'http://eyespot.com/share?cmd=permalink&r=0XCzIG2UEx9hoXiEJW07IWpUtT', 'callback' => 'video_filter_eyespot', // http://eyespot.com/share?cmd=permalink&r=0XCzIG2UEx9hoXiEJW07IWpUtT# 'regexp' => '/eyespot\.com\/.*r=([a-z0-9]+)/i', @@ -38,13 +43,15 @@ function video_filter_codec_info() ); $codecs['jumpcut'] = array( 'name' => t('Jumpcut'), + 'sample_url' => 'http://jumpcut.com/view?id=31410FA4169E11DDB25E000423CF385C', 'callback' => 'video_filter_jumpcut', - // http://jumpcut.com/view?id=31410FA4169E11DDB25E000423CF385C + // http://jumpcut.com/view?id=31410FA4169E11DDB25E000423CF385C 'regexp' => '/jumpcut\.com\/.*id=([A-Z0-9]+)/', 'ratio' => 408 / 324, ); $codecs['revver'] = array( 'name' => t('Revver'), + 'sample_url' => 'http://revver.com/video/856351/the-title/', 'callback' => 'video_filter_revver', // http://revver.com/video/856351/the-next-levelwith-nike/ 'regexp' => '/revver\.com\/video\/([0-9]+)/', @@ -52,6 +59,7 @@ function video_filter_codec_info() ); $codecs['vimeo'] = array( 'name' => t('Vimeo'), + 'sample_url' => 'http://www.vimeo.com/319782', 'callback' => 'video_filter_vimeo', // http://www.vimeo.com/319782 'regexp' => '/vimeo\.com\/([0-9]+)/', diff -urp video_filter_orig/video_filter.module video_filter/video_filter.module --- video_filter_orig/video_filter.module 2008-08-27 08:26:34.491456903 -0600 +++ video_filter/video_filter.module 2008-08-27 08:07:43.921197618 -0600 @@ -215,4 +215,98 @@ function video_filter_flash($video, $par return $output; } -?> \ No newline at end of file +/** + * Implementation of hook_menu(). + */ +function video_filter_menu($may_cache) { + $items = array(); + $access = user_access('access content'); + + if ($may_cache) { + $items[] = array( + 'path' => 'video_filter/load', + 'title' => t('Video Filter'), + 'callback' => 'video_filter_loader', + 'access' => $access, + 'type' => MENU_CALLBACK, + ); + } + return $items; +} + +/** + * Implementation of hook_wysiwyg_plugin(). + */ +function video_filter_wysiwyg_plugin($editor) { + switch ($editor) { + case 'tinymce': + return array( + 'drupalvideo' => array( + 'path' => drupal_get_path('module', 'video_filter') .'/drupalvideo', + 'buttons' => array('drupalvideo' => t('Drupal Video')), + ), + ); + } +} + +/** + * Output tinymce popup html. + * + * @todo Remove hard-coded TinyMCE integration. + */ +function video_filter_loader() { + $output = ''."\n"; + $output .= "\n"; + $output .= "\n"; + $output .= '{$lang_drupalvideo_title}' ."\n"; + $output .= "\n\n"; + + $path = drupal_get_path('module', 'video_filter'); + $output .= ''."\n"; + $tinymce_path = drupal_get_path('module', 'wysiwyg_editor'); + $tinymce_js = base_path() . $tinymce_path .'/tinymce/jscripts/tiny_mce/tiny_mce_popup.js'; + $output .= '' . "\n"; + $output .= '' . "\n"; + $output .= "\n\n"; + $output .= ''; + $output .= '
'; + $output .= '

{$lang_drupalvideo_title}

'; + $output .= ''; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + $output .= '

'. t('Instructions') . '

'; + $output .= '

' . t('Insert a 3rd party video from one of the following providers.') . '

'; + $output .= _video_filter_instructions(); + $output .= '
'; + $output .= ''; + $output .= "\n"; + echo $output; +} + +/** + * Parses Codec into Instructions for tinymce popup + */ +function _video_filter_instructions(){ + $codecs = module_invoke_all('codec_info'); + $output = ""; + foreach ($codecs as $codec) { + $output .= '
'; + $output .= '
' . $codec['name'] . '
'; + $output .= '
Accepts URLs like ' . $codec['sample_url'] . '
'; + $output .= '
'; + } + return $output; +} + +?>