Contact Form 7 add confirm - Version 4.2.1.1

Version Description

Download this release

Release Info

Developer Yuichiro ABE
Plugin Icon wp plugin Contact Form 7 add confirm
Version 4.2.1.1
Comparing to
See all releases

Code changes from version 4.2.1 to 4.2.1.1

Files changed (4) hide show
  1. contact-form-7-confirm.php +1 -1
  2. modules/back.php +93 -41
  3. modules/confirm.php +96 -45
  4. readme.txt +6 -3
contact-form-7-confirm.php CHANGED
@@ -7,7 +7,7 @@ Author: Yuichiro ABE
7
  Author URI: http://www.eyeta.jp/
8
  Text Domain: contact-form-7-confirm
9
  Domain Path: /languages/
10
- Version: 4.2.1
11
  */
12
 
13
  /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
7
  Author URI: http://www.eyeta.jp/
8
  Text Domain: contact-form-7-confirm
9
  Domain Path: /languages/
10
+ Version: 4.2.1.1
11
  */
12
 
13
  /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
modules/back.php CHANGED
@@ -42,57 +42,109 @@ function wpcf7c_back_shortcode_handler( $tag ) {
42
 
43
  //add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
44
 
45
- if ( is_admin() ) {
46
- add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
47
- }
48
-
49
- function wpcf7c_add_tag_generator_back() {
50
- $tag_generator = WPCF7_TagGenerator::get_instance();
51
- $tag_generator->add( 'back', __( 'Back button', 'contact-form-7-add-confirm' ),
52
- 'wpcf7c_tg_pane_back', array( 'nameless' => 1 ) );
53
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
- function wpcf7c_tg_pane_back( $contact_form, $args = '' ) {
56
- $args = wp_parse_args( $args, array() );
57
-
58
- $description = __( "Generate a form-tag for a back button. For more details, see %s.", 'contact-form-7-add-confirm' );
59
 
60
- $desc_link = wpcf7_link( __( 'http://www.eyeta.jp/archives/908', 'contact-form-7-add-confirm' ), __( 'Back Button', 'contact-form-7-add-confirm' ) );
 
 
61
 
62
- ?>
63
- <div class="control-box">
64
- <fieldset>
65
- <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend>
66
 
67
- <table class="form-table">
68
- <tbody>
 
 
 
69
  <tr>
70
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label></th>
71
- <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /></td>
72
- </tr>
73
 
74
- <tr>
75
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
76
- <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
77
  </tr>
78
 
79
  <tr>
80
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
81
- <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
82
- </tr>
83
-
84
- </tbody>
85
- </table>
86
- </fieldset>
87
- </div>
88
 
89
- <div class="insert-box">
90
- <input type="text" name="back" class="tag code" readonly="readonly" onfocus="this.select()" />
 
91
 
92
- <div class="submitbox">
93
- <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
94
  </div>
95
- </div>
96
- <?php
97
- }
98
 
 
42
 
43
  //add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
44
 
45
+ if(WPCF7_VERSION >= "4.2.0") {
46
+
47
+ if ( is_admin() ) {
48
+ add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
49
+ }
50
+
51
+ function wpcf7c_add_tag_generator_back() {
52
+ $tag_generator = WPCF7_TagGenerator::get_instance();
53
+ $tag_generator->add( 'back', __( 'Back button', 'contact-form-7-add-confirm' ),
54
+ 'wpcf7c_tg_pane_back', array( 'nameless' => 1 ) );
55
+ }
56
+
57
+ function wpcf7c_tg_pane_back( $contact_form, $args = '' ) {
58
+ $args = wp_parse_args( $args, array() );
59
+
60
+ $description = __( "Generate a form-tag for a back button. For more details, see %s.", 'contact-form-7-add-confirm' );
61
+
62
+ $desc_link = wpcf7_link( __( 'http://www.eyeta.jp/archives/908', 'contact-form-7-add-confirm' ), __( 'Back Button', 'contact-form-7-add-confirm' ) );
63
+
64
+ ?>
65
+ <div class="control-box">
66
+ <fieldset>
67
+ <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend>
68
+
69
+ <table class="form-table">
70
+ <tbody>
71
+ <tr>
72
+ <th scope="row"><label
73
+ for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label>
74
+ </th>
75
+ <td><input type="text" name="values" class="oneline"
76
+ id="<?php echo esc_attr( $args['content'] . '-values' ); ?>"/></td>
77
+ </tr>
78
+
79
+ <tr>
80
+ <th scope="row"><label
81
+ for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label>
82
+ </th>
83
+ <td><input type="text" name="id" class="idvalue oneline option"
84
+ id="<?php echo esc_attr( $args['content'] . '-id' ); ?>"/></td>
85
+ </tr>
86
+
87
+ <tr>
88
+ <th scope="row"><label
89
+ for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label>
90
+ </th>
91
+ <td><input type="text" name="class" class="classvalue oneline option"
92
+ id="<?php echo esc_attr( $args['content'] . '-class' ); ?>"/></td>
93
+ </tr>
94
+
95
+ </tbody>
96
+ </table>
97
+ </fieldset>
98
+ </div>
99
+
100
+ <div class="insert-box">
101
+ <input type="text" name="back" class="tag code" readonly="readonly" onfocus="this.select()"/>
102
+
103
+ <div class="submitbox">
104
+ <input type="button" class="button button-primary insert-tag"
105
+ value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>"/>
106
+ </div>
107
+ </div>
108
+ <?php
109
+ }
110
+
111
+ } else {
112
 
113
+ add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
 
 
 
114
 
115
+ function wpcf7c_add_tag_generator_back() {
116
+ if ( ! function_exists( 'wpcf7_add_tag_generator' ) )
117
+ return;
118
 
119
+ wpcf7_add_tag_generator( 'back', __( 'Back button', 'contact-form-7-add-confirm' ),
120
+ 'wpcf7-tg-pane-back', 'wpcf7c_tg_pane_back', array( 'nameless' => 1 ) );
121
+ }
 
122
 
123
+ function wpcf7c_tg_pane_back( $contact_form ) {
124
+ ?>
125
+ <div id="wpcf7-tg-pane-back" class="hidden">
126
+ <form action="">
127
+ <table>
128
  <tr>
129
+ <td><code>id</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
130
+ <input type="text" name="id" class="idvalue oneline option" /></td>
 
131
 
132
+ <td><code>class</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
133
+ <input type="text" name="class" class="classvalue oneline option" /></td>
 
134
  </tr>
135
 
136
  <tr>
137
+ <td><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
138
+ <input type="text" name="values" class="oneline" /></td>
 
 
 
 
 
 
139
 
140
+ <td></td>
141
+ </tr>
142
+ </table>
143
 
144
+ <div class="tg-tag"><?php echo esc_html( __( "Copy this code and paste it into the form left.", 'contact-form-7' ) ); ?><br /><input type="text" name="back" class="tag wp-ui-text-highlight code" readonly="readonly" onfocus="this.select()" /></div>
145
+ </form>
146
  </div>
147
+ <?php
148
+ }
 
149
 
150
+ }
modules/confirm.php CHANGED
@@ -40,59 +40,110 @@ function wpcf7c_confirm_shortcode_handler( $tag ) {
40
 
41
  /* Tag generator */
42
 
43
- if ( is_admin() ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  add_action( 'admin_init', 'wpcf7c_add_tag_generator_confirm', 55 );
45
- }
46
-
47
- function wpcf7c_add_tag_generator_confirm() {
48
- $tag_generator = WPCF7_TagGenerator::get_instance();
49
- $tag_generator->add( 'confirm', __( 'Confirm button', 'contact-form-7-add-confirm' ),
50
- 'wpcf7c_tg_pane_confirm', array( 'nameless' => 1 ) );
51
- }
52
-
53
-
54
- function wpcf7c_tg_pane_confirm( $contact_form, $args = '' ) {
55
- $args = wp_parse_args( $args, array() );
56
-
57
- $description = __( "Generate a form-tag for a back button. For more details, see %s.", 'contact-form-7-add-confirm' );
58
-
59
- $desc_link = wpcf7_link( __( 'http://www.eyeta.jp/archives/908', 'contact-form-7-add-confirm' ), __( 'Back Button', 'contact-form-7-add-confirm' ) );
60
-
61
- ?>
62
- <div class="control-box">
63
- <fieldset>
64
- <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend>
65
 
66
- <table class="form-table">
67
- <tbody>
 
 
 
 
 
 
 
 
 
 
 
68
  <tr>
69
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label></th>
70
- <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /></td>
71
- </tr>
72
 
73
- <tr>
74
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label></th>
75
- <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
76
  </tr>
77
 
78
  <tr>
79
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label></th>
80
- <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
81
- </tr>
82
-
83
- </tbody>
84
- </table>
85
- </fieldset>
86
- </div>
87
 
88
- <div class="insert-box">
89
- <input type="text" name="confirm" class="tag code" readonly="readonly" onfocus="this.select()" />
 
90
 
91
- <div class="submitbox">
92
- <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>" />
93
  </div>
94
- </div>
95
- <?php
96
- }
97
-
98
 
 
40
 
41
  /* Tag generator */
42
 
43
+ if(WPCF7_VERSION >= "4.2.0") {
44
+
45
+ if ( is_admin() ) {
46
+ add_action( 'admin_init', 'wpcf7c_add_tag_generator_confirm', 55 );
47
+ }
48
+
49
+ function wpcf7c_add_tag_generator_confirm() {
50
+ $tag_generator = WPCF7_TagGenerator::get_instance();
51
+ $tag_generator->add( 'confirm', __( 'Confirm button', 'contact-form-7-add-confirm' ),
52
+ 'wpcf7c_tg_pane_confirm', array( 'nameless' => 1 ) );
53
+ }
54
+
55
+
56
+ function wpcf7c_tg_pane_confirm( $contact_form, $args = '' ) {
57
+ $args = wp_parse_args( $args, array() );
58
+
59
+ $description = __( "Generate a form-tag for a back button. For more details, see %s.", 'contact-form-7-add-confirm' );
60
+
61
+ $desc_link = wpcf7_link( __( 'http://www.eyeta.jp/archives/908', 'contact-form-7-add-confirm' ), __( 'Back Button', 'contact-form-7-add-confirm' ) );
62
+
63
+ ?>
64
+ <div class="control-box">
65
+ <fieldset>
66
+ <legend><?php echo sprintf( esc_html( $description ), $desc_link ); ?></legend>
67
+
68
+ <table class="form-table">
69
+ <tbody>
70
+ <tr>
71
+ <th scope="row"><label
72
+ for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?></label>
73
+ </th>
74
+ <td><input type="text" name="values" class="oneline"
75
+ id="<?php echo esc_attr( $args['content'] . '-values' ); ?>"/></td>
76
+ </tr>
77
+
78
+ <tr>
79
+ <th scope="row"><label
80
+ for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'contact-form-7' ) ); ?></label>
81
+ </th>
82
+ <td><input type="text" name="id" class="idvalue oneline option"
83
+ id="<?php echo esc_attr( $args['content'] . '-id' ); ?>"/></td>
84
+ </tr>
85
+
86
+ <tr>
87
+ <th scope="row"><label
88
+ for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'contact-form-7' ) ); ?></label>
89
+ </th>
90
+ <td><input type="text" name="class" class="classvalue oneline option"
91
+ id="<?php echo esc_attr( $args['content'] . '-class' ); ?>"/></td>
92
+ </tr>
93
+
94
+ </tbody>
95
+ </table>
96
+ </fieldset>
97
+ </div>
98
+
99
+ <div class="insert-box">
100
+ <input type="text" name="confirm" class="tag code" readonly="readonly" onfocus="this.select()"/>
101
+
102
+ <div class="submitbox">
103
+ <input type="button" class="button button-primary insert-tag"
104
+ value="<?php echo esc_attr( __( 'Insert Tag', 'contact-form-7' ) ); ?>"/>
105
+ </div>
106
+ </div>
107
+ <?php
108
+ }
109
+
110
+
111
+ } else {
112
  add_action( 'admin_init', 'wpcf7c_add_tag_generator_confirm', 55 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113
 
114
+ function wpcf7c_add_tag_generator_confirm() {
115
+ if ( ! function_exists( 'wpcf7_add_tag_generator' ) )
116
+ return;
117
+ //eyeta_log("wpcf7c_add_tag_generator_confirm");
118
+ wpcf7_add_tag_generator( 'confirm', __( 'Confirm button', 'contact-form-7-add-confirm' ),
119
+ 'wpcf7-tg-pane-confirm', 'wpcf7c_tg_pane_confirm', array( 'nameless' => 1 ) );
120
+ }
121
+
122
+ function wpcf7c_tg_pane_confirm( $contact_form ) {
123
+ ?>
124
+ <div id="wpcf7-tg-pane-confirm" class="hidden">
125
+ <form action="">
126
+ <table>
127
  <tr>
128
+ <td><code>id</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
129
+ <input type="text" name="id" class="idvalue oneline option" /></td>
 
130
 
131
+ <td><code>class</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
132
+ <input type="text" name="class" class="classvalue oneline option" /></td>
 
133
  </tr>
134
 
135
  <tr>
136
+ <td><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
137
+ <input type="text" name="values" class="oneline" /></td>
 
 
 
 
 
 
138
 
139
+ <td></td>
140
+ </tr>
141
+ </table>
142
 
143
+ <div class="tg-tag"><?php echo esc_html( __( "Copy this code and paste it into the form left.", 'contact-form-7' ) ); ?><br /><input type="text" name="confirm" class="tag wp-ui-text-highlight code" readonly="readonly" onfocus="this.select()" /></div>
144
+ </form>
145
  </div>
146
+ <?php
147
+ }
 
 
148
 
149
+ }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link:
4
  Tags: contact, form, contact form
5
  Requires at least: 3.8
6
  Tested up to: 4.2.2
7
- Stable tag: 4.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -113,8 +113,11 @@ An answer to that question.
113
  4.2.1
114
  Contact Form 7 4.2.1に対応
115
 
 
 
 
116
  == Upgrade notice ==
117
 
118
- 4.2.1
119
- Contact Form 7 4.2.1に対応
120
 
4
  Tags: contact, form, contact form
5
  Requires at least: 3.8
6
  Tested up to: 4.2.2
7
+ Stable tag: 4.2.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
113
  4.2.1
114
  Contact Form 7 4.2.1に対応
115
 
116
+ 4.2.1.1
117
+ Contact Form 7 4.2より古いものと実行した場合の不具合を修正
118
+
119
  == Upgrade notice ==
120
 
121
+ 4.2.1.1
122
+ Contact Form 7 4.2より古いものと実行した場合の不具合を修正
123