| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
?> |
| 6 |
<div class="frm-long-icon-buttons" role="tablist"> |
| 7 |
<?php |
| 8 |
foreach ( $gateways as $gateway_name => $gateway ) { |
| 9 |
$is_active = in_array( $gateway_name, (array) $form_action->post_content['gateway'], true ); |
| 10 |
$name = $gateway['label'] ?? ucfirst( $gateway_name ); |
| 11 |
$gateway_classes = $gateway['recurring'] ? '' : 'frm_gateway_no_recur'; |
| 12 |
|
| 13 |
if ( $form_action->post_content['type'] === 'recurring' && ! $gateway['recurring'] ) { |
| 14 |
$gateway_classes .= ' frm_hidden'; |
| 15 |
} |
| 16 |
|
| 17 |
$toggle_id = "frm_toggle_{$gateway_name}_settings"; |
| 18 |
|
| 19 |
$input_params = array( |
| 20 |
'id' => $toggle_id, |
| 21 |
'type' => 'radio', |
| 22 |
'name' => $action_control->get_field_name( 'gateway' ), |
| 23 |
'value' => $gateway_name, |
| 24 |
); |
| 25 |
|
| 26 |
if ( $is_active ) { |
| 27 |
$input_params['checked'] = 'checked'; |
| 28 |
} |
| 29 |
|
| 30 |
$label_params = array( |
| 31 |
'for' => $toggle_id, |
| 32 |
'class' => trim( 'frm_payment_settings_tab frm_gateway_opt ' . $gateway_classes ), |
| 33 |
'tabindex' => '0', |
| 34 |
'role' => 'tab', |
| 35 |
'aria-selected' => $is_active ? 'true' : 'false', |
| 36 |
); |
| 37 |
?> |
| 38 |
<input <?php FrmAppHelper::array_to_html_params( $input_params, true ); ?> /> |
| 39 |
<label <?php FrmAppHelper::array_to_html_params( $label_params, true ); ?>> |
| 40 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_' . $gateway_name . '_full_icon' ); ?> |
| 41 |
<span class="screen-reader-text"><?php echo esc_html( $name ); ?></span> |
| 42 |
</label> |
| 43 |
<?php |
| 44 |
}//end foreach |
| 45 |
?> |
| 46 |
</div> |
| 47 |
|