Index: emfield.cck.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/Attic/emfield.cck.inc,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 emfield.cck.inc
--- emfield.cck.inc	25 Jul 2008 11:45:51 -0000	1.1.2.5
+++ emfield.cck.inc	4 Aug 2008 21:56:18 -0000
@@ -67,14 +67,7 @@
       $return = array();
       $return[$field_name] = $items;
       break;
-
-  case 'sanitize':
-    foreach ($items as $delta => $item) {
-      $content =  module_invoke($module, 'field_formatter', $field, $item, 'video_video', $node);
-      $items[$delta]['value'] = $content;
-    }
-    break;
-
+      
     case 'delete':
       break;
   }
Index: emfield.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/emfield.module,v
retrieving revision 1.12.4.15
diff -u -r1.12.4.15 emfield.module
--- emfield.module	25 Jul 2008 11:45:51 -0000	1.12.4.15
+++ emfield.module	4 Aug 2008 23:10:54 -0000
@@ -42,7 +42,7 @@
  */
 function emfield_emfield_field($op, &$node, $field, &$items, $teaser, $page, $module) {
   module_load_include('inc', 'emfield', 'emfield.cck');
-  return _emfield_emfield_field($op, &$node, $field, &$items, $teaser, $page, $module);
+  return _emfield_emfield_field($op, $node, $field, $items, $teaser, $page, $module);
 }
 
 /**
@@ -262,7 +262,7 @@
   switch ($op) {
     case 'rss item':
       module_load_include('inc', 'emfield', 'rss.cck');
-      return _emfield_nodeapi_rss(&$node, $op, $teaser, $page);
+      return _emfield_nodeapi_rss($node, $op, $teaser, $page);
   }
 }
 
@@ -638,3 +638,20 @@
       return $title ? $title : check_plain($query);
   }
 }
+
+function emfield_provider_themes($module, $provider = null) {
+  $themes = array();
+  
+  if ($provider && $subthemes = emfield_include_invoke($module, $provider, 'subtheme')) {
+    $themes = $subthemes;
+  }
+  $providers = module_invoke('emfield', 'system_list', $module);
+  
+  foreach ($providers as $provider) {
+    if ($subthemes = emfield_include_invoke($module, $provider->name, 'emfield_subtheme')) {
+        $themes += $subthemes;
+    }
+  }
+  
+  return $themes;
+}
Index: contrib/emvideo/emvideo.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.module,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 emvideo.module
--- contrib/emvideo/emvideo.module	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/emvideo.module	4 Aug 2008 23:01:31 -0000
@@ -44,7 +44,7 @@
  * Implementation of hook_theme().
  */
 function emvideo_theme() {
-  return array(
+  $themes = array(
     'emvideo_video_embed' => array(
       'arguments' => array('field' => NULL, 'item' => NULL, 'formatter' => NULL, 'node' => NULL, 'options' => array()),
       'file' => 'emvideo.theme.inc',
@@ -69,7 +69,32 @@
       'arguments' => array('field' => NULL, 'item' => NULL, 'formatter' => NULL, 'node' => NULL, 'options' => array()),
       'file' => 'emvideo.theme.inc',
     ),
+    'emvideo_formatter_video_video' => array(
+        'arguments' => array('element' => NULL),
+        'file' => 'emvideo.theme.inc'
+    ),
+    'emvideo_formatter_video_thumbnail' => array(
+        'arguments' => array('element' => NULL),
+        'file' => 'emvideo.theme.inc'
+    ),
+    'emvideo_formatter_video_embed' => array(
+        'arguments' => array('element' => NULL),
+        'file' => 'emvideo.theme.inc'
+    ),
+    'emvideo_formatter_video_preview' => array(
+        'arguments' => array('element' => NULL),
+        'file' => 'emvideo.theme.inc'
+    ),
+    'emvideo_formatter_default' => array(
+        'arguments' => array('element' => NULL),
+        'file' => 'emvideo.theme.inc'
+    ),
   );
+  
+  $themes += module_invoke('emfield', 'provider_themes', 'emvideo');
+  
+  return $themes;
+  
 }
 
 /**
Index: contrib/emvideo/emvideo.theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/Attic/emvideo.theme.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 emvideo.theme.inc
--- contrib/emvideo/emvideo.theme.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/emvideo.theme.inc	4 Aug 2008 21:50:28 -0000
@@ -120,7 +120,6 @@
     $autoplay = $options['autoplay'] ? $options['autoplay'] : $field['widget']['video_autoplay'];
     $output = module_invoke('emfield', 'include_invoke', 'emvideo', $item['provider'], 'video', $embed, $width, $height, $field, $item, $autoplay, $options);
   }
-  $output .= 'test2';
 
   return $output;
 }
@@ -160,3 +159,28 @@
 
   return $output;
 }
+
+function theme_emvideo_formatter_video_video($element) {
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  return module_invoke('emvideo', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
+}
+
+function theme_emvideo_formatter_video_embed($element) {
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  return module_invoke('emvideo', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
+}
+
+function theme_emvideo_formatter_default($element) {
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  return module_invoke('emvideo', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
+}
+
+function theme_emvideo_formatter_video_preview($element) {
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  return module_invoke('emvideo', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
+}
+
+function theme_emvideo_formatter_video_thumbnail($element) {
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  return module_invoke('emvideo', 'field_formatter', $field, $element['#item'], $element['#formatter'], $element['#node']);
+}
Index: contrib/emvideo/providers/bliptv.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/bliptv.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 bliptv.inc
--- contrib/emvideo/providers/bliptv.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/bliptv.inc	4 Aug 2008 23:28:39 -0000
@@ -163,6 +163,7 @@
     '@blip\.tv/rss/flash/([^"\&\?]+)@i',
     '@blip\.tv/file/view/([^"\&\?]+)@i',
     '@blip\.tv/file/([^"\&\?]+)@i',
+    '@blip\.tv/play/([^"\&\?]+)@i',
 
     // test handling for featured shows. disabled for now.
 //     '@http\://([^\.]+)\.blip\.tv/@i',
@@ -299,3 +300,14 @@
   return $output;
 }
 
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_bliptv_emfield_subtheme() {
+  return array (
+    'emvideo_bliptv_flash' => array (
+      'arguments' => array('code' => NULL, 'width' => NULL, 'height' => NULL, 'field' => NULL, 'item' => NULL, 'autoplay' => NULL, 'flv' => NULL, 'thumbnail' => NULL, 'options' => NULL),
+      'file' => 'providers/bliptv.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/brightcove.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/brightcove.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 brightcove.inc
--- contrib/emvideo/providers/brightcove.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/brightcove.inc	4 Aug 2008 23:09:51 -0000
@@ -148,3 +148,15 @@
   $output = theme('emvideo_brightcove_flash', $embed, $width, $height, $autoplay);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_brightcove_emfield_subtheme() {
+  return array (
+    'emvideo_brightcove_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/brightcove.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/dailymotion.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/dailymotion.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 dailymotion.inc
--- contrib/emvideo/providers/dailymotion.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/dailymotion.inc	4 Aug 2008 23:09:24 -0000
@@ -169,3 +169,15 @@
   $output = theme('emvideo_dailymotion_flash', $embed, $width, $height, $autoplay);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_dailymotion_emfield_subtheme() {
+  return array (
+    'emvideo_dailymotion_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/dailymotion.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/google.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/google.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 google.inc
--- contrib/emvideo/providers/google.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/google.inc	4 Aug 2008 23:09:16 -0000
@@ -185,3 +185,15 @@
   $output = theme('emvideo_google_flash', $embed, $width, $height, $autoplay);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_google_emfield_subtheme() {
+  return array (
+    'emvideo_google_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/google.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/jumpcut.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/jumpcut.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 jumpcut.inc
--- contrib/emvideo/providers/jumpcut.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/jumpcut.inc	4 Aug 2008 23:09:10 -0000
@@ -61,3 +61,14 @@
   return $output;
 }
 
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_jumpcut_emfield_subtheme() {
+  return array (
+    'emvideo_jumpcut_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL),
+      'file' => 'providers/jumpcut.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/livevideo.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/livevideo.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 livevideo.inc
--- contrib/emvideo/providers/livevideo.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/livevideo.inc	4 Aug 2008 23:09:03 -0000
@@ -184,3 +184,15 @@
 
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_livevideo_emfield_subtheme() {
+  return array (
+    'emvideo_livevideo_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/livevideo.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/metacafe.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/metacafe.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 metacafe.inc
--- contrib/emvideo/providers/metacafe.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/metacafe.inc	4 Aug 2008 23:08:52 -0000
@@ -75,3 +75,14 @@
   return $output;
 }
 
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_metacafe_emfield_subtheme() {
+  return array (
+    'emvideo_metacafe_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/metacafe.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/myspace.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/myspace.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 myspace.inc
--- contrib/emvideo/providers/myspace.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/myspace.inc	4 Aug 2008 23:08:43 -0000
@@ -112,3 +112,15 @@
   $output = theme('emvideo_myspace_flash', $embed, $width, $height);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_myspace_emfield_subtheme() {
+  return array (
+    'emvideo_myspace_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/myspace.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/revver.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/revver.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 revver.inc
--- contrib/emvideo/providers/revver.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/revver.inc	4 Aug 2008 23:10:26 -0000
@@ -76,4 +76,16 @@
 function emvideo_revver_preview($embed, $width, $height, $field, $item, $autoplay) {
   $output = theme('emvideo_revver_flash', $embed, $width, $height, $autoplay);
   return $output;
-}
\ No newline at end of file
+}
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_revver_emfield_subtheme() {
+  return array (
+    'emvideo_revver_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/revver.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/sevenload.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/sevenload.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 sevenload.inc
--- contrib/emvideo/providers/sevenload.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/sevenload.inc	4 Aug 2008 23:10:11 -0000
@@ -132,3 +132,14 @@
   return $output;
 }
 
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_sevenload_emfield_subtheme() {
+  return array (
+    'emvideo_sevenload_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL),
+      'file' => 'providers/sevenload.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/spike.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/spike.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 spike.inc
--- contrib/emvideo/providers/spike.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/spike.inc	4 Aug 2008 23:40:24 -0000
@@ -33,6 +33,7 @@
   return array(
     // http://www.spike.com/video/2836119/collection/19459/channel/comedy
     // <embed width="448" height="365" src="http://www.spike.com/efp" quality="high" bgcolor="000000" name="efp" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="flvbaseclip=2836119&"> </embed> <h1><a href="http://www.spike.com/video/2836119">"I Lost It" with Tom Cruize and Jesus</a></h1><span>Posted Mar 25, 2007</span><p>What happens when Jesus, Abe Lincoln, Tom Cruise, Dustin Hoffman, Buddha and Einstein play a friendly game of poker?</p>
+    '@spike\.com/efp"(?:.*)flvbaseclip=([^&]+)@i',
     '@spike\.com/video/([^/&"\?]*)@i',
   );
 }
@@ -74,3 +75,15 @@
   $output = theme('emvideo_spike_flash', $embed, $width, $height, $autoplay);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_spike_emfield_subtheme() {
+  return array (
+    'emvideo_spike_flash' => array (
+      'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+      'file' => 'providers/spike.inc'
+    )
+  );
+}
Index: contrib/emvideo/providers/youtube.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/youtube.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 youtube.inc
--- contrib/emvideo/providers/youtube.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/youtube.inc	4 Aug 2008 23:10:34 -0000
@@ -334,3 +334,15 @@
   $output = theme('emvideo_youtube_flash', $embed, $width, $height, $autoplay);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_youtube_emfield_subtheme() {
+    return array(
+        'emvideo_youtube_flash'  => array (
+            'arguments' => array('embed' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => NULL),
+            'file' => 'providers/youtube.inc'
+        )
+    );
+}
Index: contrib/emvideo/providers/zzz_custom_url.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/emfield/contrib/emvideo/providers/Attic/zzz_custom_url.inc,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 zzz_custom_url.inc
--- contrib/emvideo/providers/zzz_custom_url.inc	25 Jul 2008 11:45:51 -0000	1.1.2.3
+++ contrib/emvideo/providers/zzz_custom_url.inc	4 Aug 2008 23:21:05 -0000
@@ -53,11 +53,12 @@
 
 function emvideo_zzz_custom_url_extract($embed = '') {
   $types = _emvideo_zzz_custom_url_implode_types();
-  if (preg_match('@\ .('. $types .')@i', $embed, $matches)) {
-    return $embed;
-  }
+  $baseurl = preg_quote(url(null, array('absolute' => true)), '@');
 
-  return FALSE;
+  return array (
+    '@' . $baseurl . '(.*' . '\.(?:' . $types . ')' . ')@i',
+    '@(.*\.(?:'. $types .'))@i'
+  );
 }
 
 function emvideo_zzz_custom_url_data($field, $item) {
@@ -147,3 +148,15 @@
   $output = theme('emvideo_zzz_custom_url_embedded_video', $type, $code, $width, $height, $autoplay, $field, $item);
   return $output;
 }
+
+/**
+ * Implementation of hook_emfield_subtheme.
+ */
+function emvideo_zzz_custom_url_emfield_subtheme() {
+  return array(
+    'emvideo_zzz_custom_url_embedded_video' => array(
+      'arguments' => array('type' => NULL, 'url' => NULL, 'width' => NULL, 'height' => NULL, 'autoplay' => FALSE, 'field' => NULL, 'item' => NULL),
+      'file' => 'providers/zzz_custom_url.inc'
+    )
+  );
+}

