You are here

function theme_flickrfield_photoset in Flickr 5

Same name and namespace in other branches
  1. 6 field/flickrfield.module \theme_flickrfield_photoset()
1 theme call to theme_flickrfield_photoset()
flickrfield_field_formatter in field/flickrfield.module
Implementation of hook_field_formatter().

File

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

Code

function theme_flickrfield_photoset($img, $photo_url, $formatter, $photo_data, $node) {
  $title = is_array($photo_data['title']) ? $photo_data['title']['_content'] : $photo_data['title'];
  if (arg(0) == 'node' && arg(1) == $node->nid) {
    $output = '<div class="flickr-photoset-img">' . $img . '</div>';
  }
  else {
    $output = '<div class="flickr-photoset-img">' . l($img, 'node/' . $node->nid, array(
      'title' => $title,
    ), NULL, NULL, TRUE, TRUE) . '</div>';
  }
  $output .= '<div class="flickr-citation"><cite>' . l(t('Source: Flickr'), $photo_url) . '</cite></div>';
  return $output;
}