protected function WebformUiEntityElementsForm::getParentOptions in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_ui/src/WebformUiEntityElementsForm.php \Drupal\webform_ui\WebformUiEntityElementsForm::getParentOptions()
Get parent (container) elements as options.
Parameters
array $elements: A flattened array of elements.
Return value
array Parent (container) elements as options.
1 call to WebformUiEntityElementsForm::getParentOptions()
- WebformUiEntityElementsForm::buildForm in modules/
webform_ui/ src/ WebformUiEntityElementsForm.php - Form constructor.
File
- modules/
webform_ui/ src/ WebformUiEntityElementsForm.php, line 410
Class
- WebformUiEntityElementsForm
- Webform manage elements UI form.
Namespace
Drupal\webform_uiCode
protected function getParentOptions(array $elements) {
$options = [];
foreach ($elements as $key => $element) {
$plugin_id = $this->elementManager
->getElementPluginId($element);
$webform_element = $this->elementManager
->createInstance($plugin_id);
if ($webform_element
->isContainer($element)) {
$options[$key] = $element['#admin_title'] ?: $element['#title'];
}
}
return $options;
}