Projet

Général

Profil

Révision 950416da

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/rules/modules/entity.rules.inc
1 1
<?php
2 2

  
3 3
/**
4
 * @file General entity related rules integration
4
 * @file
5
 * General entity related rules integration.
5 6
 *
6 7
 * @addtogroup rules
8
 *
7 9
 * @{
8 10
 */
9 11

  
10 12
/**
11 13
 * Implements hook_rules_file_info() on behalf of the entity module.
14
 *
12 15
 * @see rules_core_modules()
13 16
 */
14 17
function rules_entity_file_info() {
......
30 33

  
31 34
/**
32 35
 * Implements hook_rules_action_info() on behalf of the entity module.
36
 *
33 37
 * @see rules_core_modules()
34 38
 */
35 39
function rules_entity_action_info() {
......
322 326

  
323 327
/**
324 328
 * Implements hook_rules_condition_info() on behalf of the entity module.
329
 *
325 330
 * @see rules_core_modules()
326 331
 */
327 332
function rules_entity_condition_info() {
......
455 460
 * Returns options for choosing a field for the selected entity.
456 461
 */
457 462
function rules_condition_entity_has_field_options(RulesAbstractPlugin $element) {
458
  // The field_info_field_map() function was introduced in Drupal 7.22 (see
459
  // https://drupal.org/node/1915646).
463
  // The field_info_field_map() function was introduced in Drupal 7.22. See
464
  // https://www.drupal.org/node/1915646.
460 465
  if (function_exists('field_info_field_map')) {
461 466
    $fields = field_info_field_map();
462 467
  }
463 468
  else {
464 469
    $fields = field_info_fields();
465 470
  }
466
  return drupal_map_assoc(array_keys($fields));
471
  $field_list = drupal_map_assoc(array_keys($fields));
472
  ksort($field_list);
473
  return $field_list;
467 474
}
468 475

  
469 476
/**
......
563 570
      $form['reload']['#limit_validation_errors'] = array(array('parameter', 'entity'));
564 571
      unset($form['parameter']['type']);
565 572
      unset($form['reload']['#attributes']['class']);
566
      // NO break;
573
      // NO break.
567 574
    case 2:
568 575
      $form['negate']['#access'] = FALSE;
569 576
      unset($form['parameter']['bundle']);
570 577
      unset($form['submit']);
571 578
      break;
579

  
572 580
    case 3:
573 581
      if (($info = $element->getArgumentInfo('entity')) && $info['type'] != 'entity') {
574 582
        // Hide the entity type parameter if not needed.

Formats disponibles : Unified diff