| @@ -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,58 +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 | - | |
| 89 | 133 | if ( isset( $field_type['section'] ) ) { |
| 90 | - if ( ! isset( $field_sections[ $field_type['section'] ] ) ) { | |
| 91 | - $field_sections[ $field_type['section'] ] = array(); | |
| 92 | - } | |
| 93 | - $field_sections[ $field_type['section'] ][ $field_key ] = $field_type; | |
| 94 | 134 | continue; |
| 95 | 135 | } |
| 96 | 136 | |
| 97 | 137 | if ( is_array( $field_type ) && isset( $field_type['switch_from'] ) ) { |
| @@ -110,9 +150,9 @@ | ||
| 110 | 150 | |
| 111 | 151 | <ul class="frm-dropdown-menu" role="menu" aria-labelledby="frm-<?php echo esc_attr( $field_key ); ?>Drop"> |
| 112 | 152 | <?php foreach ( $field_type['types'] as $k => $type ) { ?> |
| 113 | 153 | <li class="frm_t<?php echo esc_attr( $field_key ); ?>" id="<?php echo esc_attr( $field_key ); ?>|<?php echo esc_attr( $k ); ?>"> |
| 114 | - <?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' ) ); ?> | |
| 115 | 155 | </li> |
| 116 | 156 | <?php |
| 117 | 157 | unset( $k, $type ); |
| 118 | 158 | } |
| @@ -128,23 +168,8 @@ | ||
| 128 | 168 | }//end foreach |
| 129 | 169 | ?> |
| 130 | 170 | </ul> |
| 131 | 171 | <div class="clear"></div> |
| 132 | - | |
| 133 | - <?php foreach ( $field_sections as $section_fields ) { ?> | |
| 134 | - <h3 class="frm-with-line"> | |
| 135 | - <span><?php esc_html_e( 'Pricing Fields', 'formidable' ); ?></span> | |
| 136 | - </h3> | |
| 137 | - <ul class="field_type_list frm_grid_container"> | |
| 138 | - <?php | |
| 139 | - foreach ( $section_fields as $field_key => $field_type ) { | |
| 140 | - FrmFieldsHelper::show_add_field_buttons( compact( 'field_key', 'field_type', 'id', 'no_allow_class' ) ); | |
| 141 | - unset( $field_key, $field_type ); | |
| 142 | - } | |
| 143 | - ?> | |
| 144 | - </ul> | |
| 145 | - <div class="clear"></div> | |
| 146 | - <?php } ?> | |
| 147 | 172 | </div> |
| 148 | 173 | <?php do_action( 'frm_extra_form_instructions' ); ?> |
| 149 | 174 | </div> |
| 150 | 175 | |
| @@ -197,8 +222,22 @@ | ||
| 197 | 222 | ?> |
| 198 | 223 | </form> |
| 199 | 224 | </div> |
| 200 | 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 | + ?> | |
| 201 | 240 | </div> |
| 202 | 241 | </div> |
| 203 | 242 | </div> |
| 204 | 243 | </div> |