function filefield_field_formatter in FileField 5.2
Same name and namespace in other branches
- 5 filefield.module \filefield_field_formatter()
File
- ./
filefield.module, line 723 - Defines a file field type.
Code
function filefield_field_formatter($field, $item, $formatter) {
if ($field['force_list']) {
$item['list'] = 1;
// always show the files if that option is enabled
}
if (!empty($item['fid'])) {
$item = array_merge($item, _filefield_file_load($item['fid']));
}
if (!empty($item['filepath'])) {
drupal_add_css(drupal_get_path('module', 'filefield') . '/filefield.css');
return theme('filefield', $item);
}
}