Index: flashvideo.module =================================================================== --- flashvideo.module (revision 462) +++ flashvideo.module (revision 463) @@ -7,6 +7,7 @@ */ require_once(drupal_get_path('module', 'flashvideo') . '/flashvideo_objects.inc'); +include_once(drupal_get_path('module', 'flashvideo') . '/flashvideo_views.inc'); /** * Implementation of hook_help() Index: flashvideo_views.inc =================================================================== --- flashvideo_views.inc (revision 0) +++ flashvideo_views.inc (revision 463) @@ -0,0 +1,50 @@ + 'node', + 'fields' => array( + 'nid' => array( + 'name' => t('FlashVideo: Video'), + 'handler' => 'flashvideo_views_handler_video', + 'option' => array( + '#type' => 'select', + '#options' => 'flashvideo_views_option_video', + ), + 'notafield' => true, + 'sortable' => false, + ), + ), + ); + return($tables); +} + +/** + * Views handler for displaying the video. + */ +function flashvideo_views_handler_video($fieldinfo, $fielddata, $value, $data) { + $node = node_load($data->nid); + switch ($fielddata['options']) { + case 0: // Flash Video Player + return flashvideo_get_video($node, array()); + case 1: // Thumbnail Image + default: + return flashvideo_get_thumbnail($node, array()); + } +} + +/** + * Views - Generate a list of options for the + */ +function flashvideo_views_option_video($op) { + return array( + t('Flash Video Player'), + t('Thumbnail Image') + ); + return $a; +} \ No newline at end of file