Plugin Directory

Changeset 1937172


Ignore:
Timestamp:
09/07/2018 02:12:14 AM (8 years ago)
Author:
zaus
Message:

v1.7.8

  • adding per-service delimiter, supports newlines
  • 'add new service' button after metaboxes
  • minor ui fixes
Location:
forms-3rdparty-integration/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • forms-3rdparty-integration/trunk/README.md

    r1909395 r1937172  
    241241
    242242## Changelog ##
     243
     244### 1.7.8 ###
     245* adding per-service delimiter, supports newlines
     246* 'add new service' button after metaboxes
     247* minor ui fixes
    243248
    244249### 1.7.7 ###
  • forms-3rdparty-integration/trunk/forms-3rdparty-integration.php

    r1909395 r1937172  
    66Description: Send plugin Forms Submissions (Gravity, CF7, Ninja Forms, etc) to a 3rd-party URL
    77Author: zaus, atlanticbt, spkane
    8 Version: 1.7.7
     8Version: 1.7.8
    99Author URI: http://drzaus.com
    1010Changelog:
     
    3737    1.7.6 - exposing http method (get/post); result redirection
    3838    1.7.7 - destination mapping is textarea to make other plugins easier, hooks to add more columns
     39    1.7.8 - adding per-service delimiter, supports newlines; 'add new service' button after metaboxes
    3940*/
    4041
     
    536537        $post = array();
    537538
    538         $service['separator'] = $debug['separator']; // alias here for reporting
     539        if(!isset($service['delim']) || empty($service['delim']))
     540            $service['delim'] = $debug['separator']; // alias here for reporting and using default
    539541
    540542        //find mapping
     
    572574
    573575        // fix for multiple values
    574         switch($service['separator']) {
     576        switch($service['delim']) {
    575577            case '[#]':
    576578                // don't do anything to include numerical index (default behavior of `http_build_query`)
     
    586588                break;
    587589            default:
     590                // special case: newlines were escaped
     591                if($service['delim'] == '\\r\\n') $service['delim'] = "\r\n";
     592                elseif($service['delim'] == '\\n') $service['delim'] = "\n";
     593
    588594                // otherwise, find the arrays and implode
    589595                foreach($post as $f => &$v) {
    590596                    ###_log('checking array', $f, $v, is_array($v) ? 'array' : 'notarray');
    591597
    592                     if(is_array($v)) $v = implode($service['separator'], $v);
     598                    if(is_array($v)) $v = implode($service['delim'], $v);
    593599                }
    594600                break;
  • forms-3rdparty-integration/trunk/plugin-ui.php

    r1910098 r1937172  
    170170                    <div class="field">
    171171                        <label for="timeout-<?php echo $eid?>">Request timeout</label>
    172                         <input id="timout-<?php echo $eid?>" type="text" class="text" name="<?php echo $P?>[<?php echo $eid?>][timeout]" value="<?php echo esc_attr($entity['timeout'])?>" />
     172                        <input id="timeout-<?php echo $eid?>" type="text" class="text" name="<?php echo $P?>[<?php echo $eid?>][timeout]" value="<?php echo esc_attr($entity['timeout'])?>" />
    173173                        <em class="description"><?php echo sprintf(__('How long (in seconds) to attempt the 3rd-party remote request before giving up.  Default %d', $P), self::DEFAULT_TIMEOUT);?>.</em>
     174                    </div>
     175
     176                    <div class="field">
     177                        <label for="delim-<?php echo $eid?>">Separator</label>
     178                        <input id="delim-<?php echo $eid?>" type="text" class="text" name="<?php echo $P?>[<?php echo $eid?>][delim]" value="<?php echo esc_attr($entity['delim'])?>" />
     179                        <em class="description"><?php _e('Separator for multiple-mapped fields (i.e. if `fname` and `lname` are mapped to the `name` field, how to separate them).  Uses plugin setting if not defined per-service.', $P);?>.</em>
    174180                    </div>
    175181                </div>
     
    302308            <div class="buttons">
    303309                <input type="submit" id="submit" name="submit" class="button button-primary" value="Save" />
     310
     311                <span class="button"><a href="#" class="actn" data-actn="clone" data-after="metabox" data-target="div.meta-box-sortables div.meta-box:last">Add Another Service</a></span>
    304312            </div>
    305313               
  • forms-3rdparty-integration/trunk/plugin.admin.js

    r1910110 r1937172  
    1212
    1313            var $o = $(this)
    14                 , $target = $o.closest( $o.data('rel') )    //get the target off the link "rel", and find it from the parent-chain
     14                , target = $o.data('target')
     15                , $target = target ? $(target) : $o.closest( $o.data('rel') )   //get the target off the link "rel", and find it from the parent-chain
    1516                , after = $o.data('after')
    1617                , action = $o.data('actn')
     
    6364                $clone.find('tr.fields').slice(1).empty().remove(); // only save the first row
    6465                var $title = $clone.find('h3 span:last');
    65                 $title.html( $title.html().split(':')[0] );
     66                $title.html( $title.html().split(':')[0] )
     67                // and reapply data
     68                    .parent()
     69                    .data('actn', "toggle")
     70                    .data('rel', ".postbox");
    6671
    6772                // toggle hooks appropriately -- since the next call will 'reset' all fields, force collapsed
  • forms-3rdparty-integration/trunk/readme.txt

    r1909395 r1937172  
    234234
    235235== Changelog ==
     236
     237= 1.7.8 =
     238* adding per-service delimiter, supports newlines
     239* 'add new service' button after metaboxes
     240* minor ui fixes
    236241
    237242= 1.7.7 =
Note: See TracChangeset for help on using the changeset viewer.