forked from aubreypwd-old/gravityforms-firstdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gffd-gfadmin-feed.html.php
93 lines (83 loc) · 3.23 KB
/
gffd-gfadmin-feed.html.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<form action="" method="post" id="gffd-gf-feed-form">
<table class="form-table">
<tbody>
<tr valign="top">
<th scope="row">
<label>Feed Activation</label>
</th>
<td>
<label for="gffd_feed_active">
<input type="checkbox" name="gffd_feed_active" id="gffd_feed_active" <?php
if( gffd_feeds_get_form_feed_settings( gffd_request( 'form_id' ), 'as_object' )->feed_active == 'active' ){
?> checked="checked" <?php
}
?>>
<?php _e( "Use " . gffd_glossary( 'service_name' ) . " to process payments on this form." ); ?>
</label>
<?php if( gffd_feeds_get_form_feed_settings( gffd_request( 'form_id' ), 'as_object' )->feed_active == 'active' ){ ?>
<span class="gffd-feed-tag active">
<?php _e("Currently Active"); ?>
</span>
<?php } else { ?>
<span class="gffd-feed-tag inactive"><?php _e("Currently Inactive"); ?></span>
<?php } ?>
<p class="description">
<?php _e("By checking the option above, you are telling " . gffd_glossary( 'service_name' )
. " to process payments associated with this form."); ?>
</p>
</td>
</tr>
<tr><td colspan="2"><div class="hr-divider"></div></td></tr>
<tr>
<td colspan="2">
<h2 id="gffd_feed_settings_area">Feed</h2>
<p class="description">
<?php _e("The below fields are required to perform a purchase.
Please select the field from your form that will be <em>fed</em>
into " . gffd_glossary( 'service_name' ) . ". " ); ?>
</p>
</td>
</tr>
<tr valign="top" class="gffd_header">
<th scope="row"><strong>Required Field</strong></th>
<td><strong>Where will the data come from?</strong></td>
</tr>
<?php foreach(gffd_is_array(gffd_get_purchase_field_requirements()) as $required_field){ ?>
<tr valign="top">
<th scope="row">
<?php _e($required_field['label']); ?>
</th>
<td>
<select class="feed-dropdown" id="feed-dropdown-<?php echo $required_field['gffd_index']; ?>" name="gffd_form_feed_indexes[<?php echo $required_field['gffd_index']; ?>]" style="width:300px;">
<option value=""><?php _e("Choose a source for this data"); ?></option>
<option value="">--</option>
<?php foreach(gffd_is_array(gffd_get_form_fields(gffd_get_form(gffd_request('form_id')))) as $form_field){ ?>
<option <?php
if(
// The setting is there (may not be)
is_object(
gffd_feeds_get_form_feed_settings(
gffd_request( 'form_id' ),
'as_object'
)->feed_indexes
)
// The setting is already set
&& gffd_feeds_get_form_feed_settings(
gffd_request( 'form_id' ),
'as_object'
)->feed_indexes->$required_field[ 'gffd_index' ] == $form_field[0]
){ ?>
selected="selected"
<?php } ?> value="<?php echo $form_field[0]; ?>"><?php echo $form_field[1]; ?></option>
<?php } ?>
</select><br>
<small class="description"><?php _e($required_field['meta']); ?></small>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<p class="submit">
<input type="submit" name="gffd-feed-admin-edit-submit" id="gffd-feed-admin-edit-submit" class="button-primary" value="<?php _e("Save"); ?>">
</p>
</form>