You are here

function theme_flickrfield_photoset_primaryphoto in Flickr 7

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

Theme function for showing a primary photo of a photo set with optional link. Also includes a link to Flickr.com photo set page to comply with terms of service.

Parameters

array $variables: Holds the values to assign.

string $img: HTML code for image.

string $link: Link to which the image should link to.

string $set_url: URL of the photo set on Flickr.com.

string $size: The flickr size of the image.

string $title: Title to use for the link.

Return value

string HTML to render.

1 theme call to theme_flickrfield_photoset_primaryphoto()
theme_flickrfield_formatter_photoset_primaryphoto in field/flickrfield.module
Theme a Flickr photo set as the primary photo of that set.

File

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

Code

function theme_flickrfield_photoset_primaryphoto($variables) {
  $img = $variables['0'];
  $link = $variables['1'];
  $set_url = $variables['2'];
  $size = $variables['3'];
  $title = $variables['4'];
  if ($link) {
    $output = '<div class="flickr-photoset-img">' . l($img, $link, array(
      'attributes' => array(
        'title' => $title,
      ),
      'html' => TRUE,
    )) . '</div>';
  }
  else {
    $output = '<div class="flickr-photoset-img">' . $img . '</div>';
  }
  $output .= '<div class="flickr-citation">' . l(t('Source: Flickr'), $set_url) . '</div>';
  return $output;
}