$field) {
$class = isset($field['class']) ? $field['class'] : '';
?>
$key) ? $value->$key : '';
$default = isset($field['default']) ? $field['default'] : '';
switch ($field['type']) {
case 'text':
echo '
';
break;
case 'textarea':
echo '
';
break;
case 'upload':
$image = $image_class = "";
if ($new_value) {
$image = '
 . ')
';
$image_class = ' hidden';
}
echo '
';
break;
case 'category':
echo '
';
break;
case 'select':
$options = $field['options'];
echo '
';
break;
case 'toggle':
$checkbox_class = ($new_value == 'yes') ? 'ms-toggle-on' : '';
echo '
';
echo '';
echo '
';
if (!empty($label)) {
echo '
' . esc_html($label) . '';
}
if (!empty($description)) {
echo '
' . esc_html($description) . '';
}
break;
case 'colorpicker':
echo '
';
break;
case 'selector':
$options = $field['options'];
echo '
';
foreach ($options as $option => $val) {
$class = ( $new_value == $option ) ? 'selector-selected' : '';
echo '
';
}
echo '
';
echo '
';
break;
case 'radio':
$options = $field['options'];
echo '
';
foreach ($options as $option => $val) {
echo '';
}
echo '
';
echo '
';
break;
case 'switch':
$switch = $field['switch'];
$switch_class = ($new_value == 'on') ? 'switch-on' : '';
echo '
';
echo '
';
echo '
';
echo '
' . esc_html($switch["on"]) . '
';
echo '
';
echo '
';
echo '
' . esc_html($switch["off"]) . '
';
echo '
';
echo '
';
echo '
';
echo '
';
break;
case 'range':
$options = $field['options'];
$new_value = $new_value ? $new_value : $options['val'];
echo '
';
echo '
';
echo '
';
echo '
' . esc_html($options['unit']) . '';
echo '
';
break;
case 'icon':
echo '
';
echo '
';
echo '';
echo '';
echo '
';
echo '
';
echo '
';
echo '';
echo '';
echo '
';
if (apply_filters('bigmart_show_ico_font', true)) {
echo '
';
$bigmart_icofont_icon_array = bigmart_icofont_icon_array();
foreach ($bigmart_icofont_icon_array as $bigmart_icofont_icon) {
$icon_class = $new_value == $bigmart_icofont_icon ? 'icon-active' : '';
echo ' ';
}
echo '
';
}
if (apply_filters('bigmart_show_material_icon', true)) {
echo '
';
$bigmart_materialdesignicons_icon_array = bigmart_materialdesignicons_array();
foreach ($bigmart_materialdesignicons_icon_array as $bigmart_materialdesignicons_icon) {
$icon_class = $new_value == $bigmart_materialdesignicons_icon ? 'icon-active' : '';
echo ' ';
}
echo '
';
}
if (apply_filters('bigmart_show_elegant_icon', true)) {
echo '
';
$bigmart_eleganticons_icon_array = bigmart_eleganticons_array();
foreach ($bigmart_eleganticons_icon_array as $bigmart_eleganticons_icon) {
$icon_class = $new_value == $bigmart_eleganticons_icon ? 'icon-active' : '';
echo ' ';
}
echo '
';
}
echo '
';
echo '
';
echo '
';
break;
case 'multicategory':
$new_value_array = !is_array($new_value) ? explode(',', $new_value) : $new_value;
echo '
';
echo '
';
break;
default:
break;
}
?>