You are here

function rules_webform_extract_composite_elements in RULES WEBFORM 8

Same name and namespace in other branches
  1. 3.x rules_webform.module \rules_webform_extract_composite_elements()

Extract the information about a webform fields.

This information will be used for fields data definition in the 'WebformFieldsDataDefinition' class and in the'WebformFieldsUnchangedDataDefinition' class.

1 call to rules_webform_extract_composite_elements()
rules_webform_form_rules_expression_edit_alter in ./rules_webform.module
Implements hook_form_FORM_ID_alter().

File

./rules_webform.module, line 364
Contains rules_webform.module.

Code

function rules_webform_extract_composite_elements(array $elements, array &$fields_definitions) {
  foreach ($elements as $name => $options) {
    if (isset($options['#webform_composite_elements'])) {
      rules_webform_extract_composite_elements($options['#webform_composite_elements'], $fields_definitions);
    }
    else {

      // Exclude wizard pages and buttons from the list of elements.
      if ($options['#type'] != 'webform_wizard_page' && $options['#type'] != "webform_actions") {
        $fields_definitions[$name] = (string) isset($options['#title']) ? $options['#title'] : '';
      }
    }
  }
}