function fancybox_field_formatter_info in fancyBox 6
Same name and namespace in other branches
- 7.2 fancybox.module \fancybox_field_formatter_info()
- 7 fancybox.module \fancybox_field_formatter_info()
Implementation of hook_field_formatter_info().
Add Fancybox and ImageCache formatters to CCK image fields if Imagefield and ImageCache modules are enabled.
File
- ./
fancybox.module, line 511 - Provides the Fancybox jQuery plugin for displaying images, HTML content and multimedia in an elegant box.
Code
function fancybox_field_formatter_info() {
$formatters = array();
if (module_exists('imagecache')) {
$presets = array();
foreach (imagecache_presets() as $preset) {
$presets[$preset['presetname'] . '|fancybox'] = array(
'label' => t('Fancybox: @preset image', array(
'@preset' => $preset['presetname'],
)),
'field types' => array(
'image',
'filefield',
),
);
}
if (is_array($presets)) {
$formatters = array_merge($presets);
}
}
if (module_exists('emvideo')) {
$formatters['emvideo_fancybox_video'] = array(
'label' => t('Fancybox: Image Thumbnail -> Full Size Video'),
'field types' => array(
'emvideo',
),
);
}
return $formatters;
}