You are here

function theme_filefield_formatter_path_plain in FileField 6.3

Theme function for the 'path_plain' formatter.

File

./filefield_formatter.inc, line 25
FileField: Defines a CCK file field type.

Code

function theme_filefield_formatter_path_plain($element) {

  // Inside a View this function may be called with null data. In that case,
  // just return.
  if (empty($element['#item'])) {
    return '';
  }
  $field = content_fields($element['#field_name']);
  $item = $element['#item'];

  // If there is no image on the database, use default.
  if (empty($item['fid']) && $field['use_default_file']) {
    $item = $field['default_file'];
  }
  if (empty($item['filepath']) && !empty($item['fid'])) {
    $item = array_merge($item, field_file_load($item['fid']));
  }
  return empty($item['filepath']) ? '' : check_plain(file_create_path($item['filepath']));
}