function panopoly_images_file_default_displays_alter in Panopoly 7
Implements hook_file_default_displays_alter().
File
- modules/
panopoly/ panopoly_images/ panopoly_images.module, line 118
Code
function panopoly_images_file_default_displays_alter(&$file_displays) {
// Disable some displays that are enabled by Media and File Entity by default.
$disable_displays = array(
'image__default__file_field_file_default',
'image__teaser__file_field_file_default',
'image__preview__file_field_file_default',
'image__preview__file_field_media_large_icon',
);
foreach ($disable_displays as $name) {
if (isset($file_displays[$name])) {
$file_displays[$name]->status = FALSE;
}
}
// Modify some displays that are configured by Media and File Entity.
if (isset($file_displays['image__default__file_field_image'])) {
$file_displays['image__default__file_field_image']->settings['image_style'] = 'panopoly_image_original';
}
if (isset($file_displays['image__preview__file_field_image'])) {
$file_displays['image__preview__file_field_image']->settings['image_style'] = 'panopoly_image_thumbnail';
}
if (isset($file_displays['image__teaser__file_field_image'])) {
$file_displays['image__teaser__file_field_image']->settings['image_style'] = 'panopoly_image_quarter';
}
}