You are here

function scald_image_install in Scald: Media Management made easy 7

Same name and namespace in other branches
  1. 6 scald_image/scald_image.install \scald_image_install()

Implements hook_install().

File

modules/providers/scald_image/scald_image.install, line 10
Scald Images Installation

Code

function scald_image_install() {
  ScaldAtomController::addType('image', 'Image', 'Image');
  $instance = field_read_instance('scald_atom', 'scald_thumbnail', 'image');
  if ($instance) {
    $instance['label'] = 'Image';
    foreach ($instance['display'] as $view_mode => $settings) {
      $instance['display'][$view_mode]['type'] = 'hidden';
    }
    field_update_instance($instance);
  }

  // Associate the image atom type to the "library" image style in the library
  // context.
  $context_config = scald_context_config_load('sdl_library_item');
  $context_config->transcoder['image']['*'] = 'style-library';
  scald_context_config_save($context_config);
}