Révision 29771811
Ajouté par Assos Assos il y a presque 5 ans
drupal7/sites/all/modules/media/media.module | ||
---|---|---|
362 | 362 |
$form['instance']['settings']['file_extensions']['#required'] = FALSE; |
363 | 363 |
} |
364 | 364 |
|
365 |
// On image fields using the media widget we remove the alt/title fields. |
|
366 | 365 |
if ($form['#field']['type'] == 'image' && $form['instance']['widget']['type']['#value'] == 'media_generic') { |
367 |
$form['instance']['settings']['alt_field']['#access'] = FALSE; |
|
368 |
$form['instance']['settings']['title_field']['#access'] = FALSE; |
|
369 | 366 |
$form['instance']['settings']['file_extensions']['#title'] = t('Allowed file extensions for uploaded files'); |
370 | 367 |
// Do not increase maxlength of file extensions for image fields, since |
371 | 368 |
// presumably they will not need a long list of extensions. |
... | ... | |
497 | 494 |
)) |
498 | 495 |
), |
499 | 496 |
'styleSelectorUrl' => url('media/-media_id-/format-form', array( |
500 |
'query' => array( |
|
501 |
'render' => 'media-popup' |
|
502 |
)) |
|
497 |
'query' => array('render' => 'media-popup') |
|
498 |
) |
|
503 | 499 |
), |
504 | 500 |
'dialogOptions' => array( |
505 | 501 |
'dialogclass' => variable_get('media_dialogclass', 'media-wrapper'), |
506 |
'modal' => (boolean)variable_get('media_modal', TRUE), |
|
507 |
'draggable' => (boolean)variable_get('media_draggable', FALSE), |
|
508 |
'resizable' => (boolean)variable_get('media_resizable', FALSE), |
|
509 |
'minwidth' => (int)variable_get('media_minwidth', 500), |
|
510 |
'width' => (int)variable_get('media_width', 670), |
|
511 |
'height' => (int)variable_get('media_height', 280), |
|
502 |
'modal' => (boolean) variable_get('media_modal', TRUE),
|
|
503 |
'draggable' => (boolean) variable_get('media_draggable', FALSE),
|
|
504 |
'resizable' => (boolean) variable_get('media_resizable', FALSE),
|
|
505 |
'minwidth' => (int) variable_get('media_minwidth', 500),
|
|
506 |
'width' => (int) variable_get('media_width', 670),
|
|
507 |
'height' => (int) variable_get('media_height', 280),
|
|
512 | 508 |
'position' => variable_get('media_position', 'center'), |
513 | 509 |
'overlay' => array( |
514 | 510 |
'backgroundcolor' => variable_get('media_backgroundcolor', '#000000'), |
515 |
'opacity' => (float)variable_get('media_opacity', 0.4), |
|
511 |
'opacity' => (float) variable_get('media_opacity', 0.4),
|
|
516 | 512 |
), |
517 |
'zindex' => (int)variable_get('media_zindex', 10000), |
|
513 |
'zindex' => (int) variable_get('media_zindex', 10000),
|
|
518 | 514 |
), |
519 | 515 |
); |
520 | 516 |
|
... | ... | |
626 | 622 |
if (isset($uri)) { |
627 | 623 |
// Attempt to load an existing file from the unique URI. |
628 | 624 |
$select = db_select('file_managed', 'f') |
629 |
->extend('PagerDefault') |
|
630 |
->fields('f', array('fid')) |
|
631 |
->condition('uri', $uri); |
|
625 |
->extend('PagerDefault')
|
|
626 |
->fields('f', array('fid'))
|
|
627 |
->condition('uri', $uri);
|
|
632 | 628 |
|
633 | 629 |
$fid = $select->execute()->fetchCol(); |
634 | 630 |
if (!empty($fid)) { |
... | ... | |
649 | 645 |
$source_uri = file_stream_wrapper_uri_normalize('temporary://' . basename($url)); |
650 | 646 |
if (!@copy(@$url, $source_uri)) { |
651 | 647 |
throw new Exception('Unable to add file ' . $url); |
652 |
return; |
|
653 | 648 |
} |
654 | 649 |
$source_file = file_uri_to_object($source_uri); |
655 |
if(isset($params['to_directory'])){
|
|
650 |
if (isset($params['to_directory'])) {
|
|
656 | 651 |
$scheme = variable_get('file_default_scheme', 'public') . '://' . $params['to_directory'] . '/'; |
657 | 652 |
} |
658 | 653 |
else{ |
Formats disponibles : Unified diff
Weekly update of contrib modules