You are here

function video_field_formatter_info in Video 6.5

Same name and namespace in other branches
  1. 6.4 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 276
Main file of the 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_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',
    );
    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;
}