'; } if (filefield_file_listed($file, $field)) { return theme('filefield_file', $file); } return ''; } /** * return whether a file is set to listed taking into consideration * widget default value settings. * * @param $file a populated filefield item. * @param $field a cck field instance array. */ function filefield_file_listed($file, $field) { if ($field['force_list_default']) return (bool)$field['list_default']; return (bool)$file['list']; } /** * Theme function for the 'generic' single file formatter. */ function theme_filefield_file($file) { $path = $file['filepath']; $url = file_create_url($path); $icon = theme('filefield_icon', $file); // . '
' .  print_r($file,1) . '
'; // set options as per anchor format described on http://microformats.org/wiki/file-format-examples // until I move to the more complex microformat described // @ http://darrelopry.com/story/microformats-and-media-rfc-if-you-js-or-css $options = array('attributes' => array('type' => $file['filemime'], 'length' => $file['filesize'])); $options['attributes']['title'] = (isset($file['data']['description'])) ? $file['data']['description'] : $file['filename']; return '
'. $icon . l($file['filename'], $url, $options) .'
'; }