Révision 950416da
Ajouté par Assos Assos il y a plus de 5 ans
drupal7/sites/all/modules/rules/modules/entity.eval.inc | ||
---|---|---|
5 | 5 |
* Contains rules integration for entities needed during evaluation. |
6 | 6 |
* |
7 | 7 |
* @addtogroup rules |
8 |
* |
|
8 | 9 |
* @{ |
9 | 10 |
*/ |
10 | 11 |
|
... | ... | |
67 | 68 |
if ($element->settings['property']) { |
68 | 69 |
$wrapper = rules_get_entity_metadata_wrapper_all_properties($element); |
69 | 70 |
if (isset($wrapper->{$element->settings['property']}) && $property = $wrapper->{$element->settings['property']}) { |
70 |
$element_info['parameter']['value']['type'] = $property->type(); |
|
71 |
$element_info['parameter']['value']['options list'] = $property->optionsList() ? 'rules_action_entity_query_value_options_list' : FALSE; |
|
71 |
$property_type = $property->type(); |
|
72 |
// If the cardinality of the property > 1, i.e. of type 'list<{type}>', |
|
73 |
// we will also accept a parameter of type {type}. |
|
74 |
if (substr($property_type, 0, strlen('list<')) === 'list<' && substr($property_type, -strlen('>')) === '>') { |
|
75 |
$property_type = array($property_type, substr($property_type, strlen('list<'), strlen($property_type) - strlen('list<>'))); |
|
76 |
} |
|
77 |
$element_info['parameter']['value']['type'] = $property_type; |
|
78 |
$element_info['parameter']['value']['options list'] = $property->optionsList() ? 'rules_action_entity_query_value_options_list' : FALSE; |
|
72 | 79 |
} |
73 | 80 |
} |
74 | 81 |
} |
... | ... | |
106 | 113 |
$info = $child->info(); |
107 | 114 |
if (!empty($info['required'])) { |
108 | 115 |
$info += array('type' => 'text'); |
109 |
// Prefix parameter names to avoid name clashes with existing parameters. |
|
116 |
// Prefix parameter names to avoid name clashes |
|
117 |
// with existing parameters. |
|
110 | 118 |
$element_info['parameter']['param_' . $name] = array_intersect_key($info, array_flip(array('type', 'label', 'description'))); |
111 |
$element_info['parameter']['param_' . $name]['options list'] = $child->optionsList() ? 'rules_action_entity_parameter_options_list' : FALSE;
|
|
119 |
$element_info['parameter']['param_' . $name]['options list'] = $child->optionsList() ? 'rules_action_entity_parameter_options_list' : FALSE; |
|
112 | 120 |
} |
113 | 121 |
} |
114 | 122 |
$element_info['provides']['entity_created']['type'] = $element->settings['type']; |
... | ... | |
172 | 180 |
$field = field_info_field($field_name); |
173 | 181 |
return !empty($field) && field_access($op, $field, $wrapper->type(), $wrapper->value(), $account = NULL); |
174 | 182 |
} |
183 |
|
|
184 |
/** |
|
185 |
* @} |
|
186 |
*/ |
Formats disponibles : Unified diff
Weekly update of contrib modules