Projet

Général

Profil

Révision a1cafe7e

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

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/field_collection/field_collection.info.inc
24 24
      'required' => TRUE,
25 25
    );
26 26

  
27
    // Also add type-specific host entity references for all entity types that
28
    // have at least one field collection field.
29
    $field_collection_fields = field_read_fields(array('type' => 'field_collection'));
30
    $entity_types = entity_get_info();
31
    foreach (field_info_instances() as $entity_type => $bundles) {
32
      foreach ($bundles as $bundle => $fields) {
33
        if (array_intersect_key($fields, $field_collection_fields)) {
34
          $args = array('@type' => $entity_types[$entity_type]['label']);
35
          $properties["host_entity_$entity_type"] = array(
36
            'label' => t('Host entity (@type)', $args),
37
            'type' => $entity_type,
38
            'description' => t('The @type containing the field collection field (empty if this field collection is attached to an item of a different type).', $args),
39
            'getter callback' => 'field_collection_item_get_specific_type_host_entity',
40
            'computed' => TRUE,
41
          );
42
          break;
43
        }
44
      }
45
    }
46

  
27 47
    return $info;
28 48
  }
29 49

  

Formats disponibles : Unified diff