PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
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
← All changes | classes/views/frm-forms/add_field_links.php +92 -50 6.25 → trunk View file →
@@ -6,9 +6,9 @@
6 6 <div class="frm-right-panel frm-settings-panel frm-scrollbar-wrapper">
7 7 <div class="frm_field_list">
8 8 <div class="frm-style-tabs-wrapper">
9 9 <div class="frm-tabs-delimiter">
10 - <span data-initial-width="190" class="frm-tabs-active-underline frm-first"></span>
10 + <span class="frm-tabs-active-underline"></span>
11 11 </div>
12 12
13 13 <div class="frm-tabs-navs">
14 14 <ul class="frm-flex-box">
@@ -40,55 +40,98 @@
40 40 );
41 41 ?>
42 42 <ul class="field_type_list frm_grid_container">
43 43 <?php
44 + $field_sections = array();
45 +
44 46 foreach ( $frm_field_selection as $field_key => $field_type ) {
45 - $field_label = FrmFormsHelper::get_field_link_name( $field_type );
46 - $classes = 'frmbutton frm6 frm_t' . $field_key;
47 - if ( ! empty( $field_type['hide'] ) ) {
48 - $classes .= ' frm_hidden';
47 + if ( ! is_array( $field_type ) ) {
48 + continue;
49 49 }
50 - ?>
51 - <li class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $field_key ); ?>">
52 - <a href="#" class="frm_add_field" title="<?php echo esc_attr( $field_label ); ?>" role="button" aria-label="<?php echo esc_attr( $field_label ); ?>">
53 - <?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?>
54 - <span><?php echo esc_html( $field_label ); ?></span>
55 - <?php
56 - if ( 'credit_card' === $field_key && ! FrmTransLiteAppHelper::payments_table_exists() ) {
57 - FrmAppHelper::show_pill_text();
58 - }
59 - ?>
60 - </a>
61 - </li>
62 - <?php
50 +
51 + // Skip showing field if it's in a section.
52 + if ( isset( $field_type['section'] ) ) {
53 + if ( ! isset( $field_sections[ $field_type['section'] ] ) ) {
54 + $field_sections[ $field_type['section'] ] = array();
55 + }
56 +
57 + // Mark this field as available when showing in later sections.
58 + $field_type['is_available'] = true;
59 +
60 + $field_sections[ $field_type['section'] ][ $field_key ] = $field_type;
61 + continue;
62 + }
63 +
64 + $field_type['key'] = $field_key;
65 + FrmFieldsHelper::show_add_field_link( $field_type );
63 66 unset( $field_key, $field_type );
64 67 }//end foreach
65 68 ?>
66 69 </ul>
67 70 <div class="clear"></div>
68 - <?php FrmTipsHelper::pro_tip( 'get_builder_tip' ); ?>
71 + <?php
72 + FrmTipsHelper::pro_tip( 'get_builder_tip' );
73 +
74 + $no_allow_class = apply_filters( 'frm_noallow_class', 'frm_noallow' );
75 +
76 + if ( $no_allow_class === 'frm_noallow' ) {
77 + $no_allow_class .= ' frm_show_upgrade';
78 + }
79 +
80 + $pro_fields = FrmField::pro_field_selection();
81 +
82 + FrmField::remove_moved_field_types_from_pro( $pro_fields );
83 +
84 + foreach ( $pro_fields as $field_key => $field_type ) {
85 + if ( ! is_array( $field_type ) || ! isset( $field_type['section'] ) ) {
86 + continue;
87 + }
88 +
89 + if ( ! isset( $field_sections[ $field_type['section'] ] ) ) {
90 + $field_sections[ $field_type['section'] ] = array();
91 + }
92 + $field_sections[ $field_type['section'] ][ $field_key ] = $field_type;
93 + }
94 +
95 + $section_labels = FrmField::field_section_labels();
96 +
97 + foreach ( $field_sections as $section => $section_fields ) {
98 + ?>
99 + <h3 class="frm-with-line">
100 + <span><?php echo esc_html( $section_labels[ $section ] ?? ucwords( $section ) ); ?></span>
101 + <span style="padding-left: 0;">
102 + <?php
103 + if ( ! FrmAppHelper::pro_is_installed() ) {
104 + FrmAppHelper::show_pill_text();
105 + }
106 + ?>
107 + </span>
108 + </h3>
109 + <ul class="field_type_list frm_grid_container">
110 + <?php
111 + foreach ( $section_fields as $field_key => $field_type ) {
112 + if ( ! empty( $field_type['is_available'] ) ) {
113 + $field_type['key'] = $field_key;
114 + FrmFieldsHelper::show_add_field_link( $field_type );
115 + } else {
116 + FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) );
117 + }
118 + unset( $field_key, $field_type );
119 + }
120 + ?>
121 + </ul>
122 + <div class="clear"></div>
123 + <?php
124 + }//end foreach
125 + ?>
126 +
69 127 <h3 class="frm-with-line">
70 128 <span><?php esc_html_e( 'Advanced Fields', 'formidable' ); ?></span>
71 129 </h3>
72 130 <ul class="field_type_list frm_grid_container">
73 131 <?php
74 - $no_allow_class = apply_filters( 'frm_noallow_class', 'frm_noallow' );
75 - if ( $no_allow_class === 'frm_noallow' ) {
76 - $no_allow_class .= ' frm_show_upgrade';
77 - }
78 -
79 - $pro_fields = FrmField::pro_field_selection();
80 - // This is a Lite field. It's kept in pro_field_selection for backward compatibility.
81 - unset( $pro_fields['credit_card'] );
82 -
83 - $field_sections = array();
84 132 foreach ( $pro_fields as $field_key => $field_type ) {
85 -
86 133 if ( isset( $field_type['section'] ) ) {
87 - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) {
88 - $field_sections[ $field_type['section'] ] = array();
89 - }
90 - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type;
91 134 continue;
92 135 }
93 136
94 137 if ( is_array( $field_type ) && isset( $field_type['switch_from'] ) ) {
@@ -107,9 +150,9 @@
107 150
108 151 <ul class="frm-dropdown-menu" role="menu" aria-labelledby="frm-<?php echo esc_attr( $field_key ); ?>Drop">
109 152 <?php foreach ( $field_type['types'] as $k => $type ) { ?>
110 153 <li class="frm_t<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>|<?php echo esc_attr( $k ); ?>">
111 - <?php echo FrmAppHelper::kses( apply_filters( 'frmpro_field_links', $type, $id, $field_key . '|' . $k ), array( 'a', 'i', 'span' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
154 + <?php FrmAppHelper::kses_echo( apply_filters( 'frmpro_field_links', $type, $id, $field_key . '|' . $k ), array( 'a', 'i', 'span' ) ); ?>
112 155 </li>
113 156 <?php
114 157 unset( $k, $type );
115 158 }
@@ -125,23 +168,8 @@
125 168 }//end foreach
126 169 ?>
127 170 </ul>
128 171 <div class="clear"></div>
129 -
130 - <?php foreach ( $field_sections as $section_fields ) { ?>
131 - <h3 class="frm-with-line">
132 - <span><?php esc_html_e( 'Pricing Fields', 'formidable' ); ?></span>
133 - </h3>
134 - <ul class="field_type_list frm_grid_container">
135 - <?php
136 - foreach ( $section_fields as $field_key => $field_type ) {
137 - FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) );
138 - unset( $field_key, $field_type );
139 - }
140 - ?>
141 - </ul>
142 - <div class="clear"></div>
143 - <?php } ?>
144 172 </div>
145 173 <?php do_action( 'frm_extra_form_instructions' ); ?>
146 174 </div>
147 175
@@ -194,8 +222,22 @@
194 222 ?>
195 223 </form>
196 224 </div>
197 225 </div>
226 + <?php
227 + if ( isset( $form ) ) {
228 + /**
229 + * Hook in so people can include additional tab content.
230 + * Used along with frm_extra_form_instruction_tabs which is used to
231 + * include the tabs.
232 + *
233 + * @since 6.31
234 + *
235 + * @param stdClass $form The form object.
236 + */
237 + do_action( 'frm_extra_form_instruction_tabs_content', $form );
238 + }
239 + ?>
198 240 </div>
199 241 </div>
200 242 </div>
201 243 </div>