You are here

function file_styles_display_info_defaults in Styles 7.2

1 call to file_styles_display_info_defaults()
file_styles_entity_info_alter in contrib/file_styles/file_styles.module
Implements hook_entity_info_alter().

File

contrib/file_styles/file_styles.module, line 182
styles/contrib/file_styles/file_styles.module File widget formatter definitions.

Code

function file_styles_display_info_defaults($file_type, $view_mode, $style_name) {
  $formatter_name = 'file_field_styles_file_' . $style_name;
  $display = array(
    'status' => 1,
    'weight' => 0,
  );
  $displays_original = file_displays_load($file_type, $view_mode, TRUE);
  if (!isset($displays_original[$formatter_name])) {
    $display_original = file_display_new($file_type, $view_mode, $formatter_name);
    $display += (array) $display_original;
    file_display_save((object) $display);
  }
}