Projet

Général

Profil

Révision 9df8b457

Ajouté par Assos Assos il y a presque 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/views_bulk_operations/actions/archive.action.inc
18 18
      // "Create an advanced action" dropdown on admin/config/system/actions.
19 19
      'configurable' => FALSE,
20 20
      'vbo_configurable' => TRUE,
21
      'behavior' => array('views_property'),
21 22
      'triggers' => array('any'),
22 23
    );
23 24
  }
drupal7/sites/all/modules/views_bulk_operations/actions/book.action.inc
13 13
      'label' => t('Move to book'),
14 14
      'configurable' => TRUE,
15 15
      'behavior' => array('changes_property'),
16
      'triggers' => array('any'),
16 17
    );
17 18
    $actions['views_bulk_operations_remove_from_book_action'] = array(
18 19
      'type' => 'node',
19 20
      'label' => t('Remove from book'),
20 21
      'configurable' => FALSE,
22
      'triggers' => array('any'),
21 23
    );
22 24
  }
23 25

  
drupal7/sites/all/modules/views_bulk_operations/actions/delete.action.inc
19 19
      'label' => t('Delete revision'),
20 20
      'configurable' => FALSE,
21 21
      'behavior' => array('deletes_property'),
22
      'triggers' => array('any'),
22 23
    ),
23 24
  );
24 25
}
drupal7/sites/all/modules/views_bulk_operations/actions/modify.action.inc
82 82
    // The wrapper will automatically modify $entity itself.
83 83
    $wrapper = entity_metadata_wrapper($context['entity_type'], $entity);
84 84
    foreach ($context['selected']['properties'] as $key) {
85
      if (!$wrapper->$key->access('update')) {
86
        // No access.
87
        continue;
88
      }
89

  
85 90
      if (in_array($key, $context['append']['properties'])) {
86 91
        $old_values = $wrapper->$key->value();
87 92
        $wrapper->$key->set($context['properties'][$key]);
......
134 139
  if (!empty($properties)) {
135 140
    $form['properties'] = array(
136 141
      '#type' => 'fieldset',
137
      '#title' => 'Properties',
142
      '#title' => t('Properties'),
138 143
    );
139 144
    $form['properties']['show_value'] = array(
140 145
      '#suffix' => '<div class="clearfix"></div>',
......
298 303
    $token_type = str_replace('_', '-', $entity_type);
299 304
    $form['tokens'] = array(
300 305
      '#type' => 'fieldset',
301
      '#title' => 'Available tokens',
306
      '#title' => t('Available tokens'),
302 307
      '#collapsible' => TRUE,
303 308
      '#collapsed' => TRUE,
304 309
      '#weight' => 998,
drupal7/sites/all/modules/views_bulk_operations/actions/user_cancel.action.inc
10 10
    'label' => t('Cancel user account'),
11 11
    'configurable' => TRUE,
12 12
    'behavior' => array('deletes_property'),
13
    'triggers' => array('any'),
13 14
  ));
14 15
}
15 16

  
drupal7/sites/all/modules/views_bulk_operations/actions/user_roles.action.inc
45 45
  );
46 46
}
47 47

  
48
function views_bulk_operations_user_roles_action(&$user, $context) {
49
  $roles = $user->roles;
50
  $selected = (is_array($context['add_roles']) ? $context['add_roles'] : array()) +
51
              (is_array($context['remove_roles']) ? $context['remove_roles'] : array());
52
  $result = db_query("SELECT rid, name FROM {role} WHERE rid IN (:selected)", array(':selected' => array_keys($selected)));
53
  foreach ($result as $role) {
54
    if (isset($context['add_roles'][$role->rid])) {
55
      $add_roles[$role->rid] = $role->name;
56
    }
57
    if (isset($context['remove_roles'][$role->rid])) {
58
      $remove_roles[$role->rid] = $role->name;
59
    }
48
function views_bulk_operations_user_roles_action($user, $context) {
49
  $wrapper = entity_metadata_wrapper('user', $user);
50
  if (!$wrapper->roles->access("update")) {
51
    // No access.
52
    return;
60 53
  }
61
  if (!empty($add_roles)) {
62
    $roles += $add_roles;
54
  $roles = $wrapper->roles->value();
55
  if (is_array($context['add_roles'])) {
56
    $roles = array_merge($roles, $context['add_roles']);
63 57
  }
64
  if (!empty($remove_roles)) {
65
    $roles = array_diff($roles, $remove_roles);
58
  if (is_array($context['remove_roles'])) {
59
    $roles = array_diff($roles, $context['remove_roles']);
66 60
  }
67
  user_save($user, array('roles' => $roles));
61
  $wrapper->roles->set($roles);
62
  $wrapper->save();
68 63
}
drupal7/sites/all/modules/views_bulk_operations/actions_permissions.info
3 3
package = Administration
4 4
core = 7.x
5 5

  
6
; Information added by Drupal.org packaging script on 2013-12-23
7
version = "7.x-3.2"
6
; Information added by Drupal.org packaging script on 2015-07-01
7
version = "7.x-3.3"
8 8
core = "7.x"
9 9
project = "views_bulk_operations"
10
datestamp = "1387798183"
10
datestamp = "1435764542"
11 11

  
drupal7/sites/all/modules/views_bulk_operations/js/views_bulk_operations.js
46 46
    });
47 47

  
48 48
    // Set up the ability to click anywhere on the row to select it.
49
    $('.views-table tbody tr', form).click(function(event) {
50
      if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') {
51
        $('input[id^="edit-views-bulk-operations"]:not(:disabled)', this).each(function() {
52
          var checked = this.checked;
53
          // trigger() toggles the checkmark *after* the event is set,
54
          // whereas manually clicking the checkbox toggles it *beforehand*.
55
          // that's why we manually set the checkmark first, then trigger the
56
          // event (so that listeners get notified), then re-set the checkmark
57
          // which the trigger will have toggled. yuck!
58
          this.checked = !checked;
59
          $(this).trigger('click');
60
          this.checked = !checked;
61
        });
62
      }
63
    });
49
    if (Drupal.settings.vbo.row_clickable) {
50
      $('.views-table tbody tr', form).click(function(event) {
51
        if (event.target.tagName.toLowerCase() != 'input' && event.target.tagName.toLowerCase() != 'a') {
52
          $('input[id^="edit-views-bulk-operations"]:not(:disabled)', this).each(function() {
53
            var checked = this.checked;
54
            // trigger() toggles the checkmark *after* the event is set,
55
            // whereas manually clicking the checkbox toggles it *beforehand*.
56
            // that's why we manually set the checkmark first, then trigger the
57
            // event (so that listeners get notified), then re-set the checkmark
58
            // which the trigger will have toggled. yuck!
59
            this.checked = !checked;
60
            $(this).trigger('click');
61
            this.checked = !checked;
62
          });
63
        }
64
      });
65
    }
64 66
  }
65 67

  
66 68
  Drupal.vbo.tableSelectAllPages = function(form) {
drupal7/sites/all/modules/views_bulk_operations/plugins/operation_types/action.class.php
20 20
   */
21 21
  public function getAccessMask() {
22 22
    // Assume edit by default.
23
    if (!isset($this->operationInfo['behavior'])) {
23
    if (empty($this->operationInfo['behavior'])) {
24 24
      $this->operationInfo['behavior'] = array('changes_property');
25 25
    }
26 26

  
drupal7/sites/all/modules/views_bulk_operations/plugins/operation_types/rules_component.class.php
124 124
    else {
125 125
     $element = rules_action('component_' . $this->operationInfo['parameters']['component_key']);
126 126
    }
127
    $element->execute($data);
127
    $wrapper_type = is_array($data) ? "list<{$this->entityType}>" : $this->entityType;
128
    $wrapper = entity_metadata_wrapper($wrapper_type, $data);
129
    $element->execute($wrapper);
128 130
  }
129 131
}
drupal7/sites/all/modules/views_bulk_operations/views/views_bulk_operations_handler_field_operations.inc
55 55
      'contains' => array(
56 56
        'display_type' => array('default' => 0),
57 57
        'enable_select_all_pages' => array('default' => TRUE),
58
        'row_clickable' => array('default' => TRUE),
58 59
        'force_single' => array('default' => FALSE),
59 60
        'entity_load_capacity' => array('default' => 10),
60 61
        'skip_batching' => array('default' => 0),
......
63 64
    $options['vbo_operations'] = array(
64 65
      'default' => array(),
65 66
      'unpack_translatable' => 'unpack_operations',
67
      'export' => 'export_vbo_operations',
66 68
    );
67 69

  
68 70
    return $options;
69 71
  }
70 72

  
73
  function export_vbo_operations($indent, $prefix, $storage, $option, $definition, $parents) {
74
    // Anti-recursion, since we use the parent export helper.
75
    unset($definition['export']);
76

  
77
    // Find and remove all unselected/disabled operations.
78
    foreach ($storage['vbo_operations'] as $operation_id => $operation) {
79
      if (empty($operation['selected'])) {
80
        unset($storage['vbo_operations'][$operation_id]);
81
      }
82
    }
83

  
84
    return parent::export_option($indent, $prefix, $storage, $option, $definition, $parents);
85
  }
86

  
71 87
  function unpack_operations(&$translatable, $storage, $option, $definition, $parents, $keys) {
72 88
    $translatable[] = array(
73 89
      'value' => t('- Choose an operation -'),
......
107 123
      '#default_value' => $this->options['vbo_settings']['enable_select_all_pages'],
108 124
      '#description' => t('Check this box to enable the ability to select all items on all pages.'),
109 125
    );
126
    $form['vbo_settings']['row_clickable'] = array(
127
      '#type' => 'checkbox',
128
      '#title' => t('Make the whole row clickable'),
129
      '#default_value' => $this->options['vbo_settings']['row_clickable'],
130
      '#description' => t('Check this box to select an item when its row has been clicked. Requires JavaScript.'),
131
    );
110 132
    $form['vbo_settings']['force_single'] = array(
111 133
      '#type' => 'checkbox',
112 134
      '#title' => t('Force single'),
drupal7/sites/all/modules/views_bulk_operations/views_bulk_operations.info
9 9
files[] = plugins/operation_types/base.class.php
10 10
files[] = views/views_bulk_operations_handler_field_operations.inc
11 11

  
12
; Information added by Drupal.org packaging script on 2013-12-23
13
version = "7.x-3.2"
12
; Information added by Drupal.org packaging script on 2015-07-01
13
version = "7.x-3.3"
14 14
core = "7.x"
15 15
project = "views_bulk_operations"
16
datestamp = "1387798183"
16
datestamp = "1435764542"
17 17

  
drupal7/sites/all/modules/views_bulk_operations/views_bulk_operations.module
41 41
  // The list of VBO actions is fairly static, so it's hardcoded for better
42 42
  // performance (hitting the filesystem with file_scan_directory(), and then
43 43
  // caching the result has its cost).
44
  $path = drupal_get_path('module', 'views_bulk_operations') . '/actions/';
45 44
  $files = array(
46
    'archive.action.inc',
47
    'argument_selector.action.inc',
48
    'book.action.inc',
49
    'delete.action.inc',
50
    'modify.action.inc',
51
    'script.action.inc',
52
    'user_roles.action.inc',
53
    'user_cancel.action.inc',
45
    'archive.action',
46
    'argument_selector.action',
47
    'book.action',
48
    'delete.action',
49
    'modify.action',
50
    'script.action',
51
    'user_roles.action',
52
    'user_cancel.action',
54 53
  );
55 54

  
56 55
  if (!$loaded) {
57 56
    foreach ($files as $file) {
58
      include_once $path . $file;
57
      module_load_include('inc', 'views_bulk_operations', 'actions/' . $file);
59 58
    }
60 59
    $loaded = TRUE;
61 60
  }
......
77 76
function views_bulk_operations_cron() {
78 77
  db_delete('queue')
79 78
    ->condition('name', db_like('views_bulk_operations_active_queue_'), 'LIKE')
80
    ->condition('created', REQUEST_TIME - 864000, '<')
79
    ->condition('created', REQUEST_TIME - 86400, '<')
81 80
    ->execute();
82 81
}
83 82

  
......
358 357
 */
359 358
function views_bulk_operations_views_post_build(&$view) {
360 359
  $vbo = _views_bulk_operations_get_field($view);
361
  if ($vbo && $vbo->get_selected_operations() < 1) {
360
  if ($vbo && count($vbo->get_selected_operations()) < 1) {
362 361
    $vbo->options['exclude'] = TRUE;
363 362
  }
364 363
}
......
420 419
    if ($enable_select_all_pages) {
421 420
      $form['select_all']['or'] = array(
422 421
        '#type' => 'markup',
423
        '#markup' => '<em>OR</em>',
422
        '#markup' => '<em>' . t('OR') . '</em>',
424 423
      );
425 424
      $form['select_all']['all_pages'] = array(
426 425
        '#type' => 'checkbox',
......
443 442
 */
444 443
function views_bulk_operations_form($form, &$form_state, $vbo) {
445 444
  $form['#attached']['js'][] = drupal_get_path('module', 'views_bulk_operations') . '/js/views_bulk_operations.js';
445
  $form['#attached']['js'][] = array(
446
    'data' => array('vbo' => array(
447
      'row_clickable' => $vbo->get_vbo_option('row_clickable'),
448
    )),
449
    'type' => 'setting',
450
  );
451

  
446 452
  $form['#attached']['css'][] = drupal_get_path('module', 'views_bulk_operations') . '/css/views_bulk_operations.css';
447 453
  // Wrap the form in a div with specific classes for JS targeting and theming.
448 454
  $class = 'vbo-views-form';
......
595 601
  $operation = $form_state['operation'];
596 602
  $rows = $form_state['selection'];
597 603
  $query = drupal_get_query_parameters($_GET, array('q'));
604
  $title = t('Are you sure you want to perform %operation on the selected items?', array('%operation' => $operation->label()));
598 605
  $form = confirm_form($form,
599
    t('Are you sure you want to perform %operation on the selected items?', array('%operation' => $operation->label())),
606
    $title,
600 607
    array('path' => $view->get_url(), 'query' => $query),
601 608
    theme('views_bulk_operations_confirmation', array('rows' => $rows, 'vbo' => $vbo, 'operation' => $operation, 'select_all_pages' => $form_state['select_all_pages']))
602 609
  );
603 610
  // Add VBO's submit handler to the Confirm button added by config_form().
604 611
  $form['actions']['submit']['#submit'] = array('views_bulk_operations_form_submit');
605 612

  
613
  // We can't set the View title here as $view is just a copy of the original,
614
  // and our settings changes won't "stick" for the first page load of the
615
  // confirmation form. We also can't just call drupal_set_title() directly
616
  // because our title will be clobbered by the actual View title later. So
617
  // let's tuck the title away in the form for use later.
618
  // @see views_bulk_operations_preprocess_views_view()
619
  $form['#vbo_confirm_form_title'] = $title;
620

  
606 621
  return $form;
607 622
}
608 623

  
......
618 633
  // Load the entities from the current page, and show their titles.
619 634
  $entities = _views_bulk_operations_entity_load($entity_type, array_values($rows), $vbo->revision);
620 635
  foreach ($entities as $entity) {
621
    $items[] = check_plain(_views_bulk_operations_entity_label($entity_type, $entity));
636
    $items[] = check_plain(entity_label($entity_type, $entity));
622 637
  }
623 638
  // All rows on all pages have been selected, so show a count of additional items.
624 639
  if ($select_all_pages) {
......
631 646
  return $output;
632 647
}
633 648

  
649
/**
650
 * Implements hook_preprocess_page().
651
 *
652
 * Hide action links on the configure and confirm pages.
653
 */
654
function views_bulk_operations_preprocess_page(&$variables) {
655
  if (isset($_POST['select_all'], $_POST['operation'])) {
656
    $variables['action_links'] = array();
657
  }
658
}
659

  
660
/**
661
 * Implements hook_preprocess_views_view().
662
 */
663
function views_bulk_operations_preprocess_views_view($variables) {
664
  // If we've stored a title for the confirmation form, retrieve it here and
665
  // retitle the View.
666
  // @see views_bulk_operations_confirm_form()
667
  if (array_key_exists('rows', $variables) && is_array($variables['rows']) && array_key_exists('#vbo_confirm_form_title', $variables['rows'])) {
668
    $variables['view']->set_title($variables['rows']['#vbo_confirm_form_title']);
669
  }
670
}
671

  
634 672
/**
635 673
 * Goes through the submitted values, and returns
636 674
 * an array of selected rows, in the form of
......
871 909
      'views_row' => array(),
872 910
      'position' => array(
873 911
        'current' => ++$context['sandbox']['progress'],
874
        'total' => $view->total_rows,
912
        'total' => $context['sandbox']['max'],
875 913
      ),
876 914
    );
877 915
    // Some operations require full selected rows.
......
1042 1080
      $arguments = array(
1043 1081
        '%operation' => $operation->label(),
1044 1082
        '@type' => $entity_type,
1045
        '%title' => _views_bulk_operations_entity_label($entity_type, $entity),
1083
        '%title' => entity_label($entity_type, $entity),
1046 1084
      );
1047 1085

  
1048 1086
      if ($log) {
......
1128 1166
        $context['results']['log'][] = t('Skipped %operation on @type %title due to insufficient permissions.', array(
1129 1167
          '%operation' => $operation->label(),
1130 1168
          '@type' => $entity_type,
1131
          '%title' => _views_bulk_operations_entity_label($entity_type, $entity),
1169
          '%title' => entity_label($entity_type, $entity),
1132 1170
        ));
1133 1171
        unset($entities[$id]);
1134 1172
      }
......
1236 1274
  return $entities;
1237 1275
}
1238 1276

  
1239
/**
1240
 * Label function for entities.
1241
 * Core entities don't declare the "label" key, so entity_label() fails,
1242
 * and a fallback is needed. This function provides that fallback.
1243
 */
1244
function _views_bulk_operations_entity_label($entity_type, $entity) {
1245
  $label = entity_label($entity_type, $entity);
1246
  if (!$label) {
1247
    $entity_info = entity_get_info($entity_type);
1248
    $id_key = $entity_info['entity keys']['id'];
1249
    // Many entity types (e.g. "user") have a name which fits the label perfectly.
1250
    if (isset($entity->name)) {
1251
      $label = $entity->name;
1252
    }
1253
    elseif (isset($entity->{$id_key})) {
1254
      // Fallback to the id key.
1255
      $label = $entity->{$id_key};
1256
    }
1257
  }
1258

  
1259
  return $label;
1260
}
1261

  
1262 1277
/**
1263 1278
 * Helper function to report an error.
1264 1279
 */
drupal7/sites/all/modules/webform_validation/webform_validation.info
1 1
name = Webform Validation
2
description = "Add validation rules to webforms"
2
description = Add validation rules to Webforms.
3 3
core = 7.x
4
php = 5.3
5

  
6
dependencies[] = webform
7 4
package = Webform
5
dependencies[] = webform
8 6
files[] = webform_validation.admin.inc
9 7
files[] = webform_validation.install
10 8
files[] = webform_validation.module
11 9
files[] = webform_validation.rules.inc
12 10
files[] = webform_validation.validators.inc
11
php = 5.3
13 12

  
14
; Information added by Drupal.org packaging script on 2015-02-06
15
version = "7.x-1.9"
13
; Information added by Drupal.org packaging script on 2015-06-30
14
version = "7.x-1.10"
16 15
core = "7.x"
17 16
project = "webform_validation"
18
datestamp = "1423261384"
17
datestamp = "1435696981"
19 18

  
drupal7/sites/all/modules/webform_validation/webform_validation.module
152 152
    }
153 153
  }
154 154

  
155
  // Webform 7.x-3.x does not define WEBFORM_CONDITIONAL_INCLUDE. Define if needed.
156
  if (!defined('WebformConditionals::componentShown') && !defined('WEBFORM_CONDITIONAL_INCLUDE')) {
157
    define('WEBFORM_CONDITIONAL_INCLUDE', 1);
158
  }
159

  
155 160
  if ($rules) {
156 161
    $component_definitions = webform_validation_prefix_keys($node->webform['components']);
157 162
    // Remove hidden components.
158 163
    foreach ($component_definitions as $key => $component) {
159
      if (isset($flat_values[$key]) && _webform_client_form_rule_check($node, $component, 0, $form_state['values']['submitted']) !== WEBFORM_CONDITIONAL_INCLUDE) {
160
        unset($flat_values[$key]);
164
      if (defined('WebformConditionals::componentShown')) {
165
        if (webform_get_conditional_sorter($node)->componentVisibility($component['cid'], $component['page_num']) !== WebformConditionals::componentShown) {
166
          unset($flat_values[$key]);
167
        }
168
      }
169
      else {
170
        // Old conditionals system removed in Webform 7.x-4.8.
171
        // In Webform 7.x-3.x, _webform_client_form_rule_check() returns boolean.
172
        // Cast to int so that the function behaves as it does in 7.x-4.x.
173
        if (isset($flat_values[$key]) && (int) _webform_client_form_rule_check($node, $component, 0, $form_state['values']['submitted']) !== WEBFORM_CONDITIONAL_INCLUDE) {
174
          unset($flat_values[$key]);
175
        }
161 176
      }
162 177
    }
163 178
    foreach ($rules as $rule) {
drupal7/sites/all/modules/webform_validation/webform_validation.validators.inc
76 76
      ),
77 77
      'custom_data' => array(
78 78
        'label' => t('Minimum number of words'),
79
        'description' => t('Specify the minimum number of words that have to be entered to pass validation. Words are defined as strings of letters separated by spaces.')
79
        'description' => t('Specify the minimum number of words that have to be entered to pass validation. Words are defined as strings of letters separated by spaces.'),
80 80
      ),
81 81
      'description' => t('Verifies that a user-entered value contains at least the specified number of words.'),
82 82
    ),
......
90 90
      ),
91 91
      'custom_data' => array(
92 92
        'label' => t('Maximum number of words'),
93
        'description' => t('Specify the maximum number of words that have to be entered to pass validation. Words are defined as strings of letters separated by spaces.')
93
        'description' => t('Specify the maximum number of words that have to be entered to pass validation. Words are defined as strings of letters separated by spaces.'),
94 94
      ),
95 95
      'description' => t('Verifies that a user-entered value contains at most the specified number of words.'),
96 96
    ),
......
123 123
        'textarea',
124 124
        'textfield',
125 125
        'time',
126
        'boolean',
126 127
      ),
127 128
      'min_components' => 2,
128 129
      'description' => t('Verifies that all specified components contain equal values. If all components are of type email, they will get case-insensitive comparison.'),
......
159 160
        'textarea',
160 161
        'textfield',
161 162
        'time',
163
        'boolean',
162 164
      ),
163 165
      'min_components' => 2,
164 166
      'description' => t('Verifies that none of the specified components contain the same value as another selected component in this submission. (To check that values are unique between submissions, use the unique validation option on the "Edit component" page for that component.) If all components are of type email, they will get case-insensitive comparison.'),
......
173 175
        'select',
174 176
        'textarea',
175 177
        'textfield',
178
        'boolean',
176 179
      ),
177 180
      'custom_error' => TRUE,
178 181
      'custom_data' => array(
......
192 195
        'select',
193 196
        'textarea',
194 197
        'textfield',
198
        'boolean',
195 199
      ),
196 200
      'custom_error' => TRUE,
197 201
      'description' => t('Verifies that the user-entered value is the default value for that component. Negate if you want not the default value.'),
......
206 210
        'select',
207 211
        'textarea',
208 212
        'textfield',
209
        'time'
213
        'time',
214
        'boolean',
210 215
      ),
211 216
      'custom_data' => array(
212 217
        'label' => t('Number to be completed'),
......
373 378
      ),
374 379
      'description' => t('Validates that user-entered data doesn\'t contain any of the specified illegal words.'),
375 380
    ),
376
   'username' => array(
381
    'username' => array(
377 382
      'name' => t('Must match a username'),
378 383
      'negatable' => TRUE,
379 384
      'component_types' => array(

Formats disponibles : Unified diff