function _filefield_icon_path in FileField 6.2
Same name and namespace in other branches
- 5.2 filefield.module \_filefield_icon_path()
- 6.3 filefield.theme.inc \_filefield_icon_path()
1 call to _filefield_icon_path()
- _filefield_icon_url in ./filefield.theme.inc
File
- ./filefield.theme.inc, line 93
- FileField: Defines a CCK file field type.
Code
function _filefield_icon_path($file, $theme = 'protocons') {
$dashed_mime = strtr($file['filemime'], array(
'/' => '-',
));
if ($iconpath = _filefield_create_icon_path($dashed_mime, $theme)) {
return $iconpath;
}
if ($generic_name = _filefield_generic_icon_map($file)) {
if ($iconpath = _filefield_create_icon_path($generic_name, $theme)) {
return $iconpath;
}
}
foreach (array(
'audio',
'image',
'text',
'video',
) as $category) {
if (strpos($file['filemime'], $category . '/') === 0) {
if ($iconpath = _filefield_create_icon_path($category . '-x-generic', $theme)) {
return $iconpath;
}
}
}
if ($iconpath = _filefield_create_icon_path('application-octet-stream', $theme)) {
return $iconpath;
}
return FALSE;
}