You are here

function rules_data_list_info_alter in Rules 7.2

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 144
Contains rules integration for the data module needed during evaluation.

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;
    }
  }
}