function emthumb_field_formatter_info in Embedded Media Field 6.3
Same name and namespace in other branches
- 6 contrib/emthumb/emthumb.module \emthumb_field_formatter_info()
- 6.2 contrib/emthumb/emthumb.module \emthumb_field_formatter_info()
Implementation of hook_field_formatter_info().
imagecache formatters are named as $presetname_$style $style is used to determine how the preset should be rendered. If you are implementing custom imagecache formatters please treat _ as reserved.
@todo: move the linking functionality up to imagefield and clean up the default image integration.
File
- contrib/
emthumb/ emthumb.module, line 986 - Allows for custom thumbnail overrides to Embedded Media Field.
Code
function emthumb_field_formatter_info() {
$formatters = array();
if (!module_exists('imagecache')) {
return $formatters;
}
$field_types = array(
'emvideo',
'emimage',
'emaudio',
);
foreach (imagecache_presets() as $preset) {
$formatters[$preset['presetname'] . '_default'] = array(
'label' => t('@preset image', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_linked'] = array(
'label' => t('@preset image linked to node', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_imagelink'] = array(
'label' => t('@preset image linked to original image', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_path'] = array(
'label' => t('@preset file path', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_url'] = array(
'label' => t('@preset URL', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_providerlink'] = array(
'label' => t('@preset image linked to provider', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_full'] = array(
'label' => t('@preset image -> Full Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
$formatters[$preset['presetname'] . '_preview'] = array(
'label' => t('@preset image -> Preview Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
// Add colorbox formatter if colorbox module exists.
if (module_exists('colorbox')) {
$formatters[$preset['presetname'] . '_colorbox'] = array(
'label' => t('Colorbox: @preset image -> Full Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
}
// Add thickbox formatter if thickbox module exists.
if (module_exists('thickbox')) {
$formatters[$preset['presetname'] . '_thickbox'] = array(
'label' => t('Thickbox: @preset image -> Full Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
}
if (module_exists('lightbox2')) {
$formatters[$preset['presetname'] . '_lightbox2'] = array(
'label' => t('Lightbox2: @preset image -> Full Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
}
if (module_exists('shadowbox')) {
$formatters[$preset['presetname'] . '_shadowbox'] = array(
'label' => t('Shadowbox: @preset image -> Full Size Media', array(
'@preset' => $preset['presetname'],
)),
'field types' => $field_types,
);
}
}
return $formatters;
}