wrapper($input);
}
private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value)
{
$fieldHelpers = new ClassicFieldHelpers($field, $rowID, $form_atomic_Cls_map);
$req = $fieldHelpers->required();
$name = $fieldHelpers->name();
$value = '';
$radioBoxOptions = '';
$bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds;
$contentCount = count($bfFrontendFormIds);
if (property_exists($field, 'opt') && count($field->opt) > 0) {
$defaultValue = isset($field->val) ? $field->val : '';
foreach ($field->opt as $key => $opt) {
$value = isset($opt->val) ? $opt->val : $opt->lbl;
$check = '';
$req = '';
$lbl = $fieldHelpers->renderHTMR($opt->lbl);
$disabled = '';
if ($fieldHelpers->property_exists_nested($opt, 'check', true)) {
$check = "checked='{$opt->check}'";
} else {
if ($value === $defaultValue) {
$check = "checked='checked'";
}
}
if ($fieldHelpers->property_exists_nested($opt, 'req', true)) {
$req = "required='{$opt->req}'";
}
if ($fieldHelpers->property_exists_nested($field, 'valid->disabled', true)
|| $fieldHelpers->property_exists_nested($opt, 'disabled', true)) {
$disabled = "disabled='disabled'";
}
$radioBoxOptions .= sprintf(
'
',
$fieldHelpers->getCustomAttributes('cw'),
$fieldHelpers->getAtomicCls('cw'),
$fieldHelpers->getCustomClasses('cw'),
$fieldHelpers->getCustomAttributes('ci'),
$rowID,
$contentCount,
$key,
$fieldHelpers->getAtomicCls('ci'),
$fieldHelpers->getCustomClasses('ci'),
$fieldHelpers->esc_attr($value),
$check,
$name,
$req,
$disabled,
$fieldHelpers->getCustomAttributes('cl'),
$fieldHelpers->getAtomicCls('cl'),
$fieldHelpers->getCustomClasses('cl'),
$fieldHelpers->getCustomAttributes('bx'),
$fieldHelpers->getAtomicCls('bx'),
$fieldHelpers->getCustomClasses('bx'),
$fieldHelpers->getAtomicCls('svgwrp'),
$fieldHelpers->getCustomClasses('svgwrp'),
$fieldHelpers->getAtomicCls('ck-icn'),
$fieldHelpers->getCustomClasses('ck-icn'),
$fieldHelpers->getCustomAttributes('ct'),
$fieldHelpers->getAtomicCls('ct'),
$fieldHelpers->getCustomClasses('ct'),
$fieldHelpers->kses_post($lbl)
);
}
}
//Other Option
$otherOptLbl = !empty($field->otherOptLbl) ? $field->otherOptLbl : __('Other...', 'bit-form');
$optCount = property_exists($field, 'opt') ? count($field->opt) : 0;
$inputPh = isset($field->otherInpPh) ? $field->otherInpPh : $otherOptLbl;
$inpReq = isset($field->valid->otherOptReq) ? ($field->valid->otherOptReq ? 'required' : '') : '';
if (property_exists($field, 'addOtherOpt') && $field->addOtherOpt) {
$check = $check ?? '';
$radioBoxOptions .= sprintf(
' ',
$fieldHelpers->getCustomAttributes('cw'),
$fieldHelpers->getAtomicCls('cw'),
$fieldHelpers->getCustomClasses('cw'),
$fieldHelpers->getCustomAttributes('ci'),
$rowID,
$contentCount,
$optCount,
$fieldHelpers->getAtomicCls('ci'),
$fieldHelpers->getCustomClasses('ci'),
$check,
$name,
$fieldHelpers->getCustomAttributes('cl'),
$fieldHelpers->getAtomicCls('cl'),
$fieldHelpers->getCustomClasses('cl'),
$fieldHelpers->getCustomAttributes('rdo'),
$fieldHelpers->getAtomicCls('bx'),
$fieldHelpers->getAtomicCls('rdo'),
$fieldHelpers->getCustomClasses('rdo'),
$fieldHelpers->getAtomicCls('svgwrp'),
$fieldHelpers->getCustomClasses('svgwrp'),
$fieldHelpers->getAtomicCls('ck-icn'),
$fieldHelpers->getCustomClasses('ck-icn'),
$fieldHelpers->getCustomAttributes('ct'),
$fieldHelpers->getAtomicCls('ct'),
$fieldHelpers->getCustomClasses('ct'),
$otherOptLbl,
$fieldHelpers->getAtomicCls('other-inp-wrp'),
$fieldHelpers->getAtomicCls('other-inp'),
$inpReq,
$fieldHelpers->esc_attr($inputPh)
);
}
return sprintf(
'
%4$s
',
$fieldHelpers->getCustomAttributes('cc'),
$fieldHelpers->getAtomicCls('cc'),
$fieldHelpers->getCustomClasses('cc'),
$radioBoxOptions
);
}
}