PluginProbe
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) / 1.6.7
Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) v1.6.7
1.8.13.1 1.8.13 1.8.12.3 1.8.12.2 1.8.12.1 1.8.12 1.8.11.3 1.8.11.2 1.8.11.1 1.8.11 1.6.6 1.6.60 1.6.7 1.6.8 1.6.9 1.7.0 1.7.0.1 1.7.0.11 1.7.0.12 1.7.0.14 1.7.0.2 1.7.0.3 1.7.0.5 1.7.0.6 1.7.0.7 All 212 releases
charitable / templates / donation-form / gateway-fields.php

gateway-fields.php in Charitable – Donation & Fundraising Platform (Donation Forms, Recurring Donations & Fundraising Campaigns) 1.6.7, at templates/donation-form/gateway-fields.php

66 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template used to display the gateway fields.
4 *
5 * @author Studio 164a
6 * @package Charitable/Templates/Donation Form
7 * @since 1.0.0
8 * @version 1.0.0
9 */
10
11 // Exit if accessed directly.
12 if ( ! defined( 'ABSPATH' ) ) { exit; }
13
14 if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) {
15 return;
16 }
17
18 $form = $view_args['form'];
19 $field = $view_args['field'];
20 $classes = $view_args['classes'];
21 $gateways = $field['gateways'];
22 $default = isset( $field['default'] ) && isset( $gateways[ $field['default'] ] ) ? $field['default'] : key( $gateways );
23
24 ?>
25 <fieldset id="charitable-gateway-fields" class="charitable-fieldset">
26 <?php
27 if ( isset( $field['legend'] ) ) : ?>
28
29 <div class="charitable-form-header"><?php echo $field['legend'] ?></div>
30
31 <?php
32 endif;
33
34 if ( count( $gateways ) > 1 ) :
35 ?>
36 <fieldset class="charitable-fieldset-field-wrapper">
37 <div class="charitable-fieldset-field-header" id="charitable-gateway-selector-header"><?php _e( 'Choose Your Payment Method', 'charitable' ) ?></div>
38 <ul id="charitable-gateway-selector" class="charitable-radio-list charitable-form-field">
39 <?php foreach ( $gateways as $gateway_id => $details ) : ?>
40 <li><input type="radio"
41 id="gateway-<?php echo esc_attr( $gateway_id ) ?>"
42 name="gateway"
43 value="<?php echo esc_attr( $gateway_id ) ?>"
44 aria-describedby="charitable-gateway-selector-header"
45 <?php checked( $default, $gateway_id ) ?> />
46 <label for="gateway-<?php echo esc_attr( $gateway_id ) ?>"><?php echo $details['label'] ?></label>
47 </li>
48 <?php endforeach ?>
49 </ul>
50 </fieldset>
51 <?php
52 endif;
53
54 foreach ( $gateways as $gateway_id => $details ) :
55
56 if ( ! isset( $details['fields'] ) || empty( $details['fields'] ) ) :
57 continue;
58 endif;
59
60 ?>
61 <div id="charitable-gateway-fields-<?php echo $gateway_id ?>" class="charitable-gateway-fields charitable-form-fields cf" data-gateway="<?php echo $gateway_id ?>">
62 <?php $form->view()->render_fields( $details['fields'] ) ?>
63 </div><!-- #charitable-gateway-fields-<?php echo $gateway_id ?> -->
64 <?php endforeach ?>
65 </fieldset><!-- .charitable-fieldset -->
66