Contact Form 7 add confirm - Version 4.2.1

Version Description

Download this release

Release Info

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

Code changes from version 4.1.3 to 4.2.1

Files changed (4) hide show
  1. contact-form-7-confirm.php +2 -2
  2. modules/back.php +45 -26
  3. modules/confirm.php +45 -26
  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.1.3
11
  */
12
 
13
  /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
@@ -28,7 +28,7 @@ Version: 4.1.3
28
  */
29
 
30
 
31
- define( 'WPCF7C_VERSION', '4.1.3' );
32
 
33
  if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
34
  define( 'WPCF7C_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
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)
28
  */
29
 
30
 
31
+ define( 'WPCF7C_VERSION', '4.2.1' );
32
 
33
  if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
34
  define( 'WPCF7C_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
modules/back.php CHANGED
@@ -40,39 +40,58 @@ function wpcf7c_back_shortcode_handler( $tag ) {
40
 
41
  /* Tag generator */
42
 
43
- add_action( 'admin_init', 'wpcf7c_add_tag_generator_back', 55 );
44
 
45
- function wpcf7c_add_tag_generator_back() {
46
- if ( ! function_exists( 'wpcf7_add_tag_generator' ) )
47
- return;
48
 
49
- wpcf7_add_tag_generator( 'back', __( 'Back button', 'contact-form-7-add-confirm' ),
50
- 'wpcf7-tg-pane-back', 'wpcf7c_tg_pane_back', array( 'nameless' => 1 ) );
 
 
51
  }
52
 
53
- function wpcf7c_tg_pane_back( $contact_form ) {
 
 
 
 
 
 
54
  ?>
55
- <div id="wpcf7-tg-pane-back" class="hidden">
56
- <form action="">
57
- <table>
58
- <tr>
59
- <td><code>id</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
60
- <input type="text" name="id" class="idvalue oneline option" /></td>
61
-
62
- <td><code>class</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
63
- <input type="text" name="class" class="classvalue oneline option" /></td>
64
- </tr>
65
-
66
- <tr>
67
- <td><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
68
- <input type="text" name="values" class="oneline" /></td>
69
-
70
- <td></td>
71
- </tr>
 
 
 
 
 
72
  </table>
 
 
 
 
 
73
 
74
- <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>
75
- </form>
 
76
  </div>
77
  <?php
78
  }
40
 
41
  /* Tag generator */
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
  }
modules/confirm.php CHANGED
@@ -40,40 +40,59 @@ function wpcf7c_confirm_shortcode_handler( $tag ) {
40
 
41
  /* Tag generator */
42
 
43
- add_action( 'admin_init', 'wpcf7c_add_tag_generator_confirm', 55 );
 
 
44
 
45
  function wpcf7c_add_tag_generator_confirm() {
46
- if ( ! function_exists( 'wpcf7_add_tag_generator' ) )
47
- return;
48
- //eyeta_log("wpcf7c_add_tag_generator_confirm");
49
- wpcf7_add_tag_generator( 'confirm', __( 'Confirm button', 'contact-form-7-add-confirm' ),
50
- 'wpcf7-tg-pane-confirm', 'wpcf7c_tg_pane_confirm', array( 'nameless' => 1 ) );
51
  }
52
 
53
- function wpcf7c_tg_pane_confirm( $contact_form ) {
 
 
 
 
 
 
 
54
  ?>
55
- <div id="wpcf7-tg-pane-confirm" class="hidden">
56
- <form action="">
57
- <table>
58
- <tr>
59
- <td><code>id</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
60
- <input type="text" name="id" class="idvalue oneline option" /></td>
61
-
62
- <td><code>class</code> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
63
- <input type="text" name="class" class="classvalue oneline option" /></td>
64
- </tr>
65
-
66
- <tr>
67
- <td><?php echo esc_html( __( 'Label', 'contact-form-7' ) ); ?> (<?php echo esc_html( __( 'optional', 'contact-form-7' ) ); ?>)<br />
68
- <input type="text" name="values" class="oneline" /></td>
69
-
70
- <td></td>
71
- </tr>
 
 
 
 
 
72
  </table>
 
 
73
 
74
- <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>
75
- </form>
 
 
 
 
76
  </div>
77
  <?php
78
  }
79
 
 
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
+
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.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -110,8 +110,11 @@ An answer to that question.
110
  4.1.3
111
  quizに対応
112
 
 
 
 
113
  == Upgrade notice ==
114
 
115
- 4.1.3
116
- quizに対応
117
 
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
 
110
  4.1.3
111
  quizに対応
112
 
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