Projet

Général

Profil

Révision d808fa20

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/feeds_tamper/feeds_tamper.inc
166 166
    }
167 167
    // Filter disabled and only pull plugins that actually have a corresponding
168 168
    // source since we don't delete them with a mapping.
169
    if (($disabled || empty($i->disabled)) && in_array($i->source, $sources) && function_exists($plugins[$i->plugin_id]['callback'])) {
169
    if (($disabled || empty($i->disabled)) && in_array($i->source, $sources) && isset($plugins[$i->plugin_id]) && function_exists($plugins[$i->plugin_id]['callback'])) {
170 170
      $instances[$i->source][] = $i;
171 171
    }
172 172
  }
......
318 318
function feeds_tamper_form_feeds_ui_mapping_form_alter(array &$form, array &$form_state) {
319 319
  $form['#submit'][] = 'feeds_tamper_form_feeds_ui_mapping_form_submit';
320 320

  
321
  // Don't alter the form for parsers that use manual input.
322
  if ($form['source']['#type'] == 'textfield') {
323
    return;
324
  }
321
  // Don't alter the sources on the form for parsers that use manual input.
322
  $manual_source_input = ($form['source']['#type'] == 'textfield');
323

  
325 324
  $max_source = 0;
326 325
  $max_target = 0;
327 326
  foreach ($form['#mappings'] as $mapping) {
328
    if (strpos($mapping['source'], 'Blank source ') === 0) {
327
    if (!$manual_source_input && strpos($mapping['source'], 'Blank source ') === 0) {
329 328
      list(, , $source_value) = explode(' ', $mapping['source']);
330 329
      if ($source_value > $max_source) {
331 330
        $max_source = $source_value;
......
338 337
      }
339 338
    }
340 339
  }
341
  if ($max_source) {
342
    unset($form['source']['#options']['Blank source 1']);
343
    $form['source']['#options']['Blank source ' . ++$max_source] = 'Blank source';
344
  }
345
  else {
346
    $form['source']['#options']['Blank source 1'] = 'Blank source';
340

  
341
  if (!$manual_source_input) {
342
    if ($max_source) {
343
      unset($form['source']['#options']['Blank source 1']);
344
      $form['source']['#options']['Blank source ' . ++$max_source] = 'Blank source';
345

  
346
      // Declare extra mapping sources.
347
      for ($i = 2; $i <= $max_source; $i++) {
348
        $form['#feeds_sources']['Blank source ' . $i] = $form['#feeds_sources']['Blank source 1'];
349
      }
350
    }
351
    else {
352
      $form['source']['#options']['Blank source 1'] = 'Blank source';
353
    }
347 354
  }
355

  
348 356
  if ($max_target) {
349 357
    unset($form['target']['#options']['Temporary target 1']);
350 358
    $form['target']['#options']['Temporary target ' . ++$max_target] = 'Temporary target';
359

  
360
    // Declare extra mapping targets.
361
    for ($i = 2; $i <= $max_target; $i++) {
362
      $form['#feeds_targets']['Temporary target ' . $i] = $form['#feeds_targets']['Temporary target 1'];
363
    }
351 364
  }
352 365
  else {
353 366
    $form['target']['#options']['Temporary target 1'] = 'Temporary target';
drupal7/sites/all/modules/feeds_tamper/feeds_tamper.info
5 5
files[] = tests/feeds_tamper.test
6 6
files[] = tests/feeds_tamper_plugins.test
7 7
files[] = tests/feeds_tamper_efq_finder.test
8
files[] = tests/temporary_target.test
8 9
core = 7.x
9 10

  
10
; Information added by Drupal.org packaging script on 2015-06-03
11
version = "7.x-1.1"
11
; Information added by Drupal.org packaging script on 2017-12-10
12
version = "7.x-1.2"
12 13
core = "7.x"
13 14
project = "feeds_tamper"
14
datestamp = "1433291282"
15
datestamp = "1512894788"
15 16

  
drupal7/sites/all/modules/feeds_tamper/feeds_tamper_ui/feeds_tamper_ui.info
6 6
files[] = tests/feeds_tamper_ui.test
7 7
core = 7.x
8 8

  
9
; Information added by Drupal.org packaging script on 2015-06-03
10
version = "7.x-1.1"
9
; Information added by Drupal.org packaging script on 2017-12-10
10
version = "7.x-1.2"
11 11
core = "7.x"
12 12
project = "feeds_tamper"
13
datestamp = "1433291282"
13
datestamp = "1512894788"
14 14

  
drupal7/sites/all/modules/feeds_tamper/feeds_tamper_ui/feeds_tamper_ui.module
50 50

  
51 51
  $items['admin/structure/feeds/%feeds_importer/tamper/%feeds_tamper_plugin_instance/edit'] = array(
52 52
    'title callback' => 'feeds_tamper_ui_edit_title',
53
    'title arguments' => array(5),
53 54
    'page arguments' => array('feeds_tamper_ui_edit_plugin_form', 5),
54 55
    'access arguments' => array(NULL, 5),
55 56
  ) + $defaults;
56 57

  
57 58
  $items['admin/structure/feeds/%feeds_importer/tamper/%feeds_tamper_plugin_instance/delete'] = array(
58 59
    'title callback' => 'feeds_tamper_ui_delete_title',
60
    'title arguments' => array(5),
59 61
    'page arguments' => array('feeds_tamper_ui_delete_form', 5),
60 62
    'access arguments' => array(NULL, 5),
61 63
  ) + $defaults;
drupal7/sites/all/modules/feeds_tamper/plugins/default_value.inc
33 33
  return $form;
34 34
}
35 35

  
36
function feeds_tamper_default_value_callback($source, $item_key, $element_key, &$field, $settings, $source) {
36
function feeds_tamper_default_value_callback($result, $item_key, $element_key, &$field, $settings, $source) {
37 37
  // Setting a default value.
38 38
  if (!empty($settings['only_if_empty']) && !$field) {
39 39
    $field = $settings['default_value'];
drupal7/sites/all/modules/feeds_tamper/plugins/encode.inc
1
<?php
2

  
3
/**
4
 * @file
5
 * Encode and Decode a text with a set of defined functions.
6
 */
7

  
8
$plugin = array(
9
  'form' => 'feeds_tamper_encode_form',
10
  'callback' => 'feeds_tamper_encode_callback',
11
  'name' => 'Encode/Decode Plugin',
12
  'multi' => 'direct',
13
  'category' => 'Text',
14
);
15

  
16
/**
17
 * Form callback for the 'encode' plugin.
18
 */
19
function feeds_tamper_encode_form($importer, $element_key, $settings) {
20
  $form = array();
21

  
22
  $form['help']['#value'] = t('Encode (or Decode) the field contents.');
23

  
24
  $form['mode'] = array(
25
    '#title' => t('Serialization mode:'),
26
    '#description' => t('Serialization/Encoding mode'),
27
    '#type' => 'radios',
28
    '#options' => array(
29
      'serialize' => t('PHP Serialize'),
30
      'unserialize' => t('PHP Unserialize'),
31
      'json_encode' => t('Json Encode'),
32
      'json_decode' => t('Json Decode'),
33
      'base64_encode' => t('Base64 Encode'),
34
      'base64_decode' => t('Base64 Decode'),
35
    ),
36
    '#default_value' => isset($settings['mode']) ? $settings['mode'] : 'serialize',
37
  );
38

  
39
  return $form;
40
}
41

  
42
/**
43
 * Callback for the 'encode' plugin.
44
 */
45
function feeds_tamper_encode_callback($source, $item_key, $element_key, &$field, array $settings) {
46
  if (empty($settings['mode'])) {
47
    $settings['mode'] = 'serialize';
48
  }
49

  
50
  $function = $settings['mode'];
51

  
52
  if (function_exists($function)) {
53
    $field = call_user_func($function, $field);
54
  }
55
}
drupal7/sites/all/modules/feeds_tamper/plugins/sprintf.inc
18 18
  $form['format'] = array(
19 19
    '#type' => 'textfield',
20 20
    '#title' => t('Format'),
21
    '#default_value' => '%s',
21
    '#default_value' => isset($settings['format']) ? $settings['format'] : '%s',
22 22
    '#size' => 60,
23 23
    '#maxlength' => 128,
24 24
    '#required' => FALSE,
drupal7/sites/all/modules/feeds_tamper/tests/feeds_tamper.test
123 123

  
124 124
  protected function assertHashedDevseedFeedContent() {
125 125
    $this->drupalGet('node');
126
    $this->asserttext('7e6719e920a73954fe94c931b2715efe');
127
    $this->asserttext('8ea53182dfa501e4aa997a6030931125');
128
    $this->asserttext('ad560610949586a1d477585ce48777e8');
129
    $this->asserttext('e84c1cf48e264224d7a6e20d6def66de');
130
    $this->asserttext('14aa7188d867973831e4232f67c070c3');
131
    $this->asserttext('bb5a525f6e89da7ecbafa09a10b01529');
132
    $this->asserttext('50c2feb66fbd6144334a14684b3cf547');
133
    $this->asserttext('072f06df55a62bd694c4544d2397bf82');
134
    $this->asserttext('b02c3e6bdcfdaac72b17a14f4f0eae27');
135
    $this->asserttext('a628fc19e8fcb2b9c987412a7fcd995c');
126
    $this->asserttext('b802e0e74831d506bcafd3e0d8339c0c');
127
    $this->asserttext('40dd7b1ae61ad8b1fb55d662b8ca77c4');
128
    $this->asserttext('40bcfee6c3ddb980236f2f1f2a519fb3');
129
    $this->asserttext('5e0c93b1474072e82f4c53db02fc2c7f');
130
    $this->asserttext('8611ee43370358cb8a12a9e87894cdca');
131
    $this->asserttext('69691b749f4f8a512c9d4a74e50d2e0b');
132
    $this->asserttext('520cd4cd49ae68c99cf5ed82d1dd6e02');
133
    $this->asserttext('429b46ca20f2c36739ca4ec88459f826');
134
    $this->asserttext('a6b22dae5037ba2d1d57d648fc220f04');
135
    $this->asserttext('643f31f2955072c52390fd5828b2745a');
136 136
  }
137 137

  
138 138
}
drupal7/sites/all/modules/feeds_tamper/tests/feeds_tamper_plugins.test
1165 1165
  }
1166 1166

  
1167 1167
}
1168

  
1169
/**
1170
 * Tests for the Tamper plugin 'encode'.
1171
 */
1172
class FeedsTamperEncodeDecodeTestCase extends FeedsTamperUnitTestCase {
1173

  
1174
  /**
1175
   * The ID of the plugin to be tested.
1176
   *
1177
   * @var string
1178
   */
1179
  protected $plugin_id = 'encode';
1180

  
1181
  /**
1182
   * {@inheritdoc}
1183
   */
1184
  public static function getInfo() {
1185
    return array(
1186
      'name' => 'Plugins: Encode',
1187
      'description' => 'Unit tests for "Encode/Decode" plugin.',
1188
      'group' => 'Feeds Tamper',
1189
    );
1190
  }
1191

  
1192
  /**
1193
   * {@inheritdoc}
1194
   */
1195
  public function test() {
1196
    $this->execute(array(), 'a:0:{}', array('mode' => 'serialize'));
1197
    $this->execute('a:0:{}', array(), array('mode' => 'unserialize'));
1198

  
1199
    $this->execute('abcdef 123 @#`|\\"$%&/()=?\'^*', 's:28:"abcdef 123 @#`|\"$%&/()=?\'^*";', array('mode' => 'serialize'));
1200
    $this->execute('s:28:"abcdef 123 @#`|\"$%&/()=?\'^*";', 'abcdef 123 @#`|\"$%&/()=?\'^*', array('mode' => 'unserialize'));
1201

  
1202
    $this->execute('abcdef 123 @#`|\\"$%&/()=?\'^*', 'YWJjZGVmIDEyMyBAI2B8XCIkJSYvKCk9PydeKg==', array('mode' => 'base64_encode'));
1203
    $this->execute('YWJjZGVmIDEyMyBAI2B8XCIkJSYvKCk9PydeKg==', 'abcdef 123 @#`|\\"$%&/()=?\'^*', array('mode' => 'base64_decode'));
1204
  }
1205

  
1206
}
drupal7/sites/all/modules/feeds_tamper/tests/temporary_target.test
1
<?php
2

  
3
/**
4
 * Tests blank sources and temporary targets.
5
 */
6
class FeedsTamperTemporaryTargetTestCase extends FeedsTamperWebTestHelper {
7

  
8
  public static function getInfo() {
9
    return array(
10
      'name' => 'Temporary targets and blank sources',
11
      'description' => 'Tests for adding temporary targets and blank sources.',
12
      'group' => 'Feeds Tamper',
13
    );
14
  }
15

  
16
  /**
17
   * Tests adding temporary targets.
18
   */
19
  public function testAddTemporaryTargets() {
20
    $importer_name = $this->randomName();
21
    $importer_id = drupal_strtolower($importer_name);
22
    // Set up an importer.
23
    $this->createImporterConfiguration($importer_name, $importer_id);
24

  
25
    // Add three temporary targets.
26
    $this->addMappings($importer_id, array(
27
      0 => array(
28
        'source' => 'title',
29
        'target' => 'Temporary target 1',
30
      ),
31
      1 => array(
32
        'source' => 'guid',
33
        'target' => 'Temporary target 2',
34
      ),
35
      2 => array(
36
        'source' => 'description',
37
        'target' => 'Temporary target 3',
38
      ),
39
    ));
40

  
41
    // Assert that all targets are displayed in the UI.
42
    $this->assertText('Temporary target 1');
43
    $this->assertText('Temporary target 2');
44
    $this->assertText('Temporary target 3');
45
  }
46

  
47
  /**
48
   * Tests adding blank sources.
49
   */
50
  public function testAddBlankSources() {
51
    $importer_name = $this->randomName();
52
    $importer_id = drupal_strtolower($importer_name);
53
    // Set up an importer.
54
    $this->createImporterConfiguration($importer_name, $importer_id);
55

  
56
    // Add three blank sources.
57
    $this->addMappings($importer_id, array(
58
      0 => array(
59
        'source' => 'Blank source 1',
60
        'target' => 'title',
61
      ),
62
      1 => array(
63
        'source' => 'Blank source 2',
64
        'target' => 'guid',
65
      ),
66
      2 => array(
67
        'source' => 'Blank source 3',
68
        'target' => 'body',
69
      ),
70
    ));
71

  
72
    // Assert that all sources are displayed in the UI.
73
    $this->assertText('Blank source 1');
74
    $this->assertText('Blank source 2');
75
    $this->assertText('Blank source 3');
76
  }
77

  
78
}
drupal7/sites/all/modules/media/includes/media.fields.inc
168 168
    foreach ($items as $item) {
169 169
      $elements[$delta] = $element;
170 170
      $elements[$delta]['#default_value'] = $item;
171
      $elements[$delta]['#weight'] = $delta;
171
      $elements[$delta]['#weight'] = isset($item['_weight']) ? $item['_weight'] : $delta;
172 172
      $delta++;
173 173
    }
174 174
    // And then add one more empty row for new uploads except when this is a
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 2017-10-19
28
version = "7.x-2.13"
27
; Information added by Drupal.org packaging script on 2017-12-12
28
version = "7.x-2.14"
29 29
core = "7.x"
30 30
project = "media"
31
datestamp = "1508430548"
31
datestamp = "1513081090"
32 32

  
drupal7/sites/all/modules/media/media.module
168 168
function media_admin_paths() {
169 169
  $paths['media/*/edit/*'] = TRUE;
170 170
  $paths['media/*/format-form'] = TRUE;
171
  if (module_exists('admin_language')) {
172
    $paths['media/ajax/*'] = TRUE; // For admin_language module compatibility.
173
  }
171 174

  
172 175
  // If the media browser theme is set to the admin theme, ensure it gets set
173 176
  // as an admin path as well.
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 2017-10-19
19
version = "7.x-2.13"
18
; Information added by Drupal.org packaging script on 2017-12-12
19
version = "7.x-2.14"
20 20
core = "7.x"
21 21
project = "media"
22
datestamp = "1508430548"
22
datestamp = "1513081090"
23 23

  
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 2017-10-19
16
version = "7.x-2.13"
15
; Information added by Drupal.org packaging script on 2017-12-12
16
version = "7.x-2.14"
17 17
core = "7.x"
18 18
project = "media"
19
datestamp = "1508430548"
19
datestamp = "1513081090"
20 20

  
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 2017-10-19
11
version = "7.x-2.13"
10
; Information added by Drupal.org packaging script on 2017-12-12
11
version = "7.x-2.14"
12 12
core = "7.x"
13 13
project = "media"
14
datestamp = "1508430548"
14
datestamp = "1513081090"
15 15

  
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 2017-10-19
12
version = "7.x-2.13"
11
; Information added by Drupal.org packaging script on 2017-12-12
12
version = "7.x-2.14"
13 13
core = "7.x"
14 14
project = "media"
15
datestamp = "1508430548"
15
datestamp = "1513081090"
16 16

  
drupal7/sites/all/modules/media/modules/media_wysiwyg/includes/media_wysiwyg.filter.inc
311 311
    drupal_add_js(array('mediaDataMap' => array($file->fid => $data)), 'setting');
312 312
    $element['#attributes']['data-fid'] = $file->fid;
313 313
    $element['#attributes']['data-media-element'] = '1';
314
    $element['#attributes']['class'][] = 'media-element';
314
    if (is_array($element['#attributes']['class'])) {
315
      $element['#attributes']['class'][] = 'media-element';
316
    }
317
    else {
318
      $element['#attributes']['class'] .= 'media-element';
319
    }
315 320
  }
316 321
  else {
317 322
    // Display the field elements.
drupal7/sites/all/modules/media/modules/media_wysiwyg/js/media_wysiwyg.format_form.js
25 25
    // Adding the buttons should only be done once in order to prevent multiple
26 26
    // buttons from being added if part of the form is updated via AJAX
27 27
    $('#media-wysiwyg-format-form').once('format', function() {
28
      $('<a class="button fake-ok">' + Drupal.t('Submit') + '</a>').appendTo($('#media-wysiwyg-format-form')).bind('click', Drupal.media.formatForm.submit);
28
      $('<a class="button fake-ok" href="javascript:void(0)">' + Drupal.t('Submit') + '</a>').appendTo($('#media-wysiwyg-format-form')).bind('click', Drupal.media.formatForm.submit);
29 29
    });
30 30
  }
31 31
};
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 2017-10-19
20
version = "7.x-2.13"
19
; Information added by Drupal.org packaging script on 2017-12-12
20
version = "7.x-2.14"
21 21
core = "7.x"
22 22
project = "media"
23
datestamp = "1508430548"
23
datestamp = "1513081090"
24 24

  
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 2017-10-19
7
version = "7.x-2.13"
6
; Information added by Drupal.org packaging script on 2017-12-12
7
version = "7.x-2.14"
8 8
core = "7.x"
9 9
project = "media"
10
datestamp = "1508430548"
10
datestamp = "1513081090"
11 11

  
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 2017-10-19
8
version = "7.x-2.13"
7
; Information added by Drupal.org packaging script on 2017-12-12
8
version = "7.x-2.14"
9 9
core = "7.x"
10 10
project = "media"
11
datestamp = "1508430548"
11
datestamp = "1513081090"
12 12

  
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 2017-10-19
10
version = "7.x-2.13"
9
; Information added by Drupal.org packaging script on 2017-12-12
10
version = "7.x-2.14"
11 11
core = "7.x"
12 12
project = "media"
13
datestamp = "1508430548"
13
datestamp = "1513081090"
14 14

  

Formats disponibles : Unified diff