| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="frm-right-panel"> |
| 7 |
<div class="frm_field_list"> |
| 8 |
<ul id="frm-nav-tabs" class="frm-nav-tabs"> |
| 9 |
<li class="frm-tabs"> |
| 10 |
<a href="#frm-insert-fields" id="frm_insert_fields_tab"> |
| 11 |
<?php esc_html_e( 'Add Fields', 'formidable' ); ?> |
| 12 |
</a> |
| 13 |
</li> |
| 14 |
<li class="hide-if-no-js"> |
| 15 |
<a href="#frm-options-panel" id="frm-options-panel-tab"> |
| 16 |
<?php esc_html_e( 'Field Options', 'formidable' ); ?> |
| 17 |
</a> |
| 18 |
</li> |
| 19 |
<?php do_action( 'frm_extra_form_instruction_tabs' ); ?> |
| 20 |
</ul> |
| 21 |
|
| 22 |
<div id="frm-insert-fields" class="tabs-panel"> |
| 23 |
<?php |
| 24 |
FrmAppHelper::show_search_box( |
| 25 |
array( |
| 26 |
'input_id' => 'field-list', |
| 27 |
'placeholder' => __( 'Search Fields', 'formidable' ), |
| 28 |
'tosearch' => 'frmbutton', |
| 29 |
) |
| 30 |
); |
| 31 |
?> |
| 32 |
<ul class="field_type_list frm_grid_container"> |
| 33 |
<?php |
| 34 |
foreach ( $frm_field_selection as $field_key => $field_type ) { |
| 35 |
$field_label = FrmFormsHelper::get_field_link_name( $field_type ); |
| 36 |
?> |
| 37 |
<li class="frmbutton frm6 <?php echo esc_attr( ' frm_t' . $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>"> |
| 38 |
<a href="#" class="frm_add_field frm_animate_bg" title="<?php echo esc_html( $field_label ); ?>"> |
| 39 |
<?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?> |
| 40 |
<span><?php echo esc_html( $field_label ); ?></span> |
| 41 |
</a> |
| 42 |
</li> |
| 43 |
<?php |
| 44 |
unset( $field_key, $field_type ); |
| 45 |
} |
| 46 |
?> |
| 47 |
</ul> |
| 48 |
<div class="clear"></div> |
| 49 |
<?php FrmTipsHelper::pro_tip( 'get_builder_tip' ); ?> |
| 50 |
<h3 class="frm-with-line"> |
| 51 |
<span><?php esc_html_e( 'Advanced Fields', 'formidable' ); ?></span> |
| 52 |
</h3> |
| 53 |
<ul class="field_type_list frm_grid_container"> |
| 54 |
<?php |
| 55 |
|
| 56 |
$no_allow_class = apply_filters( 'frm_noallow_class', 'frm_noallow' ); |
| 57 |
if ( $no_allow_class === 'frm_noallow' ) { |
| 58 |
$no_allow_class .= ' frm_show_upgrade'; |
| 59 |
} |
| 60 |
|
| 61 |
$pro_fields = FrmField::pro_field_selection(); |
| 62 |
// This is a Lite field. It's kept in pro_field_selection for backward compatibility. |
| 63 |
unset( $pro_fields['credit_card'] ); |
| 64 |
|
| 65 |
$field_sections = array(); |
| 66 |
foreach ( $pro_fields as $field_key => $field_type ) { |
| 67 |
|
| 68 |
if ( isset( $field_type['section'] ) ) { |
| 69 |
if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { |
| 70 |
$field_sections[ $field_type['section'] ] = array(); |
| 71 |
} |
| 72 |
$field_sections[ $field_type['section'] ][ $field_key ] = $field_type; |
| 73 |
continue; |
| 74 |
} |
| 75 |
|
| 76 |
if ( is_array( $field_type ) && isset( $field_type['switch_from'] ) ) { |
| 77 |
continue; |
| 78 |
} |
| 79 |
|
| 80 |
if ( is_array( $field_type ) && isset( $field_type['types'] ) ) { |
| 81 |
_deprecated_argument( 'Field with sub types', '4.0' ); |
| 82 |
$field_label = $field_type['name']; |
| 83 |
|
| 84 |
?> |
| 85 |
<li class="frmbutton frm6 <?php echo esc_attr( $no_allow_class . ' frm_t' . $field_key ); ?> dropdown" id="<?php echo esc_attr( $field_key ); ?>"> |
| 86 |
<a href="#" id="frm-<?php echo esc_attr( $field_key ); ?>Drop" class="frm-dropdown-toggle" data-toggle="dropdown" title="<?php echo esc_html( $field_label ); ?>"> |
| 87 |
<?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?> |
| 88 |
<span><?php echo esc_html( $field_label ); ?> <b class="caret"></b></span> |
| 89 |
</a> |
| 90 |
|
| 91 |
<ul class="frm-dropdown-menu" role="menu" aria-labelledby="frm-<?php echo esc_attr( $field_key ); ?>Drop"> |
| 92 |
<?php foreach ( $field_type['types'] as $k => $type ) { ?> |
| 93 |
<li class="frm_t<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>|<?php echo esc_attr( $k ); ?>"> |
| 94 |
<?php echo FrmAppHelper::kses( apply_filters( 'frmpro_field_links', $type, $id, $field_key . '|' . $k ), array( 'a', 'i', 'span' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> |
| 95 |
</li> |
| 96 |
<?php |
| 97 |
unset( $k, $type ); |
| 98 |
} |
| 99 |
?> |
| 100 |
</ul> |
| 101 |
</li> |
| 102 |
<?php |
| 103 |
} else { |
| 104 |
FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) ); |
| 105 |
}//end if |
| 106 |
|
| 107 |
unset( $field_key, $field_type, $field_label ); |
| 108 |
}//end foreach |
| 109 |
?> |
| 110 |
</ul> |
| 111 |
<div class="clear"></div> |
| 112 |
|
| 113 |
<?php foreach ( $field_sections as $section => $section_fields ) { ?> |
| 114 |
<h3 class="frm-with-line"> |
| 115 |
<span><?php esc_html_e( 'Pricing Fields', 'formidable' ); ?></span> |
| 116 |
</h3> |
| 117 |
<ul class="field_type_list frm_grid_container"> |
| 118 |
<?php |
| 119 |
foreach ( $section_fields as $field_key => $field_type ) { |
| 120 |
FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) ); |
| 121 |
unset( $field_key, $field_type ); |
| 122 |
} |
| 123 |
?> |
| 124 |
</ul> |
| 125 |
<div class="clear"></div> |
| 126 |
<?php } ?> |
| 127 |
</div> |
| 128 |
<?php do_action( 'frm_extra_form_instructions' ); ?> |
| 129 |
|
| 130 |
<div id="frm-options-panel" class="tabs-panel frm_hidden"> |
| 131 |
<div class="frm-single-settings"> |
| 132 |
<div class="frm-embed-field-placeholder"> |
| 133 |
<div class="frm-embed-message"> |
| 134 |
<?php esc_html_e( 'Select a field to see the options', 'formidable' ); ?> |
| 135 |
</div> |
| 136 |
</div> |
| 137 |
</div> |
| 138 |
<form method="post" id="new_fields"> |
| 139 |
<input type="hidden" name="frm_action" value="update" /> |
| 140 |
<input type="hidden" name="action" value="update" /> |
| 141 |
<input type="hidden" name="id" id="form_id" value="<?php echo esc_attr( $values['id'] ); ?>" /> |
| 142 |
<input type="hidden" name="draft_fields" id="draft_fields" value="<?php echo esc_attr( implode( ',', FrmFieldsHelper::get_all_draft_field_ids( $values['id'] ) ) ); ?>" /> |
| 143 |
<?php wp_nonce_field( 'frm_save_form_nonce', 'frm_save_form' ); ?> |
| 144 |
<input type="hidden" id="frm-end-form-marker" name="frm_end" value="1" /> |
| 145 |
|
| 146 |
<?php |
| 147 |
FrmFieldsHelper::inline_modal( |
| 148 |
array( |
| 149 |
'title' => __( 'Smart Default Values', 'formidable' ), |
| 150 |
'callback' => array( 'FrmFieldsHelper', 'smart_values' ), |
| 151 |
'id' => 'frm-smart-values-box', |
| 152 |
) |
| 153 |
); |
| 154 |
|
| 155 |
FrmFieldsHelper::inline_modal( |
| 156 |
array( |
| 157 |
'title' => __( 'Add Layout Classes', 'formidable' ), |
| 158 |
'callback' => array( 'FrmFieldsHelper', 'layout_classes' ), |
| 159 |
'id' => 'frm-layout-classes-box', |
| 160 |
) |
| 161 |
); |
| 162 |
|
| 163 |
FrmFieldsHelper::inline_modal( |
| 164 |
array( |
| 165 |
'title' => __( 'Input Mask Format', 'formidable' ), |
| 166 |
'callback' => array( 'FrmFieldsHelper', 'input_mask' ), |
| 167 |
'id' => 'frm-input-mask-box', |
| 168 |
) |
| 169 |
); |
| 170 |
?> |
| 171 |
</form> |
| 172 |
</div> |
| 173 |
</div> |
| 174 |
|
| 175 |
<form method="post" id="frm_js_build_form"> |
| 176 |
<input type="hidden" id="frm_compact_fields" name="frm_compact_fields" value="" /> |
| 177 |
<button class="frm_submit_form frm_submit_<?php echo esc_attr( ( isset( $values['ajax_load'] ) && $values['ajax_load'] ) ? '' : 'no_' ); ?>ajax frm_hidden frm_button_submit" type="button" id="frm_submit_side"><?php esc_html_e( 'Update', 'formidable' ); ?></button> |
| 178 |
</form> |
| 179 |
</div> |
| 180 |
|