You are here

function video_field_formatter_info in Video 6.4

Same name and namespace in other branches
  1. 6.5 video.module \video_field_formatter_info()
  2. 7.2 video.field.inc \video_field_formatter_info()
  3. 7 video.field.inc \video_field_formatter_info()

Implementation of CCK's hook_field_formatter_info().

File

./video.module, line 229
video.module

Code

function video_field_formatter_info() {
  $formatters = array(
    'video_plain' => array(
      'label' => t('Video'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays video files with player embedded.'),
    ),
    'video_nodelink' => array(
      'label' => t('Video Thumbnail linked to node'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays the video thumbnail and links to the node.'),
    ),
    'video_thumbnail' => array(
      'label' => t('Video Thumbnail'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays the video thumbnail.'),
    ),
    'video_nonodelink' => array(
      'label' => t('Video Thumbnail'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays the video thumbnail (no link to node).'),
    ),
    //'video_colorbox' => array(

    //  'label' => t('Video Thumbnail to Colorbox'),
    //  'field types' => array('filefield'),
    //  'description' => t('Displays the video thumbnail and adds colorbox support.'),

    //),
    'video_media_js' => array(
      'label' => t('Video inject with jMedia'),
      'field types' => array(
        'filefield',
      ),
      'description' => t('Displays the video by using jmedia javascript.'),
    ),
  );

  //setup our imagecache presets
  if (module_exists('imagecache')) {

    //we need formatters for each of our thumbnails.
    $thumb_types = array(
      'video_nodelink',
      'video_thumbnail',
      'video_nonodelink',
    );

    //array('video_colorbox', 'video_nodelink');
    foreach ($thumb_types as $types) {
      foreach (imagecache_presets() as $preset) {
        $formatters[$preset['presetname'] . '__' . $types] = array(
          'label' => t('@preset @label', array(
            '@preset' => $preset['presetname'],
            '@label' => $formatters[$types]['label'],
          )),
          'field types' => array(
            'filefield',
          ),
        );
      }
    }
  }
  return $formatters;
}