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

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

273 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 if ( $f->type === 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] === 'data' || $f->field_options['data_type'] == '' ) ) {
65 continue;
66 }
67
68 FrmFormsHelper::insert_opt_html(
69 array(
70 'id' => $f->id,
71 'key' => $f->field_key,
72 'name' => $f->name,
73 'type' => $f->type,
74 'class' => 'frm-customize-list dropdown-item',
75 )
76 );
77
78 do_action( 'frm_field_code_tab', array( 'field' => $f ) );
79
80 if ( $f->type === 'user_id' ) {
81 $uid = $f->id;
82 }
83 unset( $f );
84 }//end foreach
85 }//end if
86 ?>
87 </ul>
88 </div>
89
90 <?php
91 $show_logic = ! empty( $cond_shortcodes ) && ! empty( $fields );
92 if ( $show_logic ) {
93 ?>
94 <div id="frm-conditionals" class="tabs-panel frm-text-grey-700 frm-px-xs">
95 <div class="frm-h-stack-sm">
96 <label class="frm-h-stack-xs" for="frm-id-key-condition-key">
97 <input type="radio" id="frm-id-key-condition-key" name="frm-id-key-condition" value="key">
98 <span><?php esc_html_e( 'Use Keys', 'formidable' ); ?></span>
99 </label>
100 <label class="frm-h-stack-xs" for="frm-id-key-condition-id">
101 <input type="radio" id="frm-id-key-condition-id" name="frm-id-key-condition" value="id" checked>
102 <span><?php esc_html_e( 'Use IDs', 'formidable' ); ?></span>
103 </label>
104 </div>
105
106 <div class="frm_grid_container frm-fields">
107 <div class="frm-pb-xs">
108 <label for="frm-id-condition">
109 <?php esc_html_e( 'IF', 'formidable' ); ?>
110 </label>
111 </div>
112
113 <div class="frm_form_field frm-mt-0">
114 <select id="frm-id-condition" class="frm-build-logic">
115 <option value="x">
116 <?php esc_html_e( 'Select a Field', 'formidable' ); ?>
117 </option>
118 <?php
119 foreach ( $fields as $f ) {
120 FrmHtmlHelper::echo_dropdown_option(
121 $f->name,
122 false,
123 array(
124 'value' => $f->id,
125 )
126 );
127 }
128 ?>
129 </select>
130 <select id="frm-key-condition" class="frm_hidden frm-build-logic">
131 <option value="x">
132 <?php esc_html_e( 'Select a Field', 'formidable' ); ?>
133 </option>
134 <?php
135 foreach ( $fields as $f ) {
136 FrmHtmlHelper::echo_dropdown_option(
137 $f->name,
138 false,
139 array(
140 'value' => $f->field_key,
141 )
142 );
143 }
144 ?>
145 </select>
146 </div>
147
148 <div class="frm_form_field frm-mt-0">
149 <select id="frm-is-condition" class="frm-build-logic">
150 <?php
151 foreach ( $cond_shortcodes as $skey => $sname ) {
152 FrmHtmlHelper::echo_dropdown_option(
153 $sname,
154 false,
155 array(
156 'value' => $skey,
157 )
158 );
159 unset( $skey, $sname );
160 }
161 ?>
162 </select>
163 </div>
164
165 <div class="frm_form_field frm-m-0">
166 <input id="frm-text-condition" type="text" value="" placeholder="<?php esc_attr_e( 'A blank value', 'formidable' ); ?>" class="frm-build-logic" />
167 </div>
168 </div>
169
170 <p class="frm-m-0 frm-pb-xs"><?php esc_html_e( 'Click to Insert', 'formidable' ); ?>:</p>
171 <ul class="frm_code_list frm-full-hover frm-m-0">
172 <li>
173 <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">
174 [if x equals=""][/if x]
175 </a>
176 </li>
177 </ul>
178 </div>
179 <?php
180 }//end if
181 ?>
182
183 <div id="frm-adv-info-tab" class="tabs-panel">
184 <div class="dropdown-item frm-with-search">
185 <?php
186 FrmAppHelper::show_search_box(
187 array(
188 'input_id' => 'advanced',
189 'placeholder' => __( 'Search', 'formidable' ),
190 'tosearch' => 'frm-advanced-list',
191 )
192 );
193 ?>
194 </div>
195
196 <ul class="frm_code_list frm-full-hover frm-mt-0">
197 <?php
198 $contextual_codes = FrmShortcodeHelper::get_contextual_codes();
199 foreach ( $entry_shortcodes as $skey => $sname ) {
200 if ( ! $skey ) {
201 echo '<li class="clear frm_block"></li>';
202 continue;
203 }
204
205 $classes = 'frm-advanced-list';
206 $classes .= in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ), true ) ? ' show_before_content show_after_content' : '';
207 $classes .= strpos( $skey, 'default-' ) === 0 ? ' hide_frm_not_email_subject' : '';
208
209 if ( in_array( $skey, array_keys( $contextual_codes ), true ) ) {
210 $classes .= ' frm_hidden';
211 }
212
213 FrmFormsHelper::insert_code_html(
214 array(
215 'code' => $skey,
216 'label' => $sname,
217 'class' => $classes,
218 )
219 );
220
221 unset( $skey, $sname, $classes );
222 }//end foreach
223
224 foreach ( $advanced_helpers as $helper_type => $helper ) {
225 if ( 'user_id' === $helper_type && ! isset( $uid ) ) {
226 continue;
227 }
228
229 if ( ! empty( $helper['heading'] ) ) {
230 ?>
231 <li style="padding:0 25px;">
232 <p class="howto"><?php echo esc_html( $helper['heading'] ); ?></p>
233 </li>
234 <?php
235 }
236
237 foreach ( $helper['codes'] as $code => $code_label ) {
238 if ( isset( $uid ) ) {
239 $code = str_replace( '|user_id|', $uid, $code );
240 } else {
241 $code = str_replace( '|user_id|', 'x', $code );
242 }
243 $include_x = strpos( $code, ' ' ) ? '' : 'x ';
244
245 if ( ! is_array( $code_label ) ) {
246 $code_label = array(
247 'label' => $code_label,
248 );
249 }
250
251 FrmFormsHelper::insert_code_html(
252 array(
253 'code' => $include_x . $code,
254 'label' => $code_label['label'],
255 'title' => isset( $code_label['title'] ) ? $code_label['title'] : '',
256 'class' => 'frm-advanced-list',
257 )
258 );
259
260 unset( $code );
261 }//end foreach
262 }//end foreach
263 ?>
264 </ul>
265 </div>
266
267 <?php
268 if ( $settings_tab ) {
269 include FrmAppHelper::plugin_path() . '/classes/views/frm-forms/mb_html_tab.php';
270 }
271 ?>
272 </div>
273