Projet

Général

Profil

Révision 29771811

Ajouté par Assos Assos il y a presque 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media/css/media.css
19 19
  display: none;
20 20
}
21 21

  
22
/* Workaround for Modal dialog underneith the Ctools modal dialog with jQuery 1.10. 
22
/* Workaround for Modal dialog underneith the Ctools modal dialog with jQuery 1.10.
23 23
   @TODO Remove this if ever ctools issue #1397370 ever gets fixed. */
24 24
.ui-front.media-wrapper {
25 25
  z-index: 10001 !important;
......
69 69

  
70 70
.media-item {
71 71
  background: #eee;
72
  border: 1px solid #CCCCCC;
72
  border: 1px solid #cccccc;
73 73
  box-shadow: inset 0 0 15px rgba(0,0,0,.1), inset 0 0 0 1px rgba(0,0,0,.05);
74 74
  display: inline-block;
75 75
  padding: 5px;
......
116 116
}
117 117

  
118 118
.media-list-thumbnails .media-item.selected {
119
  background: #F4ECC7;
120
  border-color: #058AC5;
119
  background: #f4ecc7;
120
  border-color: #058ac5;
121 121
}
122 122

  
123 123
.media-list-thumbnails .media-item:hover {
124
  border-color: #058AC5;
124
  border-color: #058ac5;
125 125
  cursor: pointer;
126 126
}
127 127

  
128 128
.media-list-thumbnails .media-item .label-wrapper label {
129
  color: #058AC5;
129
  color: #058ac5;
130 130
}
131 131

  
132 132
.media-list-thumbnails .media-item .label-wrapper label:hover {
......
152 152
/* Exposed filter field */
153 153
/* Use similar look and feel of a disabled field */
154 154
.media-ajaxing-disabled {
155
  background-color: #EBEBE4;
155
  background-color: #ebebe4;
156 156
}
drupal7/sites/all/modules/media/includes/MediaBrowserPlugin.inc
20 20
  protected $info;
21 21

  
22 22
  /**
23
   * The parameters for the current media browser from
24
   * media_get_browser_params().
23
   * The parameters for current media browser from media_get_browser_params().
25 24
   *
26 25
   * @var array
27 26
   */
......
83 82
   *   Renderable array.
84 83
   */
85 84
  abstract public function view();
85

  
86 86
}
drupal7/sites/all/modules/media/includes/MediaBrowserPluginInterface.inc
22 22
   *   An array of parameters which came in is $_GET['params']. The expected
23 23
   *   parameters are still being defined.
24 24
   *   - 'types': array of media types to support
25
   *   - 'multiselect': boolean; TRUE enables multiselect
25
   *   - 'multiselect': boolean; TRUE enables multiselect.
26 26
   */
27

  
27 28
  public function __construct($info, $params);
28 29

  
29 30
  /**
drupal7/sites/all/modules/media/includes/MediaBrowserUpload.inc
14 14
  /**
15 15
   * Implements MediaBrowserPluginInterface::access().
16 16
   */
17

  
17 18
  public function access($account = NULL) {
18 19
    return file_entity_access('create', NULL, $account);
19 20
  }
......
29 30

  
30 31
    return $build;
31 32
  }
33

  
32 34
}
drupal7/sites/all/modules/media/includes/media.browser.inc
117 117
      $settings['media']['browser'][$key] = $plugin_output[$key]['#settings'];
118 118
    }
119 119

  
120
    // If this is a "ajax" style tab, add the href, otherwise an id. jQuery UI
121
    // will use an href value to load content from that url
120
    // If this is a "ajax" style tab, add the href, otherwise an id. jQuery UI.
121
    // Will use an href value to load content from that url.
122 122
    $tabid = 'media-tab-' . check_plain($key);
123 123
    if (!empty($plugin_output[$key]['#callback'])) {
124 124
      $href = $plugin_output[$key]['#callback'];
......
131 131
      );
132 132
      // Create a div for each tab's content.
133 133
      $plugin_output[$key] += array(
134
        '#prefix' => '<div '. drupal_attributes($attributes) . ">\n",
134
        '#prefix' => '<div ' . drupal_attributes($attributes) . ">\n",
135 135
        '#suffix' => "</div>\n",
136 136
      );
137 137
    }
drupal7/sites/all/modules/media/includes/media.fields.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * Provide the media selector widget and media field formatters to the Fields
6
 * API.
5
 * Provide media selector widget and media field formatters to the fields API.
7 6
 */
8 7

  
9 8
/**
......
137 136
  elseif (module_exists('translation') && $element['#entity_type'] == 'node' && translation_supported_type($element['#entity']->type)) {
138 137
    $element['#media_parent_entity_form_langcode'] = $element['#entity']->language;
139 138
    $element['#media_parent_entity_source_langcode'] = $element['#entity']->language;
140
  } elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
139
  }
140
  elseif ($element['#entity_type'] == 'field_collection_item' && !empty($form['#entity']) && property_exists($form['#entity'], 'language')) {
141 141
    $element['#media_parent_entity_form_langcode'] = $form['#entity']->language;
142 142
  }
143
  else if ($element['#entity_type'] == 'paragraphs_item' && !empty($form['#entity'])) {
143
  elseif ($element['#entity_type'] == 'paragraphs_item' && !empty($form['#entity'])) {
144 144
    $host = $element['#entity']->hostEntity();
145 145
    if (isset($host->language)) {
146 146
      $element['#media_parent_entity_form_langcode'] = $host->language;
......
271 271
    );
272 272
  }
273 273

  
274
  // Add the alt field if enabled.
275
  if (!empty($instance['settings']['alt_field']) && $item['fid']) {
276
    $element['alt'] = array(
277
      '#title' => t('Alternate text'),
278
      '#type' => 'textfield',
279
      '#default_value' => isset($item['alt']) ? $item['alt'] : '',
280
      '#description' => t('This text will be used by screen readers, search engines, or when the image cannot be loaded.<br />
281
<em>(Notice: this field is not fetched on -all- formatters yet. For example: If the Rendered file formatter will be used, this field is not available at the moment.)</em>'),
282
      '#maxlength' => variable_get('image_alt_length', 80),
283
      '#weight' => 1,
284
    );
285
  }
286

  
287
  // Add the title field if enabled.
288
  if (!empty($instance['settings']['title_field']) && $item['fid']) {
289
    $element['title'] = array(
290
      '#type' => 'textfield',
291
      '#title' => t('Title'),
292
      '#default_value' => isset($item['title']) ? $item['title'] : '',
293
      '#description' => t('The title is used as a tool tip when the user hovers the mouse over the image.<br />
294
<em>(Notice: this field is not fetched on -all- formatters yet. For example: If the Rendered file formatter will be used, this field is not available at the moment.)</em>'),
295
      '#maxlength' => variable_get('image_title_length', 500),
296
      '#weight' => 2,
297
    );
298
  }
299

  
274 300
  // Adjust the Ajax settings so that on upload and remove of any individual
275 301
  // file, the entire group of file fields is updated together.
276 302
  if ($field['cardinality'] != 1) {
......
306 332
 * wrapper around the entire group so it can be replaced all at once.
307 333
 */
308 334
function media_field_widget_process_multiple($element, &$form_state, $form) {
309
    // In order to support multiple selection, we need to reconstruct the _POST
335
  // In order to support multiple selection, we need to reconstruct the _POST
310 336
  // data that is checked in media_attach_file(). We need to reconstruct the
311 337
  // field's _POST key name, for example: field_mediafield_und_0.
312 338
  $upload_name_prefix = implode('_', $element['#parents']) . '_';
......
314 340
  if (!empty($_POST['media'][$upload_name])) {
315 341
    $files = explode(',', $_POST['media'][$upload_name]);
316 342
    $count = count($files);
317
    // Supposing #file_upload_delta is always the last delta this will work
343
    // Supposing #file_upload_delta is always the last delta this will work.
318 344
    for ($i = 0; $i < $count; $i++) {
319 345
      // For each file selected, increment the field key to be processed.
320 346
      // field_mediafield_und_0 becomes field_mediafield_und_1, etc.
......
366 392
 *
367 393
 * This helper function is used by media_field_widget_process_multiple().
368 394
 *
369
 * @param $element
395
 * @param array $element
370 396
 *   The element being processed.
371 397
 *
372 398
 * @return
......
386 412
}
387 413

  
388 414
/**
389
 * Form submission handler for attach/remove button of media_field_widget_form().
415
 * Form submit handler for attach/remove button of media_field_widget_form().
390 416
 *
391 417
 * This runs in addition to and after media_field_widget_submit().
392 418
 *
......
434 460
/**
435 461
 * Returns HTML for an individual media widget.
436 462
 *
437
 * @param $variables
463
 * @param array $variables
438 464
 *   An associative array containing:
439 465
 *   - element: A render element representing the widget.
440 466
 *
......
467 493
/**
468 494
 * Returns HTML for a group of media widgets.
469 495
 *
470
 * @param $variables
496
 * @param array $variables
471 497
 *   An associative array containing:
472 498
 *   - element: A render element representing the widgets.
473 499
 *
......
561 587
    );
562 588
  }
563 589

  
564
  $table = array('header' => $headers, 'rows' => $rows, 'attributes' => array('id' => $table_id));
590
  $table = array(
591
    'header' => $headers,
592
    'rows' => $rows,
593
    'attributes' => array('id' => $table_id)
594
  );
565 595

  
566 596
  drupal_alter('media_widget_multiple', $table, $element);
567 597

  
......
623 653
 * Implements hook_field_formatter_settings_form().
624 654
 *
625 655
 * Legacy support for the "Large filetype icon" file field formatter.
656
 *
626 657
 * @see media_field_formatter_info()
627 658
 */
628 659
function media_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
......
645 676
 * Implements hook_field_formatter_settings_summary().
646 677
 *
647 678
 * Legacy support for the "Large filetype icon" file field formatter.
679
 *
648 680
 * @see media_field_formatter_info()
649 681
 */
650 682
function media_field_formatter_settings_summary($field, $instance, $view_mode) {
......
672 704
 * Implements hook_field_formatter_view().
673 705
 *
674 706
 * Legacy support for the "Large filetype icon" file field formatter.
707
 *
675 708
 * @see media_field_formatter_info()
676 709
 */
677 710
function media_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
drupal7/sites/all/modules/media/includes/media.theme.inc
2 2

  
3 3
/**
4 4
 * @file
5
 * Media Theming
5
 * Media Theming.
6 6
 *
7 7
 * Theming functions for the Media module.
8 8
 */
......
14 14
  $label = '';
15 15
  $element = $variables['element'];
16 16

  
17
 // Wrappers to go around the thumbnail.
17
  // Wrappers to go around the thumbnail.
18 18
  $attributes = array(
19 19
    'title' => $element['#name'],
20 20
    'class' => 'media-item',
drupal7/sites/all/modules/media/includes/media_views_plugin_display_media_browser.inc
1 1
<?php
2

  
2 3
/**
3 4
 * @file
4 5
 * Contains the media browser tab display plugin.
drupal7/sites/all/modules/media/includes/media_views_plugin_style_media_browser.inc
15 15
 */
16 16
class media_views_plugin_style_media_browser extends views_plugin_style_list {
17 17

  
18
  // Stores the files loaded with pre_render.
18
  /**
19
   * Stores the files loaded with pre_render.
20
   */
19 21
  public $files = array();
20 22

  
21 23
  /**
drupal7/sites/all/modules/media/media-views-view-media-browser.tpl.php
1 1
<?php
2

  
2 3
/**
3 4
 * @file media-views-view-media-browser.tpl.php
4 5
 * View template to display a grid of media previews in the media browser.
5
 *
6
 */
7

  
8
/**
6 9
 * @see views-view-list.tpl.php
7 10
 * @see template_preprocess_media_views_view_media_browser()
8 11
 * @ingroup views_templates
drupal7/sites/all/modules/media/media.info
24 24
; We have to add a fake version so Git checkouts do not fail Media dependencies
25 25
version = 7.x-2.x-dev
26 26

  
27
; Information added by Drupal.org packaging script on 2018-10-24
28
version = "7.x-2.21"
27
; Information added by Drupal.org packaging script on 2019-07-15
28
version = "7.x-2.23"
29 29
core = "7.x"
30 30
project = "media"
31
datestamp = "1540363086"
31
datestamp = "1563204686"
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{
drupal7/sites/all/modules/media/modules/media_bulk_upload/media_bulk_upload.info
15 15
files[] = includes/MediaBrowserBulkUpload.inc
16 16
files[] = tests/media_bulk_upload.test
17 17

  
18
; Information added by Drupal.org packaging script on 2018-10-24
19
version = "7.x-2.21"
18
; Information added by Drupal.org packaging script on 2019-07-15
19
version = "7.x-2.23"
20 20
core = "7.x"
21 21
project = "media"
22
datestamp = "1540363086"
22
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/media_internet/media_internet.info
12 12
files[] = includes/MediaInternetValidationException.inc
13 13
files[] = tests/media_internet.test
14 14

  
15
; Information added by Drupal.org packaging script on 2018-10-24
16
version = "7.x-2.21"
15
; Information added by Drupal.org packaging script on 2019-07-15
16
version = "7.x-2.23"
17 17
core = "7.x"
18 18
project = "media"
19
datestamp = "1540363086"
19
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/media_internet/tests/media_internet_test.info
7 7
files[] = includes/MediaInternetTestStreamWrapper.inc
8 8
files[] = includes/MediaInternetTestHandler.inc
9 9

  
10
; Information added by Drupal.org packaging script on 2018-10-24
11
version = "7.x-2.21"
10
; Information added by Drupal.org packaging script on 2019-07-15
11
version = "7.x-2.23"
12 12
core = "7.x"
13 13
project = "media"
14
datestamp = "1540363086"
14
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/media_migrate_file_types/includes/media_migrate_file_types.pages.inc
61 61
  foreach ($migratable_types as $machine_name) {
62 62
    $type = file_type_load($machine_name);
63 63
    if (!$type) {
64
      $type = new stdClass;
64
      $type = new stdClass();
65 65
      $type->label = $type->type = $machine_name;
66 66
    }
67 67
    $form['upgradable_types'][$machine_name] = array(
......
137 137
      // Old bundle might be deleted so let's fake some values.
138 138
      $bundle_old = file_type_load($type);
139 139
      if (empty($bundle_old)) {
140
        $bundle_old = new stdClass;
140
        $bundle_old = new stdClass();
141 141
        $bundle_old->type = $type;
142 142
        $bundle_old->mimetypes = array();
143 143
        $bundle_old->export_type = 2;
......
145 145

  
146 146
      // Migrate fields to new bundle.
147 147
      if ($_GET['migrate_fields']) {
148
        $old_fields = db_select('field_config_instance', 'fc')->fields('fc', array('field_name'))->condition('entity_type',  'file')->condition('bundle', $bundle_old->type)->execute()->fetchCol();
149
        $new_fields = db_select('field_config_instance', 'fc')->fields('fc', array('field_name'))->condition('entity_type',  'file')->condition('bundle', $bundle_new->type)->execute()->fetchCol();
148
        $old_fields = db_select('field_config_instance', 'fc')->fields('fc', array('field_name'))->condition('entity_type', 'file')->condition('bundle', $bundle_old->type)->execute()->fetchCol();
149
        $new_fields = db_select('field_config_instance', 'fc')->fields('fc', array('field_name'))->condition('entity_type', 'file')->condition('bundle', $bundle_new->type)->execute()->fetchCol();
150 150
        $fields_to_move = array_diff($old_fields, $new_fields);
151 151
        $fields_to_drop = array_diff($old_fields, $fields_to_move);
152 152

  
153 153
        if (!empty($fields_to_move)) {
154 154
          db_update('field_config_instance')
155 155
            ->fields(array('bundle' => $bundle_new->type))
156
            ->condition('entity_type',  'file')
156
            ->condition('entity_type', 'file')
157 157
            ->condition('bundle', $bundle_old->type)
158 158
            ->condition('field_name', $fields_to_move, 'IN')
159 159
            ->execute();
......
161 161

  
162 162
        if (!empty($fields_to_drop)) {
163 163
          db_delete('field_config_instance')
164
            ->condition('entity_type',  'file')
164
            ->condition('entity_type', 'file')
165 165
            ->condition('bundle', $bundle_old->type)
166 166
            ->condition('field_name', $fields_to_drop, 'IN')
167 167
            ->execute();
drupal7/sites/all/modules/media/modules/media_migrate_file_types/media_migrate_file_types.info
8 8

  
9 9
configure = admin/structure/file-types/upgrade
10 10

  
11
; Information added by Drupal.org packaging script on 2018-10-24
12
version = "7.x-2.21"
11
; Information added by Drupal.org packaging script on 2019-07-15
12
version = "7.x-2.23"
13 13
core = "7.x"
14 14
project = "media"
15
datestamp = "1540363086"
15
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/media_migrate_file_types/media_migrate_file_types.module
5 5
 * Primarily Drupal hooks.
6 6
 */
7 7

  
8
/*
9
 * Implements hook_system_info_alter()
8
/**
9
 * Implements hook_system_info_alter().
10 10
 */
11 11
function media_migrate_file_types_system_info_alter(&$info, $file, $type) {
12 12
  if ($type == 'module' && $file->name == 'media_migrate_file_types') {
......
52 52
}
53 53

  
54 54
/**
55
 * Checks if there are any files that belong to disabled or deleted file
56
 * types.
55
 * Checks if there are any files that belong to disabled or deleted file types.
57 56
 *
58 57
 * @return Array of file types (machine names) that are candidates for
59 58
 *   migration.
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.file_usage.inc
19 19
/**
20 20
 * Implements hook_field_attach_update().
21 21
 *
22
 * @see media_field_attach_insert().
22
 * @see media_field_attach_insert()
23 23
 */
24 24
function media_wysiwyg_entity_update($entity, $entity_type) {
25 25
  _media_wysiwyg_filter_add_file_usage_from_fields($entity_type, $entity);
......
41 41
  // id. This code may assume some things about entities that are only true for
42 42
  // node objects. This should be reviewed.
43 43
  // @TODO this conditional can probably be condensed
44
  if (empty($entity->revision) && empty($entity->old_vid) && empty($entity->is_new) && ! empty($entity->original)) {
44
  if (empty($entity->revision) && empty($entity->old_vid) && empty($entity->is_new) && !empty($entity->original)) {
45 45
    $old_files = media_wysiwyg_entity_field_count_files($entity_type, $entity->original);
46 46
    foreach ($old_files as $fid => $old_file_count) {
47 47
      // Were there more files on the node just prior to saving?
......
50 50
      }
51 51
      if ($old_file_count > $entity_files[$fid]) {
52 52
        $deprecate = $old_file_count - $entity_files[$fid];
53
        // Now deprecate this usage
53
        // Now deprecate this usage.
54 54
        $file = file_load($fid);
55 55
        if ($file) {
56 56
          file_usage_delete($file, 'media', $entity_type, $entity_id, $deprecate);
57 57
        }
58
        // Usage is deleted, nothing more to do with this file
58
        // Usage is deleted, nothing more to do with this file.
59 59
        unset($entity_files[$fid]);
60 60
      }
61
      // There are the same number of files, nothing to do
61
      // There are the same number of files, nothing to do.
62 62
      elseif ($entity_files[$fid] == $old_file_count) {
63 63
        unset($entity_files[$fid]);
64 64
      }
......
84 84
}
85 85

  
86 86
/**
87
 * Parse file references from an entity's text fields and return them as an array.
87
 * Parse file references from an entity's text fields and return as an array.
88 88
 */
89 89
function media_wysiwyg_filter_parse_from_fields($entity_type, $entity) {
90 90
  $file_references = array();
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.pages.inc
118 118
        '#type' => 'textfield',
119 119
        '#title' => t('Link Image'),
120 120
        '#description' => t('Enter a URL to turn the image into a link.'),
121
        '#maxlength' => 2048,
121 122
        '#default_value' => $external_url,
122 123
      );
123 124
    }
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.info
16 16

  
17 17
configure = admin/config/media/browser
18 18

  
19
; Information added by Drupal.org packaging script on 2018-10-24
20
version = "7.x-2.21"
19
; Information added by Drupal.org packaging script on 2019-07-15
20
version = "7.x-2.23"
21 21
core = "7.x"
22 22
project = "media"
23
datestamp = "1540363086"
23
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.module
113 113
    'field' => $field['#id'],
114 114
  );
115 115

  
116
  if (!isset($field['#value'])) {
116
  if (!isset($field['#value']) && $field['#value'] != '') {
117 117
    return $element;
118 118
  }
119 119

  
drupal7/sites/all/modules/media/modules/media_wysiwyg/media_wysiwyg.test
22 22
    parent::setUp($modules);
23 23
  }
24 24

  
25
  /**
26
    * Generates markup to be inserted for a file.
27
    *
28
    * This is a PHP version of InsertMedia.insert() from js/wysiwyg-media.js.
29
    *
30
    * @param int $fid
31
    *   Drupal file id
32
    * @param int $count
33
    *   Quantity of markup to insert
34
    * @param array $attributes
35
    *   Extra attributes to insert.
36
    * @param array $fields
37
    *   Extra field values to insert.
38
    *
39
    * @return string
40
    *   Filter markup.
41
    */
25
 /**
26
   * Generates markup to be inserted for a file.
27
   *
28
   * This is a PHP version of InsertMedia.insert() from js/wysiwyg-media.js.
29
   *
30
   * @param int $fid
31
   *   Drupal file id.
32
   * @param int $count
33
   *   Quantity of markup to insert.
34
   * @param array $attributes
35
   *   Extra attributes to insert.
36
   * @param array $fields
37
   *   Extra field values to insert.
38
   *
39
   * @return string
40
   *   Filter markup.
41
   */
42 42
  protected function generateJsonTokenMarkup($fid, $count = 1, array $attributes = array(), array $fields = array()) {
43 43
    $markup = '';
44 44
    // Merge default atttributes.
......
72 72
   *
73 73
   * @param int $fid
74 74
   *   Create the node with media markup in the body field
75
    * @param array $attributes
76
    *   Extra attributes to insert to the file.
77
    * @param array $fields
78
    *   Extra field values to insert.
75
   * @param array $attributes
76
   *   Extra attributes to insert to the file.
77
   * @param array $fields
78
   *   Extra field values to insert.
79 79
   *
80 80
   * @return int
81 81
   *   Returns the node id
82 82
   */
83 83
  protected function createNode($fid = FALSE, array $attributes = array(), array $fields = array()) {
84 84
    $markup = '';
85
    if (! empty($fid)) {
85
    if (!empty($fid)) {
86 86
      $markup = $this->generateJsonTokenMarkup($fid, 1, $attributes, $fields);
87 87
    }
88 88

  
......
112 112
    $web_user = $this->drupalCreateUser(array('access administration pages', 'administer file types', 'view files', 'use media wysiwyg'));
113 113
    $this->drupalLogin($web_user);
114 114
  }
115

  
115 116
}
116 117

  
117 118
/**
drupal7/sites/all/modules/media/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.info
3 3
package = Media
4 4
core = 7.x
5 5

  
6
; Information added by Drupal.org packaging script on 2018-10-24
7
version = "7.x-2.21"
6
; Information added by Drupal.org packaging script on 2019-07-15
7
version = "7.x-2.23"
8 8
core = "7.x"
9 9
project = "media"
10
datestamp = "1540363086"
10
datestamp = "1563204686"
drupal7/sites/all/modules/media/modules/mediafield/mediafield.info
4 4
core = 7.x
5 5
dependencies[] = media
6 6

  
7
; Information added by Drupal.org packaging script on 2018-10-24
8
version = "7.x-2.21"
7
; Information added by Drupal.org packaging script on 2019-07-15
8
version = "7.x-2.23"
9 9
core = "7.x"
10 10
project = "media"
11
datestamp = "1540363086"
11
datestamp = "1563204686"
drupal7/sites/all/modules/media/tests/media_module_test.info
6 6

  
7 7
files[] = includes/MediaModuleTest.inc
8 8

  
9
; Information added by Drupal.org packaging script on 2018-10-24
10
version = "7.x-2.21"
9
; Information added by Drupal.org packaging script on 2019-07-15
10
version = "7.x-2.23"
11 11
core = "7.x"
12 12
project = "media"
13
datestamp = "1540363086"
13
datestamp = "1563204686"
drupal7/sites/all/modules/media_ckeditor/js/plugins/media/plugin.js
20 20
    hidpi: true,
21 21
    onLoad: function() {
22 22
      // Check if this instance has widget support.
23
      mediaPluginDefinition.hasWidgetSupport = typeof(CKEDITOR.plugins.registered.widget) != 'undefined';
23
      // mediaPluginDefinition.hasWidgetSupport = typeof(CKEDITOR.plugins.registered.widget) != 'undefined';
24 24
      // Add dependency to widget plugin if possible.
25
      if (parseFloat(CKEDITOR.version) >= 4.3 && mediaPluginDefinition.hasWidgetSupport) {
25
      if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4.3') >= 0 && mediaPluginDefinition.hasWidgetSupport) {
26 26
        mediaPluginDefinition.requires.push('widget');
27 27
      }
28 28
    },
......
90 90
        editor.addMenuGroup('mediaGroup');
91 91
        editor.addMenuItem('mediaConfigureItem', {
92 92
          label: Drupal.settings.media_ckeditor.labels['settings'],
93
          icon: this.path + 'images/icon.gif',
93
          icon: this.path + 'icons/media.png',
94 94
          command: 'mediaConfigure',
95 95
          group: 'mediaGroup'
96 96
        });
......
110 110
        command: 'media'
111 111
      });
112 112

  
113
      var ckeditorversion = parseFloat(CKEDITOR.version);
114

  
115 113
      // Because the media comment wrapper don't work well for CKEditor we
116 114
      // replace them by using a custom mediawrapper element.
117 115
      // Instead having
......
123 121
      CKEDITOR.dtd.$blockLimit['mediawrapper'] = 1;
124 122
      CKEDITOR.dtd.$inline['mediawrapper'] = 1;
125 123
      CKEDITOR.dtd.$nonEditable['mediawrapper'] = 1;
126
      if (ckeditorversion >= 4.1) {
124
      if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4.1') >= 0) {
127 125
        // Register allowed tag for advanced filtering.
128 126
        editor.filter.allow( 'mediawrapper[!data]', 'mediawrapper', true);
129 127
        // Don't remove the data-file_info attribute added by media!
......
205 203
          }
206 204
        });
207 205
      }
208
      else if (ckeditorversion >= 4) {
206
      else if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4') >= 0) {
209 207
        // CKEditor >=4.0
210 208
        editor.on('setData', function( event ) {
211 209
          event.data.dataValue = prepareDataForWysiwygMode(event.data.dataValue);
......
254 252
                  // While v3 plays nice with setting start and end to avoid
255 253
                  // editing within the media wrapper element, v4 ignores that.
256 254
                  // Thus we try to move the cursor further away.
257
                  if (parseInt(CKEDITOR.version) > 3) {
255
                  if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '3') > 0) {
258 256
                    range.setStart(commonAncestor.getPrevious());
259 257
                    range.setEnd(commonAncestor.getPrevious());
260 258
                  }
......
266 264
                  // While v3 plays nice with setting start and end to avoid
267 265
                  // editing within the media wrapper element, v4 ignores that.
268 266
                  // Thus we try to move the cursor further away.
269
                  if (parseInt(CKEDITOR.version) > 3) {
267
                  if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '3') > 0) {
270 268
                    range.setStart(commonAncestor.getNext(), 1);
271 269
                    range.setEnd(commonAncestor.getNext(), 1);
272 270
                  }
drupal7/sites/all/modules/media_ckeditor/media_ckeditor.info
15 15
test_dependencies[] = views
16 16
test_dependencies[] = ctools
17 17

  
18
; Information added by Drupal.org packaging script on 2018-10-25
19
version = "7.x-2.9"
18
; Information added by Drupal.org packaging script on 2019-07-11
19
version = "7.x-2.10"
20 20
core = "7.x"
21 21
project = "media_ckeditor"
22
datestamp = "1540501984"
22
datestamp = "1562859187"
drupal7/sites/all/modules/media_ckeditor/tests/media_ckeditor_test.info
4 4
core = 7.x
5 5
hidden = FALSE
6 6

  
7
; Information added by Drupal.org packaging script on 2018-10-25
8
version = "7.x-2.9"
7
; Information added by Drupal.org packaging script on 2019-07-11
8
version = "7.x-2.10"
9 9
core = "7.x"
10 10
project = "media_ckeditor"
11
datestamp = "1540501984"
11
datestamp = "1562859187"

Formats disponibles : Unified diff