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 +89 -49 6.29 → trunk View file →
@@ -40,57 +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 ( ! is_array( $field_type ) ) {
48 + continue;
49 + }
47 50
48 - if ( ! empty( $field_type['hide'] ) ) {
49 - $classes .= ' frm_hidden';
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;
50 62 }
51 - ?>
52 - <li class="<?php echo esc_attr( $classes ); ?>" id="<?php echo esc_attr( $field_key ); ?>">
53 - <a href="#" class="frm_add_field" title="<?php echo esc_attr( $field_label ); ?>" role="button" aria-label="<?php echo esc_attr( $field_label ); ?>">
54 - <?php FrmAppHelper::icon_by_class( FrmFormsHelper::get_field_link_icon( $field_type ) ); ?>
55 - <span><?php echo esc_html( $field_label ); ?></span>
56 - <?php
57 - if ( 'credit_card' === $field_key && ! FrmTransLiteAppHelper::payments_table_exists() ) {
58 - FrmAppHelper::show_pill_text();
59 - }
60 - ?>
61 - </a>
62 - </li>
63 - <?php
63 +
64 + $field_type['key'] = $field_key;
65 + FrmFieldsHelper::show_add_field_link( $field_type );
64 66 unset( $field_key, $field_type );
65 67 }//end foreach
66 68 ?>
67 69 </ul>
68 70 <div class="clear"></div>
69 - <?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 +
70 127 <h3 class="frm-with-line">
71 128 <span><?php esc_html_e( 'Advanced Fields', 'formidable' ); ?></span>
72 129 </h3>
73 130 <ul class="field_type_list frm_grid_container">
74 131 <?php
75 - $no_allow_class = apply_filters( 'frm_noallow_class', 'frm_noallow' );
76 -
77 - if ( $no_allow_class === 'frm_noallow' ) {
78 - $no_allow_class .= ' frm_show_upgrade';
79 - }
80 -
81 - $pro_fields = FrmField::pro_field_selection();
82 - // This is a Lite field. It's kept in pro_field_selection for backward compatibility.
83 - unset( $pro_fields['credit_card'] );
84 -
85 - $field_sections = array();
86 -
87 132 foreach ( $pro_fields as $field_key => $field_type ) {
88 133 if ( isset( $field_type['section'] ) ) {
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 134 continue;
94 135 }
95 136
96 137 if ( is_array( $field_type ) && isset( $field_type['switch_from'] ) ) {
@@ -127,23 +168,8 @@
127 168 }//end foreach
128 169 ?>
129 170 </ul>
130 171 <div class="clear"></div>
131 -
132 - <?php foreach ( $field_sections as $section_fields ) { ?>
133 - <h3 class="frm-with-line">
134 - <span><?php esc_html_e( 'Pricing Fields', 'formidable' ); ?></span>
135 - </h3>
136 - <ul class="field_type_list frm_grid_container">
137 - <?php
138 - foreach ( $section_fields as $field_key => $field_type ) {
139 - FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) );
140 - unset( $field_key, $field_type );
141 - }
142 - ?>
143 - </ul>
144 - <div class="clear"></div>
145 - <?php } ?>
146 172 </div>
147 173 <?php do_action( 'frm_extra_form_instructions' ); ?>
148 174 </div>
149 175
@@ -196,8 +222,22 @@
196 222 ?>
197 223 </form>
198 224 </div>
199 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 + ?>
200 240 </div>
201 241 </div>
202 242 </div>
203 243 </div>