PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.16.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.16.1
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / frm-forms / add_field_links.php

add_field_links.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.16.1, at classes/views/frm-forms/add_field_links.php

189 lines 6.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 $classes = 'frmbutton frm6 frm_t' . $field_key;
37 if ( ! empty( $field_type['hide'] ) ) {
38 $classes .= ' frm_hidden';
39 }
40 ?>
41 <li class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $field_key ); ?>">
42 <a href="#" class="frm_add_field frm_animate_bg" title="<?php echo esc_attr( $field_label ); ?>">
43 <?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?>
44 <span><?php echo esc_html( $field_label ); ?></span>
45 <?php
46 if ( 'credit_card' === $field_key && ! FrmTransLiteAppHelper::payments_table_exists() ) {
47 FrmAppHelper::show_pill_text();
48 }
49 ?>
50 </a>
51 </li>
52 <?php
53 unset( $field_key, $field_type );
54 }//end foreach
55 ?>
56 </ul>
57 <div class="clear"></div>
58 <?php FrmTipsHelper::pro_tip( 'get_builder_tip' ); ?>
59 <h3 class="frm-with-line">
60 <span><?php esc_html_e( 'Advanced Fields', 'formidable' ); ?></span>
61 </h3>
62 <ul class="field_type_list frm_grid_container">
63 <?php
64
65 $no_allow_class = apply_filters( 'frm_noallow_class', 'frm_noallow' );
66 if ( $no_allow_class === 'frm_noallow' ) {
67 $no_allow_class .= ' frm_show_upgrade';
68 }
69
70 $pro_fields = FrmField::pro_field_selection();
71 // This is a Lite field. It's kept in pro_field_selection for backward compatibility.
72 unset( $pro_fields['credit_card'] );
73
74 $field_sections = array();
75 foreach ( $pro_fields as $field_key => $field_type ) {
76
77 if ( isset( $field_type['section'] ) ) {
78 if ( ! isset( $field_sections[ $field_type['section'] ] ) ) {
79 $field_sections[ $field_type['section'] ] = array();
80 }
81 $field_sections[ $field_type['section'] ][ $field_key ] = $field_type;
82 continue;
83 }
84
85 if ( is_array( $field_type ) && isset( $field_type['switch_from'] ) ) {
86 continue;
87 }
88
89 if ( is_array( $field_type ) && isset( $field_type['types'] ) ) {
90 _deprecated_argument( 'Field with sub types', '4.0' );
91 $field_label = $field_type['name'];
92
93 ?>
94 <li class="frmbutton frm6 <?php echo esc_attr( $no_allow_class . ' frm_t' . $field_key ); ?> dropdown" id="<?php echo esc_attr( $field_key ); ?>">
95 <a href="#" id="frm-<?php echo esc_attr( $field_key ); ?>Drop" class="frm-dropdown-toggle" data-toggle="dropdown" title="<?php echo esc_attr( $field_label ); ?>">
96 <?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?>
97 <span><?php echo esc_html( $field_label ); ?> <b class="caret"></b></span>
98 </a>
99
100 <ul class="frm-dropdown-menu" role="menu" aria-labelledby="frm-<?php echo esc_attr( $field_key ); ?>Drop">
101 <?php foreach ( $field_type['types'] as $k => $type ) { ?>
102 <li class="frm_t<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>|<?php echo esc_attr( $k ); ?>">
103 <?php echo FrmAppHelper::kses( apply_filters( 'frmpro_field_links', $type, $id, $field_key . '|' . $k ), array( 'a', 'i', 'span' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
104 </li>
105 <?php
106 unset( $k, $type );
107 }
108 ?>
109 </ul>
110 </li>
111 <?php
112 } else {
113 FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) );
114 }//end if
115
116 unset( $field_key, $field_type, $field_label );
117 }//end foreach
118 ?>
119 </ul>
120 <div class="clear"></div>
121
122 <?php foreach ( $field_sections as $section_fields ) { ?>
123 <h3 class="frm-with-line">
124 <span><?php esc_html_e( 'Pricing Fields', 'formidable' ); ?></span>
125 </h3>
126 <ul class="field_type_list frm_grid_container">
127 <?php
128 foreach ( $section_fields as $field_key => $field_type ) {
129 FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) );
130 unset( $field_key, $field_type );
131 }
132 ?>
133 </ul>
134 <div class="clear"></div>
135 <?php } ?>
136 </div>
137 <?php do_action( 'frm_extra_form_instructions' ); ?>
138
139 <div id="frm-options-panel" class="tabs-panel frm_hidden">
140 <div class="frm-single-settings">
141 <div class="frm-embed-field-placeholder">
142 <div class="frm-embed-message">
143 <?php esc_html_e( 'Select a field to see the options', 'formidable' ); ?>
144 </div>
145 </div>
146 </div>
147 <form method="post" id="new_fields">
148 <input type="hidden" name="frm_action" value="update" />
149 <input type="hidden" name="action" value="update" />
150 <input type="hidden" name="id" id="form_id" value="<?php echo esc_attr( $values['id'] ); ?>" />
151 <input type="hidden" name="draft_fields" id="draft_fields" value="<?php echo esc_attr( implode( ',', FrmFieldsHelper::get_all_draft_field_ids( $values['id'] ) ) ); ?>" />
152 <?php wp_nonce_field( 'frm_save_form_nonce', 'frm_save_form' ); ?>
153 <input type="hidden" id="frm-end-form-marker" name="frm_end" value="1" />
154
155 <?php
156 FrmFieldsHelper::inline_modal(
157 array(
158 'title' => __( 'Smart Default Values', 'formidable' ),
159 'callback' => array( 'FrmFieldsHelper', 'smart_values' ),
160 'id' => 'frm-smart-values-box',
161 )
162 );
163
164 FrmFieldsHelper::inline_modal(
165 array(
166 'title' => __( 'Add Layout Classes', 'formidable' ),
167 'callback' => array( 'FrmFieldsHelper', 'layout_classes' ),
168 'id' => 'frm-layout-classes-box',
169 )
170 );
171
172 FrmFieldsHelper::inline_modal(
173 array(
174 'title' => __( 'Input Mask Format', 'formidable' ),
175 'callback' => array( 'FrmFieldsHelper', 'input_mask' ),
176 'id' => 'frm-input-mask-box',
177 )
178 );
179 ?>
180 </form>
181 </div>
182 </div>
183
184 <form method="post" id="frm_js_build_form">
185 <input type="hidden" id="frm_compact_fields" name="frm_compact_fields" value="" />
186 <button class="frm_submit_form frm_submit_<?php echo esc_attr( ! empty( $values['ajax_load'] ) ? '' : 'no_' ); ?>ajax frm_hidden frm_button_submit" type="button" id="frm_submit_side"><?php esc_html_e( 'Update', 'formidable' ); ?></button>
187 </form>
188 </div>
189