| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
die( 'You are not allowed to call this page directly.' ); |
| 4 |
} |
| 5 |
|
| 6 |
$tabs = array( |
| 7 |
'payments' => array( |
| 8 |
'url' => admin_url( 'admin.php?page=formidable-payments' ), |
| 9 |
'label' => __( 'Payments', 'formidable' ), |
| 10 |
), |
| 11 |
'coupons' => array( |
| 12 |
'url' => admin_url( 'admin.php?page=formidable-payments&action=coupons' ), |
| 13 |
'label' => __( 'Coupons', 'formidable' ), |
| 14 |
), |
| 15 |
); |
| 16 |
?> |
| 17 |
|
| 18 |
<div class="frm-payments-tabs"> |
| 19 |
<div class="frm-payments-tab-filler"></div> |
| 20 |
<?php foreach ( $tabs as $tab_key => $details ) : ?> |
| 21 |
<?php |
| 22 |
$is_active = $tab_key === $active_tab; |
| 23 |
$classes = 'frm-payments-tab'; |
| 24 |
|
| 25 |
if ( $is_active ) { |
| 26 |
$classes .= ' frm-active'; |
| 27 |
} |
| 28 |
?> |
| 29 |
<div class="<?php echo esc_attr( $classes ); ?>"> |
| 30 |
<?php if ( $is_active ) : ?> |
| 31 |
<?php echo esc_html( $details['label'] ); ?> |
| 32 |
<?php else : ?> |
| 33 |
<a href="<?php echo esc_url( $details['url'] ); ?>"> |
| 34 |
<?php echo esc_html( $details['label'] ); ?> |
| 35 |
</a> |
| 36 |
<?php endif; ?> |
| 37 |
</div> |
| 38 |
<?php |
| 39 |
$filler_params = array( |
| 40 |
'class' => 'frm-payments-tab-filler', |
| 41 |
); |
| 42 |
|
| 43 |
if ( 'coupons' === $tab_key ) { |
| 44 |
$filler_params['style'] = 'flex: 1;'; |
| 45 |
} |
| 46 |
?> |
| 47 |
<div <?php FrmAppHelper::array_to_html_params( $filler_params, true ); ?>></div> |
| 48 |
<?php endforeach; ?> |
| 49 |
<div class="frm-payments-settings-button"> |
| 50 |
<a href="<?php echo esc_url( admin_url( 'admin.php?page=formidable-settings&t=stripe_settings' ) ); ?>" class="button button-secondary frm-button"> |
| 51 |
<?php FrmAppHelper::icon_by_class( 'frmfont frm_small_settings_icon' ); ?> |
| 52 |
<?php esc_html_e( 'Payment settings', 'formidable' ); ?> |
| 53 |
</a> |
| 54 |
</div> |
| 55 |
</div> |
| 56 |
|