function gffd_admin_feeds_add_navigation_config($key = null) { $menu = array('name' => 'gffd_feeds', 'label' => __(gffd_glossary('settings_name')), 'callback' => 'gffd_admin_feeds_page'); if ($key) { return $menu[$key]; } else { return $menu; } }
$glossary = array('plugin_name' => "Gravity Forms + First Data Global Gateway e4", 'settings_name' => "First Data Global Gateway", 'service_name' => "First Data Global Gateway"); if (!$key || $key == '') { if ($as_object) { return json_decode(json_encode($glossary)); } else { return $glossary; } } else { if ($as_object) { return json_decode(json_encode($glossary[$key])); } else { return $glossary[$key]; } } } $gffd_glossary = gffd_glossary(false, true); // Convert an array to an object. function gffd_array_as_object($a) { return json_decode(json_encode($a)); } // These are the minimum fields we need to make a purchase. function gffd_get_purchase_field_requirements($as_object_or_gffd_index = false, $as_object = false) { $fields = array(array('gffd_index' => 'gffd_fd_cc_firstname', 'label' => __('Name'), 'meta' => __("Usually called <strong>Credit Card (Cardholder's Name)</strong>"), 'validate_bad_message' => function () { return gffd_language_terms('term_validate_bad_message_most_card_fields'); }, 'validate_pre_format' => function ($value) { if ($value != '') { return $value; } else { return false;
<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.\n\t\t\t\t\t\tPlease select the field from your form that will be <em>fed</em>\n\t\t\t\t\t\tinto " . 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">
<form method="post" action=""> <h3><?php _e(gffd_glossary('plugin_name')); ?> </h3> <table class="form-table"> <?php // Get the settings to interate through. ?> <?php $gffd_admin_settings = gffd_admin_settings(); ?> <?php // There should at lesat be 2 settings. ?> <?php foreach ($gffd_admin_settings as $setting_key => $setting) { ?> <tr valign="top"> <th scope="row"> <?php if (!isset($setting['checkbox_label']) || $setting['checkbox_label'] != true) { ?> <label for="<?php echo $setting_key; ?> "> <?php _e($setting['label']); ?> </label>
function gffd_admin_init() { RGForms::add_settings_page(__(gffd_glossary('settings_name')), 'gffd_admin_page', ''); }
//If a form_id is requested, let's edit that form feed if (gffd_admin_is_requested('form_id')) { // Let's keep the single feed edit HTML // on it's own file. include "gffd-gfadmin-feed.html.php"; // If a form is not selected, show some help // information. } else { ?> <h2><?php _e(gffd_glossary('plugin_name') . " Feed Configuration"); ?> </h2> <p> <?php _e("A form with a configured feed will send it's\n\t\t\t\t\t\t\tdata to the " . gffd_glossary('service_name') . " for processing any payments set up in the form.\n\t\t\t\t\t\t\tIn order to get any form to use the " . gffd_glossary('service_name') . " for payment processing,\n\t\t\t\t\t\t\tyou must configure it's feed to " . gffd_glossary('service_name') . "."); ?> </p> <h3>Configuring a New Feed</h3> <p> <?php _e("To configure a form's feed, just select it from the left.\n\t\t\t\t\t\t\tIf the form already has a feed, it will be under the <strong>active</strong> section.\n\t\t\t\t\t\t\tIf a form is not configured with a feed, you can select it from the <strong>inactive</strong>\n\t\t\t\t\t\t\tsection on the left, and once you configure a feed, it will move to the active section."); ?> </p> <h3>Editing a Form's Current Feed</h3> <p> <?php _e("To edit any configured form's feed, just select the form from the\n\t\t\t\t\t\t\t<strong>active</strong> section to the left to modify it's feed settings."); ?>