PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.32.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.32.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 / frm-settings / payments.php

payments.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.32.1, at classes/views/frm-settings/payments.php

85 lines 2.5 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 ?>
7 <p>
8 <?php esc_html_e( 'Configure and manage your payment gateways in one place to control transactions, settings, and more.', 'formidable' ); ?>
9 </p>
10 <?php
11
12 echo '<div class="frm-long-icon-buttons" role="tablist">';
13
14 foreach ( $payment_sections as $key => $section ) {
15 $is_active = $tab === $key;
16 $name = $section['name'] ?? ucfirst( $key );
17 $input_params = array(
18 'id' => "frm_toggle_{$key}_settings",
19 'type' => 'radio',
20 'name' => 'frm_payment_section',
21 'value' => $key,
22 'data-frmshow' => "#frm_{$key}_settings_section",
23 );
24
25 if ( $is_active ) {
26 $input_params['checked'] = 'checked';
27 }
28
29 $other_section_selectors = array_map(
30 function ( $section ) {
31 return "#frm_{$section}_settings_section";
32 },
33 array_diff( array_keys( $payment_sections ), array( $key ) )
34 );
35 $input_params['data-frmhide'] = implode( ',', $other_section_selectors );
36
37 $label_params = array(
38 'for' => "frm_toggle_{$key}_settings",
39 'class' => 'frm_payment_settings_tab',
40 'tabindex' => '0',
41 'role' => 'tab',
42 'aria-selected' => $is_active ? 'true' : 'false',
43 );
44 ?>
45 <input <?php FrmAppHelper::array_to_html_params( $input_params, true ); ?> />
46 <label <?php FrmAppHelper::array_to_html_params( $label_params, true ); ?>>
47 <?php FrmAppHelper::icon_by_class( 'frmfont frm_' . $key . '_full_icon' ); ?>
48 <span class="screen-reader-text"><?php echo esc_html( $name ); ?></span>
49 </label>
50 <?php
51 }//end foreach
52 echo '</div>';
53
54 foreach ( $payment_sections as $key => $section ) {
55 $is_active = $tab === $key;
56 $name = $section['name'] ?? ucfirst( $key );
57 $section_classes = 'frm_payments_section';
58
59 // Exclude Authorize.Net as the h3 tag is added explicitly.
60 $include_h3 = 'authorize_net' !== $key;
61
62 if ( ! $is_active ) {
63 $section_classes .= ' frm_hidden';
64 }
65 ?>
66 <div id="frm_<?php echo esc_attr( $key ); ?>_settings_section" class="<?php echo esc_attr( $section_classes ); ?>" role="tabpanel">
67 <?php if ( $include_h3 ) { ?>
68 <h3 style="margin-bottom: 0;">
69 <?php
70 // translators: %s is the payment gateway name
71 printf( '%s Settings', esc_html( $name ) );
72 ?>
73 </h3>
74 <?php } ?>
75 <?php
76 if ( isset( $section['class'] ) ) {
77 call_user_func( array( $section['class'], $section['function'] ) );
78 } else {
79 call_user_func( $section['function'] ?? $section );
80 }
81 ?>
82 </div>
83 <?php
84 }//end foreach
85