You are here

function theme_filefield in FileField 5.2

Same name and namespace in other branches
  1. 5 filefield.module \theme_filefield()
  2. 6.2 filefield.formatter.inc \theme_filefield()
2 theme calls to theme_filefield()
filefield_field_formatter in ./filefield.module
theme_filefield_view_file in ./filefield.module

File

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

Code

function theme_filefield($file) {
  if (user_access('view filefield uploads') && is_file($file['filepath']) && $file['list']) {
    $path = $file['fid'] == 'upload' ? file_create_filename($file['filename'], file_create_path($field['widget']['file_path'])) : $file['filepath'];
    $icon = theme('filefield_icon', $file);
    $url = file_create_url($path);
    $desc = $file['description'];
    return '<div class="filefield-item clear-block">' . $icon . l($desc, $url) . '</div>';
  }
  return '';
}