"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
$html .= "
";
$labelPlacement = ArrayHelper::get($data, 'settings.label_placement');
$labelPlacementClass = '';
if ($labelPlacement) {
$labelPlacementClass = ' ff-el-form-' . $labelPlacement;
}
foreach ($data['fields'] as $field) {
if ($field['settings']['visible']) {
$fieldName = $field['attributes']['name'];
$field['attributes']['name'] = $rootName . '[' . $fieldName . ']';
@$field['attributes']['class'] = trim(
'ff-el-form-control ' .
$field['attributes']['class']
);
if ($tabIndex = Helper::getNextTabIndex()) {
$field['attributes']['tabindex'] = $tabIndex;
}
@$field['settings']['container_class'] .= $labelPlacementClass;
$field['attributes']['id'] = $this->makeElementId($field, $form);
$nameTitleClass = '';
$atts = $this->buildAttributes($field['attributes']);
$ariaRequired = 'false';
if (ArrayHelper::get($field, 'settings.validation_rules.required.value')) {
$ariaRequired = 'true';
}
if ('select' == $field['attributes']['type']) {
if (! defined('FLUENTFORMPRO')) {
continue;
}
$nameTitleClass = ' ff-name-title';
$defaultValues = (array) $this->extractValueFromAttributes($field);
$options = $this->buildOptions($field, $defaultValues);
$elMarkup = '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts and $options are escaped before being passed in.
} else {
$elMarkup = '
'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $atts is escaped before being passed in.
}
$inputTextMarkup = $this->buildElementMarkup($elMarkup, $field, $form);
$html .= "
{$inputTextMarkup}
"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $inputTextMarkup is escaped before being passed in.
}
}
$html .= '