";
$visibleFields = array_chunk(array_filter($data['fields'], function ($field) {
return $field['settings']['visible'];
}), 2);
$googleAutoComplete = 'yes' === ArrayHelper::get($data, 'settings.enable_g_autocomplete');
foreach ($visibleFields as $chunked) {
echo "
";
foreach ($chunked as $item) {
if ($item['settings']['visible']) {
$itemName = $item['attributes']['name'];
$item['attributes']['data-key_name'] = $itemName;
$item['attributes']['name'] = $rootName . '[' . $itemName . ']';
if ('select_country' === $item['element'] && $googleAutoComplete) {
$selectedCountries = (array) ArrayHelper::get($item, 'attributes.value', []);
if ('visible_list' === ArrayHelper::get($item, 'settings.country_list.active_list')) {
$selectedCountries = array_unique(
array_merge(
$selectedCountries,
ArrayHelper::get($item, 'settings.country_list.visible_list', [])
)
);
}
$item['attributes']['data-autocomplete_restrictions'] = json_encode(array_filter($selectedCountries));
}
$item = apply_filters_deprecated(
'fluentform_before_render_item',
[
$item,
$form
],
FLUENTFORM_FRAMEWORK_UPGRADE,
'fluentform/before_render_item',
'Use fluentform/before_render_item instead of fluentform_before_render_item.'
);
$item = apply_filters('fluentform/before_render_item', $item, $form);
echo "
";
do_action_deprecated(
'fluentform_render_item_' . $item['element'],
[
$item,
$form
],
FLUENTFORM_FRAMEWORK_UPGRADE,
'fluentform/render_item_' . $item['element'],
'Use fluentform/render_item_' . $item['element'] . ' instead of fluentform_render_item_' . $item['element']
);
do_action('fluentform/render_item_' . $item['element'], $item, $form);
echo '
';
}
}
echo '