You are here

public static function WebformLocationBase::preRenderWebformCompositeFormElement in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformLocationBase.php \Drupal\webform\Element\WebformLocationBase::preRenderWebformCompositeFormElement()

Adds form element theming to an element if its title or description is set.

This is used as a pre render function for checkboxes and radios.

Overrides WebformCompositeFormElementTrait::preRenderWebformCompositeFormElement

File

src/Element/WebformLocationBase.php, line 74

Class

WebformLocationBase
Provides a webform base element for a location element.

Namespace

Drupal\webform\Element

Code

public static function preRenderWebformCompositeFormElement($element) {

  // Hide location element webform display only if #geolocation is also set.
  if (!empty($element['#hidden']) && !empty($element['#geolocation'])) {
    $element['#wrapper_attributes']['style'] = 'display: none';
  }
  $element = WebformCompositeBase::preRenderWebformCompositeFormElement($element);
  return $element;
}