PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.28
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.28
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 / shared / mb_adv_info.php

mb_adv_info.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.28, at classes/views/shared/mb_adv_info.php

272 lines 7.3 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 id="taxonomy-linkcategory" class="categorydiv <?php echo esc_attr( $class ); ?>">
7 <ul id="frm-nav-tabs" class="frm-nav-tabs <?php echo esc_attr( $settings_tab ? '' : 'frm-compact-nav' ); ?>">
8 <li class="frm-tabs">
9 <a href="#frm-insert-fields-box" id="frm_insert_fields_tab">
10 <?php esc_html_e( 'Fields', 'formidable' ); ?>
11 </a>
12 </li>
13 <?php if ( ! empty( $cond_shortcodes ) ) { ?>
14 <li class="hide-if-no-js">
15 <a href="#frm-conditionals">
16 <?php esc_html_e( 'Conditionals', 'formidable' ); ?>
17 </a>
18 </li>
19 <?php } ?>
20 <li class="hide-if-no-js">
21 <a href="#frm-adv-info-tab">
22 <?php esc_html_e( 'Advanced', 'formidable' ); ?>
23 </a>
24 </li>
25 <?php if ( $settings_tab ) { ?>
26 <li id="frm_html_tab" class="hide-if-no-js frm_hidden">
27 <a href="#frm-html-tags" id="frm_html_tags_tab">
28 <?php esc_html_e( 'HTML Tags', 'formidable' ); ?>
29 </a>
30 </li>
31 <?php } ?>
32 </ul>
33
34 <div id="frm-insert-fields-box" class="tabs-panel">
35 <?php
36 if ( count( $fields ) > 8 ) {
37 echo '<div class="dropdown-item frm-with-search">';
38 FrmAppHelper::show_search_box(
39 array(
40 'input_id' => 'field',
41 'placeholder' => __( 'Search', 'formidable' ),
42 'tosearch' => 'frm-customize-list',
43 )
44 );
45 echo '</div>';
46 }
47 ?>
48
49 <ul class="subsubsub">
50 <li>
51 <a href="javascript:void(0)" class="current frmids"><?php esc_html_e( 'IDs', 'formidable' ); ?></a>
52 <span class="frm-vertical-separator"></span>
53 </li>
54 <li><a href="javascript:void(0)" class="frmkeys"><?php esc_html_e( 'Keys', 'formidable' ); ?></a></li>
55 </ul>
56 <ul class="frm_code_list frm_customize_field_list frm-full-hover">
57 <?php
58 if ( ! empty( $fields ) ) {
59 foreach ( $fields as $f ) {
60 if ( FrmField::is_no_save_field( $f->type ) ) {
61 continue;
62 }
63
64 // phpcs:ignore Universal.Operators.StrictComparisons
65 if ( $f->type === 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] === 'data' || $f->field_options['data_type'] == '' ) ) {
66 continue;
67 }
68
69 FrmFormsHelper::insert_opt_html(
70 array(
71 'id' => $f->id,
72 'key' => $f->field_key,
73 'name' => $f->name,
74 'type' => $f->type,
75 'class' => 'frm-customize-list dropdown-item',
76 )
77 );
78
79 do_action( 'frm_field_code_tab', array( 'field' => $f ) );
80
81 if ( $f->type === 'user_id' ) {
82 $uid = $f->id;
83 }
84 unset( $f );
85 }//end foreach
86 }//end if
87 ?>
88 </ul>
89 </div>
90
91 <?php
92 $show_logic = ! empty( $cond_shortcodes ) && ! empty( $fields );
93
94 if ( $show_logic ) {
95 ?>
96 <div id="frm-conditionals" class="tabs-panel frm-text-grey-700 frm-px-xs">
97 <div class="frm-h-stack-sm">
98 <label class="frm-h-stack-xs" for="frm-id-key-condition-key">
99 <input type="radio" id="frm-id-key-condition-key" name="frm-id-key-condition" value="key">
100 <span><?php esc_html_e( 'Use Keys', 'formidable' ); ?></span>
101 </label>
102 <label class="frm-h-stack-xs" for="frm-id-key-condition-id">
103 <input type="radio" id="frm-id-key-condition-id" name="frm-id-key-condition" value="id" checked>
104 <span><?php esc_html_e( 'Use IDs', 'formidable' ); ?></span>
105 </label>
106 </div>
107
108 <div class="frm_grid_container frm-fields">
109 <div class="frm-pb-xs">
110 <label for="frm-id-condition">
111 <?php esc_html_e( 'IF', 'formidable' ); ?>
112 </label>
113 </div>
114
115 <div class="frm_form_field frm-mt-0">
116 <select id="frm-id-condition" class="frm-build-logic">
117 <option value="x">
118 <?php esc_html_e( 'Select a Field', 'formidable' ); ?>
119 </option>
120 <?php
121 foreach ( $fields as $f ) {
122 FrmHtmlHelper::echo_dropdown_option(
123 $f->name,
124 false,
125 array(
126 'value' => $f->id,
127 )
128 );
129 }
130 ?>
131 </select>
132 <select id="frm-key-condition" class="frm_hidden frm-build-logic">
133 <option value="x">
134 <?php esc_html_e( 'Select a Field', 'formidable' ); ?>
135 </option>
136 <?php
137 foreach ( $fields as $f ) {
138 FrmHtmlHelper::echo_dropdown_option(
139 $f->name,
140 false,
141 array(
142 'value' => $f->field_key,
143 )
144 );
145 }
146 ?>
147 </select>
148 </div>
149
150 <div class="frm_form_field frm-mt-0">
151 <select id="frm-is-condition" class="frm-build-logic">
152 <?php
153 foreach ( $cond_shortcodes as $skey => $sname ) {
154 FrmHtmlHelper::echo_dropdown_option(
155 $sname,
156 false,
157 array(
158 'value' => $skey,
159 )
160 );
161 unset( $skey, $sname );
162 }
163 ?>
164 </select>
165 </div>
166
167 <div class="frm_form_field frm-m-0">
168 <input id="frm-text-condition" type="text" value="" placeholder="<?php esc_attr_e( 'A blank value', 'formidable' ); ?>" class="frm-build-logic" />
169 </div>
170 </div>
171
172 <p class="frm-m-0 frm-pb-xs"><?php esc_html_e( 'Click to Insert', 'formidable' ); ?>:</p>
173 <ul class="frm_code_list frm-full-hover frm-m-0">
174 <li>
175 <a href="#" id="frm-insert-condition" class="frm_insert_code" data-code="if x equals='']<?php esc_attr_e( 'Conditional content here', 'formidable' ); ?>[/if x">
176 [if x equals=""][/if x]
177 </a>
178 </li>
179 </ul>
180 </div>
181 <?php
182 }//end if
183 ?>
184
185 <div id="frm-adv-info-tab" class="tabs-panel">
186 <div class="dropdown-item frm-with-search">
187 <?php
188 FrmAppHelper::show_search_box(
189 array(
190 'input_id' => 'advanced',
191 'placeholder' => __( 'Search', 'formidable' ),
192 'tosearch' => 'frm-advanced-list',
193 )
194 );
195 ?>
196 </div>
197
198 <ul class="frm_code_list frm-full-hover frm-mt-0">
199 <?php
200 $contextual_codes = FrmShortcodeHelper::get_contextual_codes();
201
202 foreach ( $entry_shortcodes as $skey => $sname ) {
203 if ( ! $skey ) {
204 echo '<li class="clear frm_block"></li>';
205 continue;
206 }
207
208 $classes = 'frm-advanced-list';
209 $classes .= in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ), true ) ? ' show_before_content show_after_content' : '';
210 $classes .= str_starts_with( $skey, 'default-' ) ? ' hide_frm_not_email_subject' : '';
211
212 if ( array_key_exists( $skey, $contextual_codes ) ) {
213 $classes .= ' frm_hidden';
214 }
215
216 FrmFormsHelper::insert_code_html(
217 array(
218 'code' => $skey,
219 'label' => $sname,
220 'class' => $classes,
221 )
222 );
223
224 unset( $skey, $sname, $classes );
225 }//end foreach
226
227 foreach ( $advanced_helpers as $helper_type => $helper ) {
228 if ( 'user_id' === $helper_type && ! isset( $uid ) ) {
229 continue;
230 }
231
232 if ( ! empty( $helper['heading'] ) ) {
233 ?>
234 <li style="padding:0 25px;">
235 <p class="howto"><?php echo esc_html( $helper['heading'] ); ?></p>
236 </li>
237 <?php
238 }
239
240 foreach ( $helper['codes'] as $code => $code_label ) {
241 $code = isset( $uid ) ? str_replace( '|user_id|', $uid, $code ) : str_replace( '|user_id|', 'x', $code );
242 $include_x = strpos( $code, ' ' ) ? '' : 'x ';
243
244 if ( ! is_array( $code_label ) ) {
245 $code_label = array(
246 'label' => $code_label,
247 );
248 }
249
250 FrmFormsHelper::insert_code_html(
251 array(
252 'code' => $include_x . $code,
253 'label' => $code_label['label'],
254 'title' => $code_label['title'] ?? '',
255 'class' => 'frm-advanced-list',
256 )
257 );
258
259 unset( $code );
260 }//end foreach
261 }//end foreach
262 ?>
263 </ul>
264 </div>
265
266 <?php
267 if ( $settings_tab ) {
268 include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php';
269 }
270 ?>
271 </div>
272