You are here

function theme_filefield_icon in FileField 5.2

Same name and namespace in other branches
  1. 5 filefield.module \theme_filefield_icon()
  2. 6.3 filefield.theme.inc \theme_filefield_icon()
  3. 6.2 filefield.theme.inc \theme_filefield_icon()
2 theme calls to theme_filefield_icon()
theme_filefield in ./filefield.module
_filefield_file_form in ./filefield.module

File

./filefield.module, line 780
Defines a file field type.

Code

function theme_filefield_icon($file) {
  $mime = check_plain($file['filemime']);
  $dashed_mime = strtr($mime, array(
    '/' => '-',
  ));
  if ($icon_url = filefield_icon_url($file)) {
    $icon = '<img class="field-icon-' . $dashed_mime . '"  alt="' . $mime . ' icon" src="' . $icon_url . '" />';
  }
  return '<div class="filefield-icon field-icon-' . $dashed_mime . '">' . $icon . '</div>';
}