Index: vimeo.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/vimeo/Attic/vimeo.module,v
retrieving revision 1.1.2.3
diff -u -r1.1.2.3 vimeo.module
--- vimeo.module	19 Apr 2010 17:41:41 -0000	1.1.2.3
+++ vimeo.module	24 Apr 2010 04:03:13 -0000
@@ -802,6 +802,40 @@
  */
 function vimeo_field_settings($op, $field) {
   switch ($op) {
+    case 'form':
+      $form = array();
+      $form['width'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Width'),
+        '#default_value' => ($field['width']!='') ? $field['width'] : variable_get('vimeo_width', '640'),
+        '#field_suffix' => 'px',
+        '#required' => TRUE,
+        '#size' => '10',
+        '#description' => t('Width of the video player.'),
+      );
+      $form['height'] = array(
+        '#type' => 'textfield',
+        '#title' => t('Height'),
+        '#default_value' => ($field['height']!='') ? $field['height'] : variable_get('vimeo_height', '360'),
+        '#field_suffix' => 'px',
+        '#required' => TRUE,
+        '#size' => '10',
+        '#description' => t('Height of the video player.'),
+      );
+      return $form;
+      
+    case 'validate':
+      if (!is_numeric($field['width']) || intval($field['width']) != $field['width'] || $field['width'] < 0) {
+        form_set_error('width', t('Width must be a positive integer.'));
+      }
+      if (!is_numeric($field['height']) || intval($field['height']) != $field['height'] || $field['height'] < 0) {
+        form_set_error('height', t('Height must be a positive integer.'));
+      }
+      break;
+      
+    case 'save':
+      return array('height', 'width');
+      
     case 'database columns':
       $columns['value'] = array(
         'type' => 'varchar',
@@ -810,6 +844,18 @@
         'sortable' => FAlSE,
         'views' => FALSE
       );
+      $columns['height'] = array(
+        'type' => 'int',
+        'length' => 10,
+        'not null' => TRUE,
+        'unsigned' => TRUE,
+      );
+      $columns['width'] = array(
+        'type' => 'int',
+        'length' => 16,
+        'not null' => TRUE,
+        'unsigned' => TRUE,
+      );
       return $columns;
   }
 }
@@ -880,19 +926,16 @@
  * Theme function for 'default' vimeo field formatter.
  */
 function theme_vimeo_formatter_default($element) {
-  if (isset($element['#item']['value']) && !empty($element['#item']['value']) ) {
-    $video_vid = $element['#item']['value'];
-  }
-  else {
-    $data = vimeo_cache_video_get($element['#item']['value']);
-  
-    return '<object width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'" class="vimeo-video">
-    <param name="allowfullscreen" value="true" />
-    <param name="allowscriptaccess" value="always" />
-    <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" />
-    <embed src="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'. variable_get('vimeo_width', 640) .'" height="'. variable_get('vimeo_height', 360) .'"></embed>
+  $field = content_fields($element['#field_name'], $element['#type_name']);
+  $data = vimeo_cache_video_get($element['#item']['value']);
+
+  return '<object width="'. $field['width'] .'" height="'. $field['height'] .'" class="vimeo-video">
+  <param name="allowfullscreen" value="true" />
+  <param name="allowscriptaccess" value="always" />
+  <param name="wmode" value="opaque">
+  <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" />
+  <embed src="http://vimeo.com/moogaloop.swf?clip_id='.$data['id'].'&amp;server=vimeo.com&amp;show_title='. variable_get('vimeo_title', 1) .'&amp;show_byline='. variable_get('vimeo_byline', 1) .'&amp;show_portrait='. variable_get('vimeo_portrait', 1) .'&amp;color='. variable_get('vimeo_colour', '00ADEF') .'&amp;fullscreen='. variable_get('vimeo_fullscreen', 1) .'&amp;autoplay='. variable_get('vimeo_autoplay', 0) .'" type="application/x-shockwave-flash" wmode="opaque" allowfullscreen="true" allowscriptaccess="always" width="'. $field['width'] .'" height="'. $field['height'] .'"></embed>
   </object>';
-  }
 }
 
 /**

