/**
  * Returns a image-tag for thumbnail(s)
  * A file icon will be returned if no thumbnail is possible
  * If 'href' and/or 'onlick' is set as attributes a A tag will be wrapped around with these.
  *
  * @param	mixed		$fileInfo Is a file path or an array containing a file info from tx_dam::file_compileInfo().
  * @param	string		$size Optional: $size is [w]x[h] of the thumbnail. 56 is default.
  * @param	mixed		$imgAttributes Optional: is additional attributes for the image tags
  * @param	mixed		$iconAttributes Optional: additional attributes for the image tags for file icons
  * @param	string		$onClick Optional: If falso no A tag with onclick will be wrapped. If NULL top.launchView() will be used. If string it's value will be used as onclick value.
  * @param	boolean		$makeFileIcon If true a file icon will be returned if no thumbnail is possible
  * @return	string		Thumbnail image tag.
  */
 function image_thumbnailIconImgTag($fileInfo, $size = '', $imgAttributes = '', $iconAttributes = '', $makeFileIcon = TRUE)
 {
     $thumbnail = '';
     if (!is_array($imgAttributes)) {
         $imgAttributes = tx_dam_guifunc::tools_explodeAttributes($imgAttributes);
     }
     $href = $imgAttributes['href'];
     $onclick = $imgAttributes['onclick'];
     unset($imgAttributes['href']);
     unset($imgAttributes['onclick']);
     $thumbnail = tx_dam_image::previewImgTag($fileInfo, $size, $imgAttributes);
     if (!$thumbnail and $makeFileIcon) {
         if (!is_array($iconAttributes)) {
             $iconAttributes = tx_dam_guifunc::tools_explodeAttributes($iconAttributes);
         }
         $href = $iconAttributes['href'];
         $onclick = $iconAttributes['onclick'];
         unset($iconAttributes['href']);
         unset($iconAttributes['onclick']);
         $fileType = tx_dam::file_getType($fileInfo);
         $thumbnail = tx_dam_guiFunc::icon_getFileTypeImgTag($fileType, $iconAttributes);
     }
     if ($thumbnail and ($onclick or $href)) {
         $href = $href ? $href : '#';
         $thumbnail = '<a href="' . htmlspecialchars($href) . '" onclick="' . htmlspecialchars($onclick) . '">' . $thumbnail . '</a>';
     }
     return $thumbnail;
 }