function lightbox2_supported_file_extension in Lightbox2 5.2
Same name and namespace in other branches
- 8 lightbox2.module \lightbox2_supported_file_extension()
- 6 lightbox2.module \lightbox2_supported_file_extension()
- 7.2 lightbox2.module \lightbox2_supported_file_extension()
- 7 lightbox2.module \lightbox2_supported_file_extension()
Check whether a given file extension is supported by the lightbox iframe.
Parameters
$ext: File extension
Return value
TRUE if extension is supported.
1 call to lightbox2_supported_file_extension()
- lightbox2_filefield_formatter in ./
lightbox2.module - Function to display a filefield file in a lightbox.
File
- ./
lightbox2.module, line 2271 - Enables the use of lightbox2 which places images above your current page, not within. This frees you from the constraints of the layout, particularly column widths.
Code
function lightbox2_supported_file_extension($ext) {
$extensions = array(
// Image extensions.
'png',
'jpg',
'jpeg',
'gif',
'bmp',
// Movie extensions.
'dv',
'mov',
'moov',
'movie',
'mp4',
'asf',
'wm',
'wmv',
'avi',
'mpg',
'mpeg',
// Website extensions.
'asp',
'aspx',
'cgi',
'cfm',
'htm',
'html',
'pl',
'php',
'php3',
'php4',
'php5',
'phtml',
'rb',
'rhtml',
'shtml',
'txt',
'vbs',
// Other extensions.
'pdf',
);
if (in_array(drupal_strtolower($ext), $extensions)) {
return TRUE;
}
return FALSE;
}