You are here

function _template_preprocess_webform_composite in Webform 6.x

Same name and namespace in other branches
  1. 8.5 includes/webform.theme.template.inc \_template_preprocess_webform_composite()

Prepares variables for webform composite templates.

Parameters

array $variables: An associative array containing:

  • element: An associative array containing the properties of the element.
5 calls to _template_preprocess_webform_composite()
template_preprocess_webform_composite_address in includes/webform.theme.template.inc
Prepares variables for composite address templates.
template_preprocess_webform_composite_contact in includes/webform.theme.template.inc
Prepares variables for composite contact templates.
template_preprocess_webform_composite_name in includes/webform.theme.template.inc
Prepares variables for composite name templates.
template_preprocess_webform_composite_telephone in includes/webform.theme.template.inc
Prepares variables for composite telephone templates.
template_preprocess_webform_example_composite in modules/webform_example_composite/webform_example_composite.module
Prepares variables for webform example composite templates.

File

includes/webform.theme.template.inc, line 766
Preprocessors and helper functions to make theming easier.

Code

function _template_preprocess_webform_composite(array &$variables) {
  $element = $variables['element'];

  // Copy all accessible element children to content.
  foreach (Element::children($element) as $key) {
    if (!isset($element[$key]['#access']) || $element[$key]['#access']) {
      $variables['content'][$key] = $element[$key];
    }
  }

  // Set flexbox variable used for multi column element layout.
  $variables['flexbox'] = isset($element['#flexbox']) ? $element['#flexbox'] : FALSE;
}