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(); $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 = htmlentities("data:image/svg+xml,"); $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'), $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( '
%14$s %20$s
%21$s
', $fh->getAtomicCls('phone-fld-container'), $fh->getCustomAttributes('phone-fld-wrp'), $fh->getAtomicCls('phone-fld-wrp'), $fh->getCustomClasses('phone-fld-wrp'), $readonly, $disabled, $name, $req, $fh->getAtomicCls('phone-hidden-input'), $fh->disabled(), $fh->readonly(), $val, $fh->getAtomicCls('phone-inner-wrp'), $dpdWrap, $fh->getCustomAttributes('phone-number-input'), $fh->getAtomicCls('phone-number-input'), $fh->getCustomClasses('phone-number-input'), $ph, $tabIndx, $selectedCountryClearable, $optionWrap ); } }