wrapper($input); } private static function field($field, $rowID, $form_atomic_Cls_map, $formID, $value) { $fieldHelpers = new ConversationalFieldHelpers($formID, $field, $rowID, $form_atomic_Cls_map); $name = $fieldHelpers->name(); $req = $fieldHelpers->required(); $bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds; $contentCount = count($bfFrontendFormIds); $imageOption = ''; if (!empty($field->val)) { $value = $field->val; } if (!empty($value) && false !== strpos($value, BITFORMS_BF_SEPARATOR)) { $defaultValues = explode(BITFORMS_BF_SEPARATOR, $value); } else { $defaultValues = isset($value) ? explode(',', $value) : []; } if (isset($field->opt)) { $checkedImg = $field->tickImgSrc; foreach ($field->opt as $key => $opt) { $val = isset($opt->val) ? $opt->val : $opt->lbl; $img = $opt->img; $lbl = $fieldHelpers->renderHTMR($opt->lbl); $checked = ''; $inpType = $field->inpType; $imgAlt = $fieldHelpers->esc_html($lbl); $disabled = ''; if ($fieldHelpers->property_exists_nested($opt, 'check', true)) { $checked = 'checked'; } elseif (in_array($val, $defaultValues)) { $checked = 'checked'; } if (isset($field->mx) && !empty($field->valid->disableOnMax) && !$checked && ((int) $field->mx <= count($defaultValues))) { $disabled = 'disabled'; } $optLblHide = null; if (!$field->optLblHide) { $optLblHide = <<getCustomAttributes('tc')} > getCustomAttributes('img-title')} > {$fieldHelpers->kses_post($lbl)} OPTLBLHIDE; } else { $optLblHide = ''; } $imageOption .= <<getCustomAttributes('inp-opt')} > getCustomAttributes('img-inp')} /> IMAGESELECT; } } return <<getCustomAttributes('inp-fld-wrp')} >
getCustomAttributes('ic')} > {$imageOption}
IMAGESELECTFIELD; } }