function theme_filefield in FileField 5
Same name and namespace in other branches
- 5.2 filefield.module \theme_filefield()
- 6.2 filefield.formatter.inc \theme_filefield()
2 theme calls to theme_filefield()
File
- ./
filefield.module, line 486 - Defines a file field type.
Code
function theme_filefield($file) {
$file = (array) $file;
if (is_file($file['filepath'])) {
if ($file['fid'] == 'upload') {
$path = file_create_filename($file['filename'], file_create_path());
}
else {
$path = $file['filepath'];
}
$url = file_create_url($path);
$name = $file['filename'];
$desc = $file['description'];
return '<a href="' . check_url($url) . '">' . check_plain($name) . '</a>';
}
}