You are here

function media_gallery_update_7002 in Media Gallery 7

Same name and namespace in other branches
  1. 7.2 media_gallery.install \media_gallery_update_7002()

Configure video formatters to desired defaults for gallery view modes.

File

./media_gallery.install, line 1068
Install file for media_gallery. Includes field and instance definitions.

Code

function media_gallery_update_7002() {
  drupal_load('module', 'field');
  $bundle = 'video';
  $bundle_settings = field_bundle_settings('media', $bundle);
  $bundle_settings['view_modes']['media_gallery_thumbnail']['custom_settings'] = TRUE;
  $bundle_settings['view_modes']['media_gallery_lightbox']['custom_settings'] = TRUE;
  $bundle_settings['view_modes']['media_gallery_detail']['custom_settings'] = TRUE;
  $bundle_settings['view_modes']['media_gallery_block_thumbnail']['custom_settings'] = TRUE;
  $bundle_settings['view_modes']['media_gallery_collection_thumbnail']['custom_settings'] = TRUE;
  field_bundle_settings('media', $bundle, $bundle_settings);
  $instance = field_info_instance('media', 'file', $bundle);
  $instance['display']['media_gallery_thumbnail'] = array(
    'type' => 'styles_file_media_gallery_thumbnail',
    'label' => 'hidden',
  );
  $instance['display']['media_gallery_lightbox'] = array(
    'type' => 'styles_file_media_gallery_large',
    'label' => 'hidden',
  );
  $instance['display']['media_gallery_detail'] = array(
    'type' => 'styles_file_media_gallery_large',
    'label' => 'hidden',
  );
  $instance['display']['media_gallery_block_thumbnail'] = array(
    'type' => 'styles_file_media_gallery_thumbnail',
    'label' => 'hidden',
  );
  $instance['display']['media_gallery_collection_thumbnail'] = array(
    'type' => 'styles_file_media_gallery_thumbnail',
    'label' => 'hidden',
  );
  field_update_instance($instance);
}