You are here

function theme_filefield in FileField 6.2

Same name and namespace in other branches
  1. 5.2 filefield.module \theme_filefield()
  2. 5 filefield.module \theme_filefield()

Theme function for any file that is managed by filefield. It doesn't really format stuff by itself but rather redirects to other formatters that are telling us they want to handle the concerned file.

This function checks if the file may be shown and returns an empty string if viewing the file is not allowed for any reason. If you need to display it in any case, please use theme('filefield') instead.

1 theme call to theme_filefield()
theme_filefield_formatter_default in ./filefield.formatter.inc
Theme function for the 'default' filefield formatter.

File

./filefield.formatter.inc, line 30
FileField: Defines a CCK file field type.

Code

function theme_filefield($file, $field) {
  if (!filefield_view_access($field['field_name'])) {
    return '';
  }
  if ($field['force_list']) {
    $file['list'] = 1;

    // always show the files if that option is enabled
  }
  if (empty($file['list'])) {
    return '';
  }
  return theme('filefield_unguarded', $file, $field);
}