You are here

function flickrfield_field_formatter_info in Flickr 7

Same name and namespace in other branches
  1. 5 field/flickrfield.module \flickrfield_field_formatter_info()
  2. 6 field/flickrfield.module \flickrfield_field_formatter_info()

Implements hook_field_formatter_info().

File

field/flickrfield.module, line 169
Defines a Flickr field type.

Code

function flickrfield_field_formatter_info() {
  $sizes = flickr_photo_sizes();

  // Formatters for general Flickr field.
  foreach ($sizes as $size => $info) {
    if (stripos($info['label'], t('slideshow')) == FALSE) {
      $formatters[$size] = array(
        'label' => $info['label'],
        'field types' => array(
          'flickrfield',
        ),
      );
    }
  }

  // Formatters for Flickr photoset field.
  foreach ($sizes as $size => $info) {
    if (stripos($info['label'], t('slideshow')) == FALSE) {
      $formatters['photoset_primaryphoto_size' . $size . '_nolink'] = array(
        'label' => t('Primary set photo at size "@size"', array(
          '@size' => $info['label'],
        )),
        'field types' => array(
          'flickrfield_photoset',
        ),
      );
      $formatters['photoset_primaryphoto_size' . $size . '_linknode'] = array(
        'label' => t('Primary set photo at size "@size" with link to node', array(
          '@size' => $info['label'],
        )),
        'field types' => array(
          'flickrfield_photoset',
        ),
      );
      $formatters['photoset_primaryphoto_size' . $size . '_linkflickrcomset'] = array(
        'label' => t('Primary set photo at size "@size" with link to set on Flickr.com', array(
          '@size' => $info['label'],
        )),
        'field types' => array(
          'flickrfield_photoset',
        ),
      );
    }
  }
  $formatters['photoset_flickrcomslideshow'] = array(
    'label' => 'Embedded Flickr.com slideshow',
    'field types' => array(
      'flickrfield_photoset',
    ),
  );
  $formatters['photoset_flickrcomslideshow_simple'] = array(
    'label' => 'Embedded Flickr.com slideshow (basic)',
    'field types' => array(
      'flickrfield_photoset',
    ),
  );
  $formatters['photoset_flickrcomsetlink'] = array(
    'label' => 'Link to photo set on Flickr.com',
    'field types' => array(
      'flickrfield_photoset',
    ),
  );
  return $formatters;
}