wrapper($input); } private static function field($field, $rowID, $field_name, $form_atomic_Cls_map, $formID, $error = null, $value = null) { $fh = new ClassicFieldHelpers($field, $rowID, $form_atomic_Cls_map); $img_url = BITFORMS_ASSET_URI . '/../static/countries/'; $req = $fh->required(); $disabled = $fh->disabled(); $readonly = $fh->readonly(); $name = $fh->name(); $ph = $fh->placeholder(); $ariaDescribedBy = $fh->ariaDescribedBy(); $ariaRequired = $fh->ariaRequired(); // Get dynamic label ID to properly link the combobox to its label for screen readers $labelId = $fh->getLabelId(); $selectedFlagImage = ''; $dropDownBtn = ''; $tabIndx = isset($field->disabled) ? -1 : 0; $selectedCountryClearable = ''; $dpdWrap = ''; $searchPlaceholder = ''; $searchClearable = ''; $optionWrap = ''; $options = ''; $showSelectedFlagImg = $fh->property_exists_nested($field, 'config->selectedFlagImage', true); $hideCountryList = $fh->property_exists_nested($field, 'config->hideCountryList', true); $readonlyCls = isset($field->readonly) ? 'readonly' : ''; $disabledCls = isset($field->disabled) ? 'disabled' : ''; $img = esc_url(includes_url('images/blank.gif')); $val = $fh->value(); if ($showSelectedFlagImg) { $selectedFlagImage = sprintf( '
', $fh->getAtomicCls('selected-country-wrp'), $fh->getCustomAttributes('selected-phone-img'), $fh->getAtomicCls('selected-country-img'), $fh->getCustomClasses('selected-country-img'), $img ); } if (!$hideCountryList) { $dropDownBtn = sprintf( '
', $fh->getAtomicCls('dpd-down-btn') ); } if ($fh->property_exists_nested($field, 'config->selectedCountryClearable', true)) { $selectedCountryClearable = sprintf( '', $fh->getCustomAttributes('input-clear-btn'), $fh->getAtomicCls('input-clear-btn'), $fh->getCustomClasses('input-clear-btn') ); } if ($fh->property_exists_nested($field, 'config->searchPlaceholder', '', 1)) { $searchPlaceholder = "{$field->config->searchPlaceholder}"; } if ($fh->property_exists_nested($field, 'config->searchClearable', true)) { $searchClearable = sprintf( '', $fh->getCustomAttributes('search-clear-btn'), $fh->getAtomicCls('search-clear-btn'), $fh->getCustomClasses('search-clear-btn') ); } if (!$hideCountryList || $showSelectedFlagImg) { $dpdWrap = sprintf( '', $fh->getAtomicCls('dpd-wrp'), $labelId, $tabIndx, $selectedFlagImage, $dropDownBtn ); } if (!$hideCountryList) { $optionWrap = sprintf( '
%15$s
', $fh->getCustomAttributes('option-wrp'), $fh->getAtomicCls('option-wrp'), $fh->getCustomClasses('option-wrp'), $fh->getAtomicCls('option-inner-wrp'), $fh->getCustomAttributes('option-search-wrp'), $fh->getAtomicCls('option-search-wrp'), $fh->getCustomClasses('option-search-wrp'), $fh->getCustomAttributes('opt-search-input'), $fh->getAtomicCls('opt-search-input'), $fh->getCustomClasses('opt-search-icn'), $fh->esc_attr($searchPlaceholder), $fh->getCustomAttributes('opt-search-icn'), $fh->getAtomicCls('opt-search-icn'), $fh->getCustomClasses('opt-search-icn'), $searchClearable, $fh->getCustomAttributes('option-list'), $fh->getAtomicCls('option-list'), $fh->getCustomClasses('option-list'), $options ); } return sprintf( '
%16$s %22$s
%23$s
', $fh->getAtomicCls('phone-fld-container'), // 1 $fh->getCustomAttributes('phone-fld-wrp'), // 2 $fh->getAtomicCls('phone-fld-wrp'), // 3 $fh->getCustomClasses('phone-fld-wrp'), // 4 $readonly, // 5 $disabled, // 6 $name, // 7 $req, // 8 $ariaRequired, // 9 $ariaDescribedBy, // 10 $fh->getAtomicCls('phone-hidden-input'), // 11 $fh->disabled(), // 12 $fh->readonly(), // 13 $val, // 14 $fh->getAtomicCls('phone-inner-wrp'), // 15 $dpdWrap, // 16 $fh->getCustomAttributes('phone-number-input'), // 17 $fh->getAtomicCls('phone-number-input'), // 18 $fh->getCustomClasses('phone-number-input'), // 19 $ph, // 20 $tabIndx, // 21 $selectedCountryClearable, // 22 $optionWrap // 23 ); } }