wrapper($input); } private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error, $value) { $fieldHelpers = new FieldHelpers($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) && strpos($field->val, BITFORMS_BF_SEPARATOR) !== false) $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='disabled'"; } $checkBoxOptions .= <<getCustomAttributes('cw')} class="{$fieldHelpers->getAtomicCls('cw')} {$fieldHelpers->getCustomClasses('cw')}" > CHECKBOXOPTIONS; } } //Other Option $optCount = property_exists($field, 'opt') ? count($field->opt) : 0; $inputPh = isset($field->otherInpPh) ? "placeholder='{$fieldHelpers->esc_attr($field->otherInpPh)}'" : "placeholder='Other...'"; $inpReq = isset($field->valid->otherOptReq) ? ($field->valid->otherOptReq ? 'required' : '') : ''; if (property_exists($field, 'addOtherOpt') && $field->addOtherOpt) { $checkBoxOptions .= <<getCustomAttributes('cw')} class="{$fieldHelpers->getAtomicCls('cw')} {$fieldHelpers->getCustomClasses('cw')}" >
CHECKBOXOPTIONS; } return <<getCustomAttributes('cc')} class="{$fieldHelpers->getAtomicCls('cc')} {$fieldHelpers->getCustomClasses('cc')}" > {$checkBoxOptions} CHECKBOXFIELD; } }