You are here

function theme_itweak_upload_thumbnail in iTweak Upload 7.3

Same name and namespace in other branches
  1. 6.2 itweak_upload.module \theme_itweak_upload_thumbnail()

Theme function to show image attachment thumbnail

Parameters

$variables: An associative array containing:

  • thumbnail: Link to thumbnail.
  • url: URL to link thumbnail to.
  • title_text: (optional) Text for thumbnail open link title.
  • caption_text: (optional) Text for thumbnail caption.
  • options: (optional) array of options for the thumbnail link. See theme_itweak_upload_image_gallery().

Return value

The themed thumbnail

1 theme call to theme_itweak_upload_thumbnail()
itweak_upload_itweak_upload_preview in ./itweak_upload.module
Implementation of hook_itweak_upload_preview().

File

./itweak_upload.module, line 1190
iTweakUpload - Tweak attachments display and file upload forms.

Code

function theme_itweak_upload_thumbnail($variables) {
  $thumbnail = $variables['thumbnail'];
  $url = $variables['url'];
  $title_text = $variables['title_text'];
  $caption_text = $variables['caption_text'];
  $options = $variables['options'];

  //  $inner = '<div class="itu-attachment-thumb-wrap">' . $thumbnail . '</div>';
  //  if ($caption_text) {
  //    $inner = '<div class="itu-attachment-thumb-caption">' . $caption_text . '</div>'
  //                  . $inner;
  //  }
  //  $inner = '<div class="itu-attachment-thumb">' . $inner . '</div>';
  //  return l($inner, $url, array('html' => TRUE));
  if (!$options) {
    $options = array();
  }
  $options += array(
    'html' => TRUE,
  );
  if ($title_text) {
    $options['attributes']['title'] = $title_text;
  }

  //@todo: Figure out if we need to add type="..." and how per http://microformats.org/wiki/file-format-examples (see theme_file_link_itu())
  $html = l($thumbnail, $url, $options);

  // FIXME: Due to CSS2/cross-browser capability to make shrink-wrap div, the below part does not work.
  // Any CSS guru can solve that? BTW, tooltips are shown by title in img.
  //  if ($caption_text) {
  //    $html = '<div class="itu-attachment-thumb-caption">' . $caption_text . '</div>' . $html;
  //    // FIXME: can use caption ABOVE vs. BELOW setting
  //  }
  $html = '<div class="itu-attachment-thumb">' . $html . '</div>';
  return $html;
}