Révision ca0757b9
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/file_entity/file_entity.field.inc | ||
---|---|---|
160 | 160 |
'#type' => 'checkbox', |
161 | 161 |
'#default_value' => $settings['loop'], |
162 | 162 |
); |
163 |
$element['muted'] = array( |
|
164 |
'#title' => t('Muted'), |
|
165 |
'#type' => 'checkbox', |
|
166 |
'#default_value' => $settings['muted'], |
|
167 |
); |
|
163 | 168 |
$element['width'] = array( |
164 | 169 |
'#type' => 'textfield', |
165 | 170 |
'#title' => t('Width'), |
... | ... | |
220 | 225 |
if (isset($settings['multiple_file_behavior'])) { |
221 | 226 |
$summary[] = t('Multiple files: %multiple', array('%multiple' => $settings['multiple_file_behavior'])); |
222 | 227 |
} |
223 |
|
|
224 | 228 |
} |
225 | 229 |
elseif ($display['type'] === 'file_video') { |
226 |
$summary_items = array(); |
|
227 | 230 |
if (isset($settings['controls'])) { |
228 | 231 |
$summary[] = t('Controls: %controls', array('%controls' => $settings['controls'] ? 'visible' : 'hidden')); |
229 | 232 |
} |
... | ... | |
286 | 289 |
foreach ($items as $delta => $item) { |
287 | 290 |
if (!isset($recursion_queue[$item['fid']])) { |
288 | 291 |
$files_display[$item['fid']] = file_load($item['fid']); |
292 |
if (!empty($item['description'])) { |
|
293 |
$files_display[$item['fid']]->description = $item['description']; |
|
294 |
} |
|
289 | 295 |
} |
290 | 296 |
} |
291 | 297 |
|
... | ... | |
293 | 299 |
if ($files_display) { |
294 | 300 |
foreach ($files_display as $fid => $file) { |
295 | 301 |
$files_display[$fid]->referencing_entity = $entity; |
302 |
$files_display[$fid]->referencing_entity_type = $entity_type; |
|
296 | 303 |
$files_display[$fid]->referencing_field = $field['field_name']; |
297 | 304 |
} |
298 | 305 |
$output = file_view_multiple($files_display, $view_mode); |
... | ... | |
330 | 337 |
if ($multiple_file_behavior == 'tags') { |
331 | 338 |
foreach ($items as $delta => $item) { |
332 | 339 |
if ($item['type'] == 'audio') { |
333 |
$source_lists[] = array($item); |
|
340 |
$source_lists[$delta] = array($item);
|
|
334 | 341 |
} |
335 | 342 |
} |
336 | 343 |
} |
337 | 344 |
else { |
338 | 345 |
foreach ($items as $delta => $item) { |
339 | 346 |
if ($item['type'] == 'audio') { |
340 |
$source_lists[0][] = $item; |
|
347 |
$source_lists[0][$delta] = $item;
|
|
341 | 348 |
} |
342 | 349 |
} |
343 | 350 |
} |
... | ... | |
364 | 371 |
if ($multiple_file_behavior == 'tags') { |
365 | 372 |
foreach ($items as $delta => $item) { |
366 | 373 |
if ($item['type'] == 'video') { |
367 |
$source_lists[] = array($item); |
|
374 |
$source_lists[$delta] = array($item);
|
|
368 | 375 |
} |
369 | 376 |
} |
370 | 377 |
} |
371 | 378 |
else { |
372 | 379 |
foreach ($items as $delta => $item) { |
373 | 380 |
if ($item['type'] == 'video') { |
374 |
$source_lists[0][] = $item; |
|
381 |
$source_lists[0][$delta] = $item;
|
|
375 | 382 |
} |
376 | 383 |
} |
377 | 384 |
} |
378 | 385 |
|
379 | 386 |
// Render each source list as an <video> element. |
380 | 387 |
foreach ($source_lists as $delta => $sources) { |
381 |
$width = $settings['width']; |
|
382 |
$height = $settings['height']; |
|
383 | 388 |
$element[$delta] = array( |
384 | 389 |
'#theme' => 'file_entity_file_video', |
385 | 390 |
'#files' => $sources, |
... | ... | |
387 | 392 |
'#autoplay' => $settings['autoplay'], |
388 | 393 |
'#loop' => $settings['loop'], |
389 | 394 |
'#muted' => $settings['muted'], |
390 |
'#width' => ($width && $height) ? $width : NULL,
|
|
391 |
'#height' => ($width && $height) ? $height : NULL,
|
|
395 |
'#width' => $settings['width'],
|
|
396 |
'#height' => $settings['height'],
|
|
392 | 397 |
); |
393 | 398 |
} |
394 | 399 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules