Project

General

Profile

Paste
Download (2.28 KB) Statistics
| Branch: | Revision:

root / drupal7 / sites / all / modules / media / media.file_default_displays.inc @ 2b3c8cc1

1 ca0757b9 Assos Assos
<?php
2
3
/**
4
 * @file
5
 * Default display configuration for the default file types.
6
 */
7
8
/**
9
 * Implements hook_file_default_displays().
10
 */
11
function media_file_default_displays() {
12
  $file_displays = array();
13
14
  // Audio previews should be displayed using a large filetype icon.
15
  $file_display = new stdClass();
16
  $file_display->api_version = 1;
17
  $file_display->name = 'audio__preview__file_field_media_large_icon';
18 2b3c8cc1 Assos Assos
  $file_display->weight = 49;
19 ca0757b9 Assos Assos
  $file_display->status = TRUE;
20 2b3c8cc1 Assos Assos
  $file_display->settings = array(
21
    'image_style' => 'media_thumbnail',
22
  );
23 ca0757b9 Assos Assos
  $file_displays['audio__preview__file_field_media_large_icon'] = $file_display;
24
25
  // Document previews should be displayed using a large filetype icon.
26
  $file_display = new stdClass();
27
  $file_display->api_version = 1;
28
  $file_display->name = 'document__preview__file_field_media_large_icon';
29 2b3c8cc1 Assos Assos
  $file_display->weight = 49;
30 ca0757b9 Assos Assos
  $file_display->status = TRUE;
31 2b3c8cc1 Assos Assos
  $file_display->settings = array(
32
    'image_style' => 'media_thumbnail',
33
  );
34 ca0757b9 Assos Assos
  $file_displays['document__preview__file_field_media_large_icon'] = $file_display;
35
36
  // Image previews should be displayed using a large filetype icon.
37
  $file_display = new stdClass();
38
  $file_display->api_version = 1;
39
  $file_display->name = 'image__preview__file_field_media_large_icon';
40 2b3c8cc1 Assos Assos
  $file_display->weight = 49;
41 ca0757b9 Assos Assos
  $file_display->status = TRUE;
42 2b3c8cc1 Assos Assos
  $file_display->settings = array(
43
    'image_style' => 'media_thumbnail',
44
  );
45 ca0757b9 Assos Assos
  $file_displays['image__preview__file_field_media_large_icon'] = $file_display;
46
47
  // Video previews should be displayed using a large filetype icon.
48
  $file_display = new stdClass();
49
  $file_display->api_version = 1;
50
  $file_display->name = 'video__preview__file_field_media_large_icon';
51 2b3c8cc1 Assos Assos
  $file_display->weight = 49;
52 ca0757b9 Assos Assos
  $file_display->status = TRUE;
53 2b3c8cc1 Assos Assos
  $file_display->settings = array(
54
    'image_style' => 'media_thumbnail',
55
  );
56 ca0757b9 Assos Assos
  $file_displays['video__preview__file_field_media_large_icon'] = $file_display;
57
58
  return $file_displays;
59
}
60
61
/**
62
 * Implements hook_file_default_displays_alter().
63
 */
64
function media_file_default_displays_alter(&$file_displays) {
65
  // Image previews should be displayed using the media image style.
66
  if (isset($file_displays['image__preview__file_field_image'])) {
67
    $file_displays['image__preview__file_field_image']->settings['image_style'] = 'media_thumbnail';
68
  }
69
}