function rules_data_list_info_alter

Info alteration callback for the "Add and Remove a list item" actions.

Related topics

2 string references to 'rules_data_list_info_alter'
rules_data_action_info in modules/data.rules.inc
Implements hook_rules_action_info() on behalf of the pseudo data module.
rules_data_condition_info in modules/data.rules.inc
Implements hook_rules_condition_info() on behalf of the pseudo data module.

File

modules/data.eval.inc, line 147

Code

function rules_data_list_info_alter(&$element_info, RulesAbstractPlugin $element) {
    // Update the required type for the list item if it is known.
    $element->settings += array(
        'list:select' => NULL,
    );
    if ($wrapper = $element->applyDataSelector($element->settings['list:select'])) {
        if ($type = entity_property_list_extract_type($wrapper->type())) {
            $info = $wrapper->info();
            $element_info['parameter']['item']['type'] = $type;
            $element_info['parameter']['item']['options list'] = !empty($info['options list']) ? 'rules_data_selector_options_list' : FALSE;
        }
    }
}