diff -rupN video_upload/providers/youtube/youtube.inc video_upload_new/providers/youtube/youtube.inc
--- video_upload/providers/youtube/youtube.inc 2009-09-05 06:51:16.000000000 +1000
+++ providers/youtube/youtube.inc 2009-10-28 09:18:20.000000000 +1100
@@ -20,6 +20,11 @@ define('VIDEO_UPLOAD_YOUTUBE_UPLOAD_URL'
define('VIDEO_UPLOAD_YOUTUBE_EMBED_URL', 'http://www.youtube.com/v');
/**
+ * The YouTube base url for linking to video.
+ */
+define('VIDEO_UPLOAD_YOUTUBE_LINK_URL', 'http://www.youtube.com/watch?v=');
+
+/**
* YouTube thumbnail (0) base url.
*/
define('VIDEO_UPLOAD_YOUTUBE_THUMB_URL', 'http://img.youtube.com/vi');
diff -rupN video_upload/video_upload.theme.inc video_upload_new/video_upload.theme.inc
--- video_upload/video_upload.theme.inc 2009-09-05 06:51:16.000000000 +1000
+++ video_upload.theme.inc 2009-10-28 09:19:26.000000000 +1100
@@ -23,6 +23,7 @@ function theme_video_upload_video($yt_id
// @todo: Abstract out YouTube.
video_upload_initialize_provider();
$video_url = VIDEO_UPLOAD_YOUTUBE_EMBED_URL . '/' . $yt_id;
+ $link_url = VIDEO_UPLOAD_YOUTUBE_LINK_URL . $yt_id;
if (!$field['widget']['display']['related_videos']) {
// Related videos.
@@ -74,9 +75,39 @@ function theme_video_upload_video($yt_id
);
$embed = '';
- return '
- ';
+ // The html object
+ $object = '';
+
+ // Add url & embed text fields if they are enabled
+ $url_embed_form = '';
+ if ($field['widget']['display']['display_url_text'] || $field['widget']['display']['display_embed_text']) {
+ $form = array();
+ if ($field['widget']['display']['display_url_text']) {
+ $form['url_text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('URL'),
+ '#value' => $link_url,
+ '#attributes' => array(
+ 'readonly' => 'readonly',
+ 'class' => 'url-text',
+ ),
+ );
+ }
+ if ($field['widget']['display']['display_embed_text']) {
+ $form['embed_text'] = array(
+ '#type' => 'textfield',
+ '#title' => t('Embed'),
+ '#value' => $object,
+ '#attributes' => array(
+ 'readonly' => 'readonly',
+ 'class' => 'embed-text',
+ ),
+ );
+ }
+ $url_embed_form = drupal_render($form);
+ }
+
+ return $object . $url_embed_form;
}
/**
diff -rupN video_upload/video_upload_widget.inc video_upload_new/video_upload_widget.inc
--- video_upload/video_upload_widget.inc 2009-09-05 06:51:16.000000000 +1000
+++ video_upload_widget.inc 2009-10-28 09:16:55.000000000 +1100
@@ -126,6 +126,18 @@ function video_upload_widget_settings_fo
'#description' => t('Show a fullscreen button on the embedded player.'),
'#default_value' => isset($widget['display']['fullscreen']) ? $widget['display']['fullscreen'] : TRUE,
);
+ $form['display']['display_url_text'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display URL text'),
+ '#description' => t('Show a text box containing the URL of the You Tube video.'),
+ '#default_value' => isset($widget['display']['display_url_text']) ? $widget['display']['display_url_text'] : FALSE,
+ );
+ $form['display']['display_embed_text'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Display Embed text'),
+ '#description' => t('Show a text box containing the Embed text of the You Tube video.'),
+ '#default_value' => isset($widget['display']['display_embed_text']) ? $widget['display']['display_embed_text'] : FALSE,
+ );
// Default title pattern.
$form['default_title'] = array(