| 1 |
<?php |
| 2 |
/** |
| 3 |
* Single product option row in field settings. |
| 4 |
* |
| 5 |
* @package Formidable |
| 6 |
* |
| 7 |
* @var array $field Field data including 'id' and 'separate_value'. |
| 8 |
* @var string $opt_key Option key. |
| 9 |
* @var string $opt Option label. |
| 10 |
* @var string $field_val Saved value for the option. |
| 11 |
* @var string $html_id HTML id prefix for the row. |
| 12 |
* @var string $field_name HTML name attribute for the input. |
| 13 |
* @var string $default_type Input type (radio/checkbox). |
| 14 |
* @var bool $checked Whether the option is checked. |
| 15 |
* @var string $price Product price for the option. |
| 16 |
* @var int $options_count Total number of options. |
| 17 |
*/ |
| 18 |
|
| 19 |
if ( ! defined( 'ABSPATH' ) ) { |
| 20 |
die( 'You are not allowed to call this page directly.' ); |
| 21 |
} |
| 22 |
?> |
| 23 |
<li id="frm_delete_field_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>_container" data-optkey="<?php echo esc_attr( $opt_key ); ?>" class="frm_single_option <?php echo $opt_key === '000' ? 'frm_hidden frm_option_template' : ''; ?>"> |
| 24 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_drag_icon frm-drag' ); ?> |
| 25 |
<input type="<?php echo esc_attr( $default_type ); ?>" name="<?php echo esc_attr( $field_name ); ?>" <?php checked( ! empty( $checked ) ); ?> value="<?php echo esc_attr( $field_val ); ?>"/> |
| 26 |
|
| 27 |
<div class="frm_product_price_wrapper"> |
| 28 |
<input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][label]" value="<?php echo esc_attr( $opt ); ?>" class="field_<?php echo esc_attr( $field['id'] ); ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key ); ?>" data-frmchange="trim,updateOption" placeholder="<?php esc_attr_e( 'Product Name', 'formidable' ); ?>" /> |
| 29 |
<input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][price]" value="<?php echo esc_attr( $price ); ?>" class="field_<?php echo esc_attr( $field['id'] ); ?>_option frm_product_price" placeholder="<?php esc_attr_e( 'Price', 'formidable' ); ?>" data-frmchange="trim" /> |
| 30 |
</div> |
| 31 |
|
| 32 |
<a href="javascript:void(0)" class="frm_remove_tag<?php echo ! empty( $options_count ) && $options_count > 1 ? '' : ' frm_disabled'; ?>" data-fid="<?php echo esc_attr( $field['id'] ); ?>" data-removeid="frm_delete_field_<?php echo esc_attr( $field['id'] . '-' . $opt_key ); ?>_container" data-removemore="#frm_<?php echo esc_attr( $default_type . '_' . $field['id'] . '-' . $opt_key ); ?>" data-showlast="#frm_add_opt_<?php echo esc_attr( $field['id'] ); ?>"> |
| 33 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_minus1_icon frm_svg15' ); ?> |
| 34 |
</a> |
| 35 |
|
| 36 |
<a href="javascript:void(0);" data-opttype="single" class="frm_cb_button frm_add_opt frm_form_field" id="frm_add_opt_<?php echo esc_attr( $field['id'] ); ?>"> |
| 37 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_plus1_icon frm_add_tag frm_svg15' ); ?> |
| 38 |
</a> |
| 39 |
</li> |
| 40 |
|