Project

General

Profile

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

root / drupal7 / sites / all / modules / file_entity / file_entity.file_default_displays.inc @ 7b2d1845

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 file_entity_file_default_displays() {
12
  $file_displays = array();
13

    
14
  $file_display = new stdClass();
15
  $file_display->api_version = 1;
16
  $file_display->name = 'audio__default__file_field_file_audio';
17
  $file_display->weight = 50;
18
  $file_display->status = TRUE;
19
  $file_display->settings = array(
20
    'controls' => 1,
21
    'controls_list' => array(
22
      'download' => 'download',
23
      'remote_playback' => 'remote_playback',
24
    ),
25
    'autoplay' => 0,
26
    'loop' => 0,
27
    'multiple_file_behavior' => 'tags',
28
  );
29
  $file_displays['audio__default__file_field_file_audio'] = $file_display;
30

    
31
  $file_display = new stdClass();
32
  $file_display->api_version = 1;
33
  $file_display->name = 'audio__preview__file_field_file_default';
34
  $file_display->weight = 50;
35
  $file_display->status = TRUE;
36
  $file_display->settings = '';
37
  $file_displays['audio__preview__file_field_file_default'] = $file_display;
38

    
39
  $file_display = new stdClass();
40
  $file_display->api_version = 1;
41
  $file_display->name = 'audio__teaser__file_field_file_audio';
42
  $file_display->weight = 50;
43
  $file_display->status = TRUE;
44
  $file_display->settings = array(
45
    'controls' => 1,
46
    'controls_list' => array(
47
      'download' => 'download',
48
      'remote_playback' => 'remote_playback',
49
    ),
50
    'autoplay' => 0,
51
    'loop' => 0,
52
    'multiple_file_behavior' => 'tags',
53
  );
54
  $file_displays['audio__teaser__file_field_file_audio'] = $file_display;
55

    
56
  $file_display = new stdClass();
57
  $file_display->api_version = 1;
58
  $file_display->name = 'document__default__file_field_file_default';
59
  $file_display->weight = 50;
60
  $file_display->status = TRUE;
61
  $file_display->settings = '';
62
  $file_displays['document__default__file_field_file_default'] = $file_display;
63

    
64
  $file_display = new stdClass();
65
  $file_display->api_version = 1;
66
  $file_display->name = 'document__preview__file_field_file_default';
67
  $file_display->weight = 50;
68
  $file_display->status = TRUE;
69
  $file_display->settings = '';
70
  $file_displays['document__preview__file_field_file_default'] = $file_display;
71

    
72
  $file_display = new stdClass();
73
  $file_display->api_version = 1;
74
  $file_display->name = 'document__teaser__file_field_file_default';
75
  $file_display->weight = 50;
76
  $file_display->status = TRUE;
77
  $file_display->settings = '';
78
  $file_displays['document__teaser__file_field_file_default'] = $file_display;
79

    
80
  $file_display = new stdClass();
81
  $file_display->api_version = 1;
82
  $file_display->name = 'image__default__file_field_file_default';
83
  $file_display->weight = 50;
84
  $file_display->status = TRUE;
85
  $file_display->settings = '';
86
  $file_displays['image__default__file_field_file_default'] = $file_display;
87

    
88
  $file_display = new stdClass();
89
  $file_display->api_version = 1;
90
  $file_display->name = 'image__preview__file_field_file_default';
91
  $file_display->weight = 50;
92
  $file_display->status = TRUE;
93
  $file_display->settings = '';
94
  $file_displays['image__preview__file_field_file_default'] = $file_display;
95

    
96
  $file_display = new stdClass();
97
  $file_display->api_version = 1;
98
  $file_display->name = 'image__teaser__file_field_file_default';
99
  $file_display->weight = 50;
100
  $file_display->status = TRUE;
101
  $file_display->settings = '';
102
  $file_displays['image__teaser__file_field_file_default'] = $file_display;
103

    
104
  // Enhance the default image displays if the Image module is enabled.
105
  if (module_exists('image')) {
106
    // Images should be displayed as unstyled images by default.
107
    $file_display = new stdClass();
108
    $file_display->api_version = 1;
109
    $file_display->name = 'image__default__file_field_image';
110
    $file_display->weight = 48;
111
    $file_display->status = TRUE;
112
    $file_display->settings = array(
113
      'image_style' => '',
114
      'image_link' => '',
115
    );
116
    $file_displays['image__default__file_field_image'] = $file_display;
117

    
118
    // Image previews should be displayed as image thumbnails by default.
119
    $file_display = new stdClass();
120
    $file_display->api_version = 1;
121
    $file_display->name = 'image__preview__file_field_image';
122
    $file_display->weight = 48;
123
    $file_display->status = TRUE;
124
    $file_display->settings = array(
125
      'image_style' => 'thumbnail',
126
      'image_link' => '',
127
    );
128
    $file_displays['image__preview__file_field_image'] = $file_display;
129

    
130
    // Image teasers should be displayed as medium images by default.
131
    $file_display = new stdClass();
132
    $file_display->api_version = 1;
133
    $file_display->name = 'image__teaser__file_field_image';
134
    $file_display->weight = 48;
135
    $file_display->status = TRUE;
136
    $file_display->settings = array(
137
      'image_style' => 'medium',
138
      'image_link' => 'content',
139
    );
140
    $file_displays['image__teaser__file_field_image'] = $file_display;
141
  }
142

    
143
  $file_display = new stdClass();
144
  $file_display->api_version = 1;
145
  $file_display->name = 'video__default__file_field_file_video';
146
  $file_display->weight = 50;
147
  $file_display->status = TRUE;
148
  $file_display->settings = array(
149
    'controls' => 1,
150
    'controls_list' => array(
151
      'fullscreen' => 'fullscreen',
152
      'download' => 'download',
153
      'remote_playback' => 'remote_playback',
154
    ),
155
    'autoplay' => 0,
156
    'playsinline' => 0,
157
    'loop' => 0,
158
    'width' => '',
159
    'height' => '',
160
    'multiple_file_behavior' => 'tags',
161
  );
162
  $file_displays['video__default__file_field_file_video'] = $file_display;
163

    
164
  $file_display = new stdClass();
165
  $file_display->api_version = 1;
166
  $file_display->name = 'video__preview__file_field_file_default';
167
  $file_display->weight = 50;
168
  $file_display->status = TRUE;
169
  $file_display->settings = '';
170
  $file_displays['video__preview__file_field_file_default'] = $file_display;
171

    
172
  $file_display = new stdClass();
173
  $file_display->api_version = 1;
174
  $file_display->name = 'video__teaser__file_field_file_video';
175
  $file_display->weight = 50;
176
  $file_display->status = TRUE;
177
  $file_display->settings = array(
178
    'controls' => 1,
179
    'controls_list' => array(
180
      'fullscreen' => 'fullscreen',
181
      'download' => 'download',
182
      'remote_playback' => 'remote_playback',
183
    ),
184
    'autoplay' => 0,
185
    'playsinline' => 0,
186
    'loop' => 0,
187
    'width' => '',
188
    'height' => '',
189
    'multiple_file_behavior' => 'tags',
190
  );
191
  $file_displays['video__teaser__file_field_file_video'] = $file_display;
192

    
193
  return $file_displays;
194
}