You are here

function theme_image_ncck_image_thumbnail in Embedded Media Field 5

File

contrib/image_ncck/image_ncck.module, line 330

Code

function theme_image_ncck_image_thumbnail($field, $item, $formatter, $node) {
  if ($item['value'] && $item['provider']) {
    $code = $item['value'];
    $width = $field['widget']['thumbnail_width'] === '' ? IMAGE_NCCK_DEFAULT_THUMBNAIL_WIDTH : $field['widget']['thumbnail_width'];
    $height = $field['widget']['thumbnail_height'] === '' ? IMAGE_NCCK_DEFAULT_THUMBNAIL_HEIGHT : $field['widget']['thumbnail_height'];
    $link = $field['widget']['thumbnail_link'] === '' ? IMAGE_NCCK_DEFAULT_THUMBNAIL_LINK : $field['widget']['thumbnail_link'];
    if ($link == IMAGE_NCCK_LINK_CONTENT) {
      $link = 'node/' . $node->nid;
    }
    else {
      if ($link == IMAGE_NCCK_LINK_PROVIDER) {
        $link = module_invoke('emfield', 'include_invoke', 'image_ncck', $item['provider'], 'embedded_link', $code, $item['data']);
      }
      else {
        $link = NULL;
      }
    }
    $title = module_invoke('emfield', 'include_invoke', 'image_ncck', $item['provider'], 'image_title', $code, $item['data']);
    $output = theme('image_ncck_image', $field, $item, $formatter, $node, $code, $width, $height, $title, $link);
  }
  return $output;
}