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();
$checkBoxOptions = '';
$bfFrontendFormIds = FrontendHelpers::$bfFrontendFormIds;
$contentCount = count($bfFrontendFormIds);
if (property_exists($field, 'opt') && count($field->opt) > 0) {
if (isset($field->val) && false !== strpos($field->val, BITFORMS_BF_SEPARATOR)) {
$defaultValues = explode(BITFORMS_BF_SEPARATOR, $field->val);
} else {
$defaultValues = isset($field->val) ? explode(',', $field->val) : [];
}
foreach ($field->opt as $key => $opt) {
$value = isset($opt->val) ? $opt->val : $opt->lbl;
$check = '';
$req = '';
$disabled = '';
$href = htmlentities("#$rowID-ck-svg");
if ($fieldHelpers->property_exists_nested($opt, 'check', true)) {
$check = 'checked';
} else {
if (in_array($value, $defaultValues)) {
$check = 'checked';
}
}
if ($fieldHelpers->property_exists_nested($opt, 'req', true)) {
$req = 'required';
}
if ($fieldHelpers->property_exists_nested($field, 'valid->disabled', true)
|| $fieldHelpers->property_exists_nested($opt, 'disabled', true)) {
$disabled = 'disabled';
}
if (isset($field->mx) && !empty($field->valid->disableOnMax) && !$check && ((int) $field->mx <= count($defaultValues))) {
$disabled = 'disabled';
}
$checkBoxOptions .= '
getCustomAttributes('cw') . '
class="' . $fieldHelpers->getAtomicCls('cw') . ' ' . $fieldHelpers->getCustomClasses('cw') . '"
>
';
}
}
//Other Option
$optCount = property_exists($field, 'opt') ? count($field->opt) : 0;
$inpReq = isset($field->valid->otherOptReq) ? ($field->valid->otherOptReq ? 'required' : '') : '';
$otherOptLbl = !empty($field->otherOptLbl) ? $field->otherOptLbl : __('Other...', 'bit-form');
$inputPh = isset($field->otherInpPh) ? "placeholder='{$fieldHelpers->esc_attr($field->otherInpPh)}'" : "placeholder='{$otherOptLbl}'";
if (property_exists($field, 'addOtherOpt') && $field->addOtherOpt) {
$checkBoxOptions .=
'';
}
$labelId = $fieldHelpers->getLabelId();
$ariaDescribedBy = $fieldHelpers->ariaDescribedBy();
$ariaRequired = $fieldHelpers->ariaRequired();
return sprintf(
'',
$fieldHelpers->getCustomAttributes('cc'),
$fieldHelpers->getAtomicCls('cc'),
$fieldHelpers->getCustomClasses('cc'),
$labelId,
$ariaDescribedBy,
$ariaRequired,
$fieldHelpers->getAtomicCls('cks'),
$rowID,
$fieldHelpers->getAtomicCls('ck-svgline'),
$checkBoxOptions
);
}
}