Changeset 1897488
- Timestamp:
- 06/23/2018 03:53:51 AM (8 years ago)
- Location:
- forms-3rdparty-integration/trunk
- Files:
-
- 10 edited
-
3rd-parties/mailchimp/functions.mailchimp.php (modified) (4 diffs)
-
3rd-parties/multitouch/functions.multitouch.php (modified) (4 diffs)
-
README.md (modified) (3 diffs)
-
forms-3rdparty-integration.php (modified) (4 diffs)
-
plugin-ui.php (modified) (1 diff)
-
plugins/contactform7.php (modified) (1 diff)
-
plugins/fplugin_base.php (modified) (2 diffs)
-
plugins/gravityforms.php (modified) (1 diff)
-
plugins/ninjaforms.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
forms-3rdparty-integration/trunk/3rd-parties/mailchimp/functions.mailchimp.php
r625080 r1897488 5 5 #region ------------------------------- CUSTOM FUNCTION CALLS --------------------------------- 6 6 7 if(!class_exists(' Cf73rdParty_MailchimpCallbacks')):7 if(!class_exists('Forms3rdpartyIntegration_MailchimpCallbacks')): 8 8 /** 9 9 * Encapsulate any and all 3rd-party service callback functions 10 10 */ 11 class Cf73rdParty_MailchimpCallbacks {11 class Forms3rdpartyIntegration_MailchimpCallbacks { 12 12 public function __construct(){ 13 13 /** newsletter - mailchimp - subscribe **/ … … 15 15 //actions require 2 parameters: 3rd-party response, results placeholders 16 16 ///NOTE: customize this hook name to match your Service (in the admin settings) 17 add_action(' Cf73rdPartyIntegration_service_a5', array(&$this, 'mailchimp_newsletter_action'), 10, 2);17 add_action('Forms3rdpartyIntegrationIntegration_service_a5', array(&$this, 'mailchimp_newsletter_action'), 10, 2); 18 18 19 19 }//-- function __construct … … 23 23 * Callback hook for 3rd-party service Mailchimp - Newsletter signup form 24 24 * @param $response the remote-request response (in this case, it's a serialized string) 25 * @param &$results the callback return results (passed by reference since function can't return a value; also must be "constructed by reference"; see plugin)25 * @param $results the callback return results (kind of passed by reference since function can't return a value; also must be "constructed by reference"; see plugin) 26 26 */ 27 public function mailchimp_newsletter_action($response, &$results){27 public function mailchimp_newsletter_action($response, $results){ 28 28 try{ 29 29 // look once more for success message, in case someone didn't set up the success clause … … 43 43 44 44 45 }//--- class Cf73rdParty_MailchimpCallbacks45 }//--- class Forms3rdpartyIntegration_MailchimpCallbacks 46 46 47 47 //start 'em up 48 $ cf73rdpartycallback_instance = new Cf73rdParty_MailchimpCallbacks();48 $Forms3rdpartyIntegrationcallback_instance = new Forms3rdpartyIntegration_MailchimpCallbacks(); 49 49 endif; //class-exists 50 50 -
forms-3rdparty-integration/trunk/3rd-parties/multitouch/functions.multitouch.php
r625080 r1897488 5 5 #region ------------------------------- CUSTOM FUNCTION CALLS --------------------------------- 6 6 7 if(!class_exists(' Cf73rdPartyCallbacks')):7 if(!class_exists('Forms3rdpartyIntegrationCallbacks')): 8 8 /** 9 9 * Encapsulate any and all 3rd-party service callback functions 10 10 */ 11 class Cf73rdPartyCallbacks {11 class Forms3rdpartyIntegrationCallbacks { 12 12 public function __construct(){ 13 13 //actions require 2 parameters: 3rd-party response, results placeholders 14 add_action(' Cf73rdPartyIntegration_service_a0', array(&$this, 'multitouch1'), 10, 2);14 add_action('Forms3rdpartyIntegrationIntegration_service_a0', array(&$this, 'multitouch1'), 10, 2); 15 15 //filters require 4 parameters: placeholder, value to filter, field, and service array 16 add_filter(' Cf73rdPartyIntegration_service_filter_post_0', array(&$this, 'multitouch1_filter'), 10, 3);16 add_filter('Forms3rdpartyIntegrationIntegration_service_filter_post_0', array(&$this, 'multitouch1_filter'), 10, 3); 17 17 }//-- function __construct 18 18 … … 20 20 * Callback hook for 3rd-party service Multitouch 21 21 * @param $response the remote-request response (in this case, it's a serialized string) 22 * @param &$results the callback return results ( passed by reference since function can't return a value; also must be "constructed by reference"; see plugin)22 * @param &$results the callback return results (kind of passed by reference since function can't return a value; also must be "constructed by reference"; see plugin) 23 23 */ 24 public function multitouch1($response, &$results){24 public function multitouch1($response, $results){ 25 25 try{ 26 26 //unserialize results to append to email … … 107 107 * @param $values array of post values 108 108 * @param $service reference to service detail array 109 * @param $ cf7 reference to Contact Form 7 object109 * @param $form reference to form object/array 110 110 */ 111 public function multitouch1_filter($values, &$service, &$cf7){111 public function multitouch1_filter($values, $service, $form){ 112 112 foreach($values as $field => &$value): 113 113 //filter depending on field … … 129 129 }//-- function multitouch1_filter 130 130 131 }//--- class Cf73rdPartyCallbacks131 }//--- class Forms3rdpartyIntegrationCallbacks 132 132 133 133 //start 'em up 134 $ cf73rdpartycallback_instance = new Cf73rdPartyCallbacks();134 $Forms3rdpartyIntegrationcallback_instance = new Forms3rdpartyIntegrationCallbacks(); 135 135 endif; //class-exists 136 136 -
forms-3rdparty-integration/trunk/README.md
r1755842 r1897488 13 13 **Requires at least:** 3.0 14 14 15 **Tested up to:** 4. 7.215 **Tested up to:** 4.9.6 16 16 17 17 **Stable tag:** trunk … … 105 105 ### How do I make a GET request instead of POST? ### 106 106 107 Since v1.7.6, it's an admin setting for GET and POST, but for anything other than those two that you'd write a hook. 108 107 109 _from http://wordpress.org/support/topic/method-get?replies=2#post-5996489_ 108 110 … … 239 241 240 242 ## Changelog ## 243 244 ### 1.7.6 ### 245 * exposing http method (get/post); result redirection 246 247 ### 1.7.5 ### 248 * late-bind GF confirmation for script tags 241 249 242 250 ### 1.7.4 ### -
forms-3rdparty-integration/trunk/forms-3rdparty-integration.php
r1890883 r1897488 6 6 Description: Send plugin Forms Submissions (Gravity, CF7, Ninja Forms, etc) to a 3rd-party URL 7 7 Author: zaus, atlanticbt, spkane 8 Version: 1.7. 58 Version: 1.7.6 9 9 Author URI: http://drzaus.com 10 10 Changelog: … … 35 35 1.7.4 - another slight fix to make GF Resend do submission hooks too (so Reformat will work with it as well) 36 36 1.7.5 - late-bind GF confirmation for script tags 37 1.7.6 - exposing http method (get/post); result redirection 37 38 */ 38 39 … … 617 618 //@see http://planetozh.com/blog/2009/08/how-to-make-http-requests-with-wordpress/ 618 619 619 $response = wp_remote_post(620 620 // allow hooks to modify the URL with submission, like send as url-encoded XML, etc 621 apply_filters($this->N('service_filter_url'), $service['url'], $post_args), 622 $post_args 623 ); 621 $url = apply_filters($this->N('service_filter_url'), $service['url'], $post_args); 622 623 $response = isset($service['method']) && $service['method'] == 'get' 624 ? wp_remote_get($url, $post_args) 625 : wp_remote_post($url, $post_args) 626 ; 624 627 } 625 628 … … 677 680 //hack for pass-by-reference 678 681 //holder for callback return results 679 $callback_results = array('success'=>false, 'errors'=>false, 'attach'=>'', 'message' => '' );682 $callback_results = array('success'=>false, 'errors'=>false, 'attach'=>'', 'message' => '', 'redirect' => ''); 680 683 // TODO: use object? 681 684 $param_ref = array(); foreach($callback_results as $k => &$v){ $param_ref[$k] = &$v; } -
forms-3rdparty-integration/trunk/plugin-ui.php
r1517065 r1897488 131 131 </div> 132 132 133 <div class="field"> 134 <?php 135 $methods = apply_filters($this->N('submit_methods'), array( 136 'post' => 'Post', 137 'get' => 'Get' 138 ), $eid, $P, $entity); 139 if(empty($entity['method'])) $entity['method'] = 'post'; 140 foreach($methods as $mkey => $mlabel): 141 ?> 142 <input id="mthd-<?php echo $mkey, $eid?>" type="radio" class="radio" name="<?php echo $P?>[<?php echo $eid?>][method]" value="<?php echo esc_attr($mkey)?>" <?php checked($entity['method'], $mkey) ?> /> 143 <label for="mthd-<?php echo $mkey, $eid?>">Submit as <?php _e($mlabel, $P) ?></label> 144 <?php endforeach; ?> 145 <em class="description"><?php _e('How to submit the request.', $P);?></em> 146 </div> 133 147 134 148 <div class="field"> -
forms-3rdparty-integration/trunk/plugins/contactform7.php
r1651476 r1897488 142 142 143 143 /** 144 * How to update the confirmation redirect for a successful result 145 * @param $form the form "object" 146 * @param $redirect the url to redirect to 147 * @return $form, altered to contain the message 148 */ 149 protected function SET_OKAY_REDIRECT($form, $redirect) { 150 $messages = $form->prop('messages'); 151 $url = esc_url_raw( $redirect ); 152 $messages['mail_sent_ok'] .= "<script type=\"text/javascript\">window.open('$url', '_blank');</script>"; 153 $form->set_properties(array('messages'=>$messages)); 154 155 return $form; 156 } 157 158 159 /** 144 160 * Fetch the original error message for the form 145 161 */ -
forms-3rdparty-integration/trunk/plugins/fplugin_base.php
r1610285 r1897488 94 94 95 95 /** 96 * How to update the confirmation redirect for a successful result 97 * @param $form the form "object" 98 * @param $redirect the url to redirect to 99 * @return $form, altered to contain the message 100 */ 101 abstract protected function SET_OKAY_REDIRECT($form, $redirect); 102 103 /** 96 104 * How to update the confirmation message for a failure/error 97 105 * @param $form the form "object" … … 259 267 } 260 268 269 //if requested, attach redirect to success notification 270 if( !empty($callback_results['redirect']) ) { 271 $form = $this->SET_OKAY_REDIRECT($form, $callback_results['redirect']); 272 } 273 261 274 ###_log(__FUNCTION__, $form); 262 275 -
forms-3rdparty-integration/trunk/plugins/gravityforms.php
r1890883 r1897488 202 202 203 203 /** 204 * How to update the confirmation redirect for a successful result 205 * @param $form the form "object" 206 * @param $redirect the url to redirect to 207 * @return $form, altered to contain the message 208 */ 209 protected function SET_OKAY_REDIRECT($form, $redirect) { 210 // https://docs.gravityforms.com/gform_confirmation/#4-open-the-page-or-redirect-in-a-new-tab 211 212 add_filter( 'gform_confirmation', array(&$this, 'gform_confirmation'), 10, 4 ); 213 214 return $form; 215 } 216 217 public function gform_confirmation($confirmation, $form, $entry, $ajax) { 218 if ( isset( $confirmation['redirect'] ) ) { 219 $url = esc_url_raw( $redirect ); 220 $confirmation .= "<script type=\"text/javascript\">window.open('$url', '_blank');</script>"; 221 } 222 223 return $confirmation; 224 } 225 226 /** 204 227 * Fetch the original error message for the form 205 228 */ -
forms-3rdparty-integration/trunk/plugins/ninjaforms.php
r1624462 r1897488 134 134 135 135 /** 136 * How to update the confirmation redirect for a successful result 137 * @param $form the form "object" 138 * @param $redirect the url to redirect to 139 * @return $form, altered to contain the message 140 */ 141 protected function SET_OKAY_REDIRECT($form, $redirect) { 142 $setting = 'success_msg'; 143 $message = $form->get_form_setting($setting); 144 $url = esc_url_raw( $redirect ); 145 $message .= "<script type=\"text/javascript\">window.open('$url', '_blank');</script>"; 146 $form->update_form_setting($setting, wpautop($message)); 147 148 return $form; // just to match expectation 149 } 150 151 152 /** 136 153 * How to update the confirmation message for a failure/error 137 154 * @param $form the form "object" -
forms-3rdparty-integration/trunk/readme.txt
r1755842 r1897488 4 4 Tags: contact form, form, contact form 7, CF7, gravity forms, GF, CRM, mapping, 3rd-party service, services, remote request 5 5 Requires at least: 3.0 6 Tested up to: 4. 7.26 Tested up to: 4.9.6 7 7 Stable tag: trunk 8 8 License: GPLv2 or later … … 97 97 = How do I make a GET request instead of POST? = 98 98 99 Since v1.7.6, it's an admin setting for GET and POST, but for anything other than those two that you'd write a hook. 100 99 101 _from http://wordpress.org/support/topic/method-get?replies=2#post-5996489_ 100 102 … … 233 235 == Changelog == 234 236 237 = 1.7.6 = 238 * exposing http method (get/post); result redirection 239 240 = 1.7.5 = 241 * late-bind GF confirmation for script tags 242 235 243 = 1.7.4 = 236 244 * another slight fix to make GF Resend do submission hooks too (so Reformat will work with it as well) … … 238 246 = 1.7.3 = 239 247 * slight refactor of `before_send` to make reposting GF submissions easier 240 241 248 242 249 = 1.7.2.1 =
Note: See TracChangeset
for help on using the changeset viewer.