Plugin Directory

Changeset 2963703


Ignore:
Timestamp:
09/06/2023 03:03:35 PM (3 years ago)
Author:
teamgate
Message:

feat: make submit button inherit cf7 submit button behaviour

Location:
teamgate-crm-forms
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • teamgate-crm-forms/tags/1.6.3/readme.txt

    r2963505 r2963703  
    66Requires PHP: 7.4
    77Tested up to: 6.2
    8 Stable tag: 1.6.2
     8Stable tag: 1.6.3
    99License: MIT
    1010License URI: https://www.teamgate.com/terms-of-service/
     
    8080
    8181== Changelog ==
     82**1.6.3**
     83* Make submit button inherit default cf7 button behaviour to avoid compatability issues.
     84
    8285**1.6.2**
    8386* Fix add submit spinner aka. adding default submit handler to submit button of CF7 form.
  • teamgate-crm-forms/tags/1.6.3/teamgate.php

    r2963502 r2963703  
    55    Plugin URI: https://www.teamgate.com
    66    Description: A simple Teamgate CRM plugin to generate new sales opportunities within WordPress. That adds support for Contact Form 7 fields that have teamgate- input name prefix.
    7     Version: 1.6.2
     7    Version: 1.6.3
    88    Author URI: https://www.teamgate.com
    99    License: GPL2
     
    218218function wpcf7_teamgate_submit_shortcode_handler( $tag ) {
    219219    $tag   = new WPCF7_FormTag( $tag );
    220     $class = wpcf7_form_controls_class( $tag->type );
     220    $class = wpcf7_form_controls_class( $tag->type, 'has-spinner' );
    221221    $atts  = array();
     222
     223    $atts['class'] = $tag->get_class_option( $class );
     224    $atts['id'] = $tag->get_id_option();
     225    $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
    222226
    223227    $entry = $tag->get_option( 'entry' );
     
    254258}
    255259
    256 add_action( 'wpcf7_init', function() {
    257     wpcf7_add_form_tag( 'teamgate-submit', 'wpcf7_submit_form_tag_handler' );
    258 }, 10, 0 );
    259 
    260260/** Parameters field for generating tag at backend * */
    261 function wpcf7_tg_pane_teamgate_submit( $contact_form ) {
     261function wpcf7_tg_pane_teamgate_submit( $contact_form, $args = [] ) {
     262    $args = wp_parse_args( $args, [] );
     263
    262264    $description = __( "Generate a form-tag for a Teamgate submit button which call to Teamgate API after submitting the form. Fields must have matching Teamgate API entry type parameters.", 'contact-form-7' );
     265
    263266    $desc_link   = wpcf7_link( '', __( 'Teamgate submit', 'teamgate' ) );
    264267    ?>
     
    269272                <tbody>
    270273                <tr>
    271                     <td colspan="2"><?php echo esc_html( __( 'Button Label', 'teamgate' ) ); ?>
    272                         <font style="font-size:10px"> (optional)</font><br/>
    273                         <input type="text" name="values" class="oneline"/></td>
     274                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label></th>
     275                    <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /></td>
     276                </tr>
     277
     278                <tr>
     279                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
     280                    <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
     281                </tr>
     282
     283                <tr>
     284                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
     285                    <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
    274286                </tr>
    275287                <tr>
    276                     <td colspan="2"><?php echo esc_html( __( 'Teamgate Entry Type', 'teamgate' ) ); ?><br/>
    277                         <select name="types" onchange="document.getElementById('entry').value = this.value;">
     288                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-types' ); ?>"><?php echo esc_html( __( 'Teamgate Entry Type', 'teamgate' ) ); ?></label></th>
     289                    <td>
     290                        <select id="<?php echo esc_attr( $args['content'] . '-types' ); ?>" name="types" onchange="document.getElementById('entry').value = this.value;">
    278291                            <option value="leads">Lead</option>
    279292                            <option value="people">Contact</option>
  • teamgate-crm-forms/trunk/readme.txt

    r2963505 r2963703  
    66Requires PHP: 7.4
    77Tested up to: 6.2
    8 Stable tag: 1.6.2
     8Stable tag: 1.6.3
    99License: MIT
    1010License URI: https://www.teamgate.com/terms-of-service/
     
    8080
    8181== Changelog ==
     82**1.6.3**
     83* Make submit button inherit default cf7 button behaviour to avoid compatability issues.
     84
    8285**1.6.2**
    8386* Fix add submit spinner aka. adding default submit handler to submit button of CF7 form.
  • teamgate-crm-forms/trunk/teamgate.php

    r2963502 r2963703  
    55    Plugin URI: https://www.teamgate.com
    66    Description: A simple Teamgate CRM plugin to generate new sales opportunities within WordPress. That adds support for Contact Form 7 fields that have teamgate- input name prefix.
    7     Version: 1.6.2
     7    Version: 1.6.3
    88    Author URI: https://www.teamgate.com
    99    License: GPL2
     
    218218function wpcf7_teamgate_submit_shortcode_handler( $tag ) {
    219219    $tag   = new WPCF7_FormTag( $tag );
    220     $class = wpcf7_form_controls_class( $tag->type );
     220    $class = wpcf7_form_controls_class( $tag->type, 'has-spinner' );
    221221    $atts  = array();
     222
     223    $atts['class'] = $tag->get_class_option( $class );
     224    $atts['id'] = $tag->get_id_option();
     225    $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
    222226
    223227    $entry = $tag->get_option( 'entry' );
     
    254258}
    255259
    256 add_action( 'wpcf7_init', function() {
    257     wpcf7_add_form_tag( 'teamgate-submit', 'wpcf7_submit_form_tag_handler' );
    258 }, 10, 0 );
    259 
    260260/** Parameters field for generating tag at backend * */
    261 function wpcf7_tg_pane_teamgate_submit( $contact_form ) {
     261function wpcf7_tg_pane_teamgate_submit( $contact_form, $args = [] ) {
     262    $args = wp_parse_args( $args, [] );
     263
    262264    $description = __( "Generate a form-tag for a Teamgate submit button which call to Teamgate API after submitting the form. Fields must have matching Teamgate API entry type parameters.", 'contact-form-7' );
     265
    263266    $desc_link   = wpcf7_link( '', __( 'Teamgate submit', 'teamgate' ) );
    264267    ?>
     
    269272                <tbody>
    270273                <tr>
    271                     <td colspan="2"><?php echo esc_html( __( 'Button Label', 'teamgate' ) ); ?>
    272                         <font style="font-size:10px"> (optional)</font><br/>
    273                         <input type="text" name="values" class="oneline"/></td>
     274                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label></th>
     275                    <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /></td>
     276                </tr>
     277
     278                <tr>
     279                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
     280                    <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
     281                </tr>
     282
     283                <tr>
     284                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
     285                    <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
    274286                </tr>
    275287                <tr>
    276                     <td colspan="2"><?php echo esc_html( __( 'Teamgate Entry Type', 'teamgate' ) ); ?><br/>
    277                         <select name="types" onchange="document.getElementById('entry').value = this.value;">
     288                    <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-types' ); ?>"><?php echo esc_html( __( 'Teamgate Entry Type', 'teamgate' ) ); ?></label></th>
     289                    <td>
     290                        <select id="<?php echo esc_attr( $args['content'] . '-types' ); ?>" name="types" onchange="document.getElementById('entry').value = this.value;">
    278291                            <option value="leads">Lead</option>
    279292                            <option value="people">Contact</option>
Note: See TracChangeset for help on using the changeset viewer.