function _webfm_get_icon in Web File Manager 5.2
Same name and namespace in other branches
- 5 webfm.module \_webfm_get_icon()
Helper func to associate the listing icon with the mime type
1 call to _webfm_get_icon()
- theme_webfm_attachments in ./
webfm.module - Displays file attachments in table
File
- ./
webfm.module, line 586
Code
function _webfm_get_icon($ext) {
// Try and find appropriate type
switch (strtolower($ext)) {
case 'image/gif':
case 'image/png':
case 'image/jpg':
case 'image/jpeg':
case 'image/bmp':
case 'image/tiff':
case 'jpg':
case 'gif':
case 'png':
case 'jpeg':
case 'bmp':
case 'tiff':
$icon = 'i.gif';
break;
case 'video/mpeg':
case 'video/quicktime':
case 'video/x-msvideo':
case 'avi':
$icon = 'avi.gif';
break;
case 'audio/mpeg':
case 'mpeg':
case 'mp3':
$icon = 'mp3.gif';
break;
case 'application/pdf':
case 'pdf':
$icon = 'pdf.gif';
break;
case 'application/zip':
case 'application/x-zip':
case 'application/x-gzip':
case 'zip':
$icon = 'zip.gif';
break;
case 'application/msword':
case 'doc':
case 'odt':
$icon = 'doc.gif';
break;
case 'application/vnd.ms-excel':
case 'xls':
$icon = 'xls.gif';
break;
default:
$icon = 'f.gif';
break;
}
return $icon;
}