1
|
<?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
|
$file_display->weight = 49;
|
19
|
$file_display->status = TRUE;
|
20
|
$file_display->settings = array(
|
21
|
'image_style' => 'media_thumbnail',
|
22
|
);
|
23
|
$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
|
$file_display->weight = 49;
|
30
|
$file_display->status = TRUE;
|
31
|
$file_display->settings = array(
|
32
|
'image_style' => 'media_thumbnail',
|
33
|
);
|
34
|
$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
|
$file_display->weight = 49;
|
41
|
$file_display->status = TRUE;
|
42
|
$file_display->settings = array(
|
43
|
'image_style' => 'media_thumbnail',
|
44
|
);
|
45
|
$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
|
$file_display->weight = 49;
|
52
|
$file_display->status = TRUE;
|
53
|
$file_display->settings = array(
|
54
|
'image_style' => 'media_thumbnail',
|
55
|
);
|
56
|
$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
|
}
|