You are here

function rules_condition_entity_has_field_options in Rules 7.2

Returns options for choosing a field for the selected entity.

Related topics

1 string reference to 'rules_condition_entity_has_field_options'
rules_entity_condition_info in modules/entity.rules.inc
Implements hook_rules_condition_info() on behalf of the entity module.

File

modules/entity.rules.inc, line 462
General entity related rules integration.

Code

function rules_condition_entity_has_field_options(RulesAbstractPlugin $element) {

  // The field_info_field_map() function was introduced in Drupal 7.22. See
  // https://www.drupal.org/node/1915646.
  if (function_exists('field_info_field_map')) {
    $fields = field_info_field_map();
  }
  else {
    $fields = field_info_fields();
  }
  $field_list = drupal_map_assoc(array_keys($fields));
  ksort($field_list);
  return $field_list;
}