Révision 3acd948f
Ajouté par Assos Assos il y a plus de 6 ans
drupal7/sites/all/modules/entityreference/entityreference.module | ||
---|---|---|
1 | 1 |
<?php |
2 | 2 |
|
3 |
define('ENTITYREFERENCE_DENIED', '- Restricted access -'); |
|
4 |
|
|
3 | 5 |
/** |
4 | 6 |
* @file |
5 | 7 |
* Entityreference primary module file. |
... | ... | |
1106 | 1108 |
if (isset($tag_last)) { |
1107 | 1109 |
// Get an array of matching entities. |
1108 | 1110 |
$entity_labels = $handler->getReferencableEntities($tag_last, $instance['widget']['settings']['match_operator'], 10); |
1109 |
|
|
1111 |
$denied_label = t(ENTITYREFERENCE_DENIED); |
|
1110 | 1112 |
// Loop through the products and convert them into autocomplete output. |
1111 | 1113 |
foreach ($entity_labels as $values) { |
1112 | 1114 |
foreach ($values as $entity_id => $label) { |
1115 |
// Never autocomplete entities that aren't accessible. |
|
1116 |
if ($label == $denied_label) { |
|
1117 |
continue; |
|
1118 |
} |
|
1113 | 1119 |
$key = "$label ($entity_id)"; |
1114 | 1120 |
// Strip starting/trailing white spaces, line breaks and tags. |
1115 | 1121 |
$key = preg_replace('/\s\s+/', ' ', str_replace("\n", '', trim(decode_entities(strip_tags($key))))); |
Formats disponibles : Unified diff
Weekly update of contrib modules