Révision 5e632cae
Ajouté par Assos Assos il y a environ 3 ans
drupal7/sites/all/modules/field_collection/field_collection.tokens.inc | ||
---|---|---|
66 | 66 |
); |
67 | 67 |
} |
68 | 68 |
|
69 |
|
|
70 | 69 |
/** |
71 | 70 |
* Implements hook_tokens(). |
72 | 71 |
*/ |
... | ... | |
75 | 74 |
|
76 | 75 |
// Provide a complete set of tokens for type == 'host', and a supplementary |
77 | 76 |
// token 'host' for type == 'field_collection_item'. |
78 |
if (($type == 'field_collection_item' or $type == 'host') and !empty($data['field_collection_item'])) {
|
|
77 |
if (($type === 'field_collection_item' || $type === 'host') && !empty($data['field_collection_item'])) {
|
|
79 | 78 |
$collection = $data['field_collection_item']; |
80 | 79 |
// When saving revisions, only $collection->original has valid state about |
81 | 80 |
// its host entity. |
... | ... | |
83 | 82 |
$collection = $collection->original; |
84 | 83 |
} |
85 | 84 |
|
86 |
if ($type == 'field_collection_item') { |
|
85 |
if ($type === 'field_collection_item') {
|
|
87 | 86 |
if (!empty($tokens['host'])) { |
88 | 87 |
$replacements[$tokens['host']] = $collection->hostEntityId(); |
89 | 88 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules