Contact Form 7 add confirm - Version 1.3.9.6

Version Description

Download this release

Release Info

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

Code changes from version 1.3.9.5 to 1.3.9.6

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: 1.3.9.5
11
  */
12
 
13
  /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
@@ -44,7 +44,7 @@ Version: 1.3.9.5
44
   戻って編集ボタンのデフォルトテキストが英語だった件を修正
45
  以降、readme.txtに記述
46
  */
47
- define( 'WPCF7C_VERSION', '1.3.9.5' );
48
 
49
  if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
50
  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: 1.3.9.6
11
  */
12
 
13
  /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
44
   戻って編集ボタンのデフォルトテキストが英語だった件を修正
45
  以降、readme.txtに記述
46
  */
47
+ define( 'WPCF7C_VERSION', '1.3.9.6' );
48
 
49
  if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
50
  define( 'WPCF7C_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
includes/controller.php CHANGED
@@ -44,7 +44,7 @@ function wpcf7c_ajax_json_echo() {
44
  global $wp_filter, $merged_filters;
45
 
46
  //error_log(print_r($wp_filter, true));
47
- if($wp_filter["wpcf7_before_send_mail"]) {
48
  foreach($wp_filter["wpcf7_before_send_mail"] as $priority => $actions) {
49
  foreach($actions as $key => $action) {
50
  if(is_array($action["function"])) {
44
  global $wp_filter, $merged_filters;
45
 
46
  //error_log(print_r($wp_filter, true));
47
+ if(isset($wp_filter["wpcf7_before_send_mail"])) {
48
  foreach($wp_filter["wpcf7_before_send_mail"] as $priority => $actions) {
49
  foreach($actions as $key => $action) {
50
  if(is_array($action["function"])) {
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.0
7
- Stable tag: 1.3.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -91,7 +91,8 @@ An answer to that question.
91
  1.3.9.4
92
  Contact Form DB 2.8.2以上に対応
93
 
94
-
95
- == Upgrade notice ==
96
  1.3.9.5
97
- バグFIXデバックログ出力が残っていたものを削除
 
 
 
4
  Tags: contact, form, contact form
5
  Requires at least: 3.8
6
  Tested up to: 4.0
7
+ Stable tag: 1.3.9.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
91
  1.3.9.4
92
  Contact Form DB 2.8.2以上に対応
93
 
 
 
94
  1.3.9.5
95
+ バグFIXデバックログ出力が残っていたものを削除
96
+ == Upgrade notice ==
97
+ 1.3.9.6
98
+ Noticeが出ていた箇所を修正
trunk/contact-form-7-confirm.php DELETED
@@ -1,67 +0,0 @@
1
- <?php
2
- /*
3
- Plugin Name: Contact Form 7 add confirm
4
- Plugin URI: http://www.eyeta.jp/archives/908
5
- Description: Add confirm step to contact form 7
6
- Author: Yuichiro ABE
7
- Author URI: http://www.eyeta.jp/
8
- Text Domain: contact-form-7-confirm
9
- Domain Path: /languages/
10
- Version: 1.3.9.5
11
- */
12
-
13
- /* Copyright 2014- Yuichiro ABE (email: y.abe at eyeta.jp)
14
-
15
- This program is free software; you can redistribute it and/or modify
16
- it under the terms of the GNU General Public License as published by
17
- the Free Software Foundation; either version 2 of the License, or
18
- (at your option) any later version.
19
-
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
-
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
- */
29
-
30
- /*
31
-
32
- 1.3.7
33
-  Contact Form 7 3.7 で構築
34
- 1.3.7.1
35
-  input type="file"の不具合を修正
36
- 1.3.8
37
-  編集に戻るときも頭出し
38
-  Contact Form 7 3.7.2で動作確認
39
- 1.3.8.1
40
-  checkboxでのバグの修正
41
-  「wpcf7c-anchor」クラスを指定しておくと確認、戻るなどの際の
42
-   頭出しの座標に利用されるようにしました。
43
- 1.3.8.3
44
-  戻って編集ボタンのデフォルトテキストが英語だった件を修正
45
- 以降、readme.txtに記述
46
- */
47
- define( 'WPCF7C_VERSION', '1.3.9.5' );
48
-
49
- if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
50
- define( 'WPCF7C_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
51
-
52
- if ( ! defined( 'WPCF7C_PLUGIN_NAME' ) )
53
- define( 'WPCF7C_PLUGIN_NAME', trim( dirname( WPCF7C_PLUGIN_BASENAME ), '/' ) );
54
-
55
- if ( ! defined( 'WPCF7C_PLUGIN_DIR' ) )
56
- define( 'WPCF7C_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
57
-
58
- if ( ! defined( 'WPCF7C_PLUGIN_URL' ) )
59
- define( 'WPCF7C_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
60
-
61
- if ( ! defined( 'WPCF7C_PLUGIN_MODULES_DIR' ) )
62
- define( 'WPCF7C_PLUGIN_MODULES_DIR', WPCF7C_PLUGIN_DIR . '/modules' );
63
-
64
-
65
-
66
- require_once WPCF7C_PLUGIN_DIR . '/settings.php';
67
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/controller.php DELETED
@@ -1,217 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- *
5
- * Created by PhpStorm.
6
- * Author: Eyeta Co.,Ltd.(http://www.eyeta.jp)
7
- *
8
- */
9
-
10
-
11
- add_action( 'init', 'wpcf7c_control_init', 10 );
12
- function wpcf7c_control_init() {
13
-
14
- wpcf7c_ajax_json_echo();
15
-
16
- // キャプチャ用フックの差替え
17
- remove_filter( 'wpcf7_validate_captchar', 'wpcf7_captcha_validation_filter', 10 );
18
- add_filter( 'wpcf7_validate_captchar', 'wpcf7c_captcha_validation_filter', 10, 2 );
19
-
20
- }
21
-
22
-
23
- function wpcf7c_ajax_json_echo() {
24
- if (isset($_POST['_wpcf7c'])) switch($_POST["_wpcf7c"]) {
25
- case "step1":
26
- // $result = apply_filters( 'wpcf7_before_send_mail', $result );
27
- if(WPCF7_VERSION == '3.9' || WPCF7_VERSION == '3.9.1') {
28
- add_filter( 'wpcf7_acceptance', 'wpcf7c_acceptance_filter', 11, 1 );
29
- } else if(WPCF7_VERSION >= "3.9.2"){
30
- add_filter("wpcf7_skip_mail", '__return_true', 10, 2);
31
- } else {
32
- add_action("wpcf7_before_send_mail", "wpcf7c_before_send_mail_step1", 10, 2);
33
- //add_filter( 'wpcf7_acceptance', 'wpcf7c_acceptance_filter', 11, 1 );
34
- }
35
-
36
- //$items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
37
- add_filter("wpcf7_ajax_json_echo", "wpcf7c_ajax_json_echo_step1", 10, 3);
38
-
39
- // flamingo対策
40
- remove_action( 'wpcf7_submit', 'wpcf7_flamingo_submit');
41
-
42
- // Contact Form DB対策
43
- //remove_action( 'wpcf7_before_send_mail', 'wpcf7_flamingo_submit');
44
- global $wp_filter, $merged_filters;
45
-
46
- //error_log(print_r($wp_filter, true));
47
- if($wp_filter["wpcf7_before_send_mail"]) {
48
- foreach($wp_filter["wpcf7_before_send_mail"] as $priority => $actions) {
49
- foreach($actions as $key => $action) {
50
- if(is_array($action["function"])) {
51
- if(is_object($action["function"][0])) {
52
- if(get_class($action["function"][0]) == "CF7DBPlugin") {
53
- //error_log(print_r($action, true));
54
- if($action["function"][1] == "saveFormData") {
55
- unset($wp_filter["wpcf7_before_send_mail"][$priority][$key]);
56
- if ( empty($wp_filter["wpcf7_before_send_mail"][$priority]) )
57
- unset($wp_filter["wpcf7_before_send_mail"][$priority]);
58
- unset($merged_filters["wpcf7_before_send_mail"]);
59
- } else if($action["function"][1] == "saveCF7FormData") {
60
- unset($wp_filter["wpcf7_before_send_mail"][$priority][$key]);
61
- if ( empty($wp_filter["wpcf7_before_send_mail"][$priority]) )
62
- unset($wp_filter["wpcf7_before_send_mail"][$priority]);
63
- unset($merged_filters["wpcf7_before_send_mail"]);
64
- }
65
- }
66
- }
67
- }
68
- }
69
- }
70
- }
71
-
72
- break;
73
- case "step2":
74
- //$items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
75
- add_filter("wpcf7_ajax_json_echo", "wpcf7c_ajax_json_echo_step2", 10, 3);
76
-
77
-
78
- break;
79
- }
80
-
81
-
82
- return;
83
- }
84
-
85
- /**
86
- * 3.9からフックが変わったため、
87
- * acceptanceの機能を利用してメール送信をスキップする。
88
- *
89
- * @param $accepted
90
- * @return bool
91
- */
92
- function wpcf7c_acceptance_filter($accepted) {
93
- global $wpcf7_confflag;
94
-
95
- if($accepted == false) {
96
- // すでにエラー
97
- return $accepted;
98
- }
99
-
100
- // これが呼ばれるときは必ずSTEP1
101
- $wpcf7_confflag = true;
102
- return false;
103
- }
104
-
105
- function wpcf7c_before_send_mail_step1(&$cls) {
106
- //eyeta_log("wpcf7c_before_send_mail_step1");
107
- $cls->skip_mail = true;
108
- }
109
-
110
-
111
- function wpcf7c_ajax_json_echo_step1($items, $result) {
112
- global $wpcf7_confflag;
113
-
114
- $flag = false;
115
-
116
- if(WPCF7_VERSION == '3.9' || WPCF7_VERSION == '3.9.1') {
117
- $flag = $wpcf7_confflag;
118
- } else if(WPCF7_VERSION >= "3.9.2"){
119
- if('mail_sent' == $result['status']) {
120
- $flag = true;
121
- }
122
- } else {
123
- $flag = $result['mail_sent'];
124
- }
125
-
126
-
127
-
128
-
129
- if($flag) {
130
- if(!isset($items["onSubmit"]) || $items["onSubmit"] == null) {
131
- $items["onSubmit"] = array("wpcf7c_step1('" . $_POST['_wpcf7_unit_tag'] . "');");
132
- } else {
133
- $items["onSubmit"][] = "wpcf7c_step1('" . $_POST['_wpcf7_unit_tag'] . "');";
134
- }
135
-
136
- // オプションによる追加チェック
137
- $form = WPCF7_ContactForm::get_current();
138
- $on_confirm = $form->additional_setting( 'on_confirm', false );
139
- if ( ! empty( $on_confirm ) ) {
140
- foreach($on_confirm as $key => $on_confirm_func) {
141
- $items["onSubmit"][] = wpcf7_strip_quote( $on_confirm_func );
142
- }
143
- }
144
-
145
-
146
- $items["message"] = "";
147
- $items["mailSent"] = false;
148
-
149
- unset($items['captcha']);
150
-
151
- } else {
152
- // フィルタ指定があればエラー時にアンカーまでスクロールさせる
153
- $result = false;
154
- if(apply_filters( 'wpcf7c_input_error_scroll', $result )) {
155
- if(!isset($items["onSubmit"]) || $items["onSubmit"] == null) {
156
- $items["onSubmit"] = array("wpcf7c_scroll('" . $_POST['_wpcf7_unit_tag'] . "');");
157
- } else {
158
- $items["onSubmit"][] = "wpcf7c_scroll('" . $_POST['_wpcf7_unit_tag'] . "');";
159
- }
160
- }
161
- }
162
-
163
- return $items;
164
- }
165
-
166
- /*
167
- * captcha対策
168
- */
169
-
170
- function wpcf7c_captcha_validation_filter( $result, $tag ) {
171
- $tag = new WPCF7_Shortcode( $tag );
172
-
173
- $type = $tag->type;
174
- $name = $tag->name;
175
-
176
- $captchac = '_wpcf7_captcha_challenge_' . $name;
177
-
178
- $prefix = isset( $_POST[$captchac] ) ? (string) $_POST[$captchac] : '';
179
- $response = isset( $_POST[$name] ) ? (string) $_POST[$name] : '';
180
-
181
- if ( 0 == strlen( $prefix ) || ! wpcf7_check_captcha( $prefix, $response ) ) {
182
- $result['valid'] = false;
183
- $result['reason'][$name] = wpcf7_get_message( 'captcha_not_match' );
184
- }
185
-
186
- if(0 != strlen( $prefix ) && $_POST["_wpcf7c"] == "step1") {
187
- } else if ( 0 != strlen( $prefix )) {
188
- wpcf7_remove_captcha( $prefix );
189
- }
190
-
191
- return $result;
192
- }
193
-
194
-
195
- function wpcf7c_ajax_json_echo_step2($items, $result) {
196
- //eyeta_log("wpcf7c_ajax_json_echo_step1");
197
- $flag = false;
198
-
199
- if(WPCF7_VERSION == '3.9' || WPCF7_VERSION == '3.9.1') {
200
- $flag = $items['mailSent'];
201
- } else if(WPCF7_VERSION >= "3.9.2"){
202
- $flag = $items['mailSent'];
203
- } else {
204
- $flag = $result['mail_sent'];
205
- }
206
-
207
-
208
- if($flag) {
209
- if(!isset($items["onSubmit"]) || $items["onSubmit"] == null) {
210
- $items["onSubmit"] = array("wpcf7c_step2('" . $_POST['_wpcf7_unit_tag'] . "');");
211
- } else {
212
- $items["onSubmit"][] = "wpcf7c_step2('" . $_POST['_wpcf7_unit_tag'] . "');";
213
- }
214
- }
215
-
216
- return $items;
217
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/css/styles-rtl.css DELETED
File without changes
trunk/includes/css/styles.css DELETED
@@ -1,7 +0,0 @@
1
- .wpcf7c-elm-step2 {}
2
- .wpcf7c-elm-step3 {}
3
- .wpcf7 .ajax-loader{}
4
-
5
- .wpcf7c-hide {display: none;}
6
- .wpcf7c-force-hide {display: none !important;}
7
- .wpcf7c-conf {background-color: #999999; color: black; border: 1px solid #333333;}
 
 
 
 
 
 
 
trunk/includes/functions.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- *
5
- * Created by PhpStorm.
6
- * Author: Eyeta Co.,Ltd.(http://www.eyeta.jp)
7
- *
8
- */
9
-
10
-
11
- function wpcf7c_load_textdomain( $locale = null ) {
12
- global $l10n;
13
-
14
- $domain = 'contact-form-7-add-confirm';
15
-
16
- if ( get_locale() == $locale ) {
17
- $locale = null;
18
- }
19
-
20
- if ( empty( $locale ) ) {
21
- if ( is_textdomain_loaded( $domain ) ) {
22
- return true;
23
- } else {
24
- return load_plugin_textdomain( $domain, false, $domain . '/languages' );
25
- }
26
- } else {
27
- $mo_orig = $l10n[$domain];
28
- unload_textdomain( $domain );
29
-
30
- $mofile = $domain . '-' . $locale . '.mo';
31
- $path = WP_PLUGIN_DIR . '/' . $domain . '/languages';
32
-
33
- if ( $loaded = load_textdomain( $domain, $path . '/'. $mofile ) ) {
34
- return $loaded;
35
- } else {
36
- $mofile = WP_LANG_DIR . '/plugins/' . $mofile;
37
- return load_textdomain( $domain, $mofile );
38
- }
39
-
40
- $l10n[$domain] = $mo_orig;
41
- }
42
-
43
- return false;
44
- }
45
-
46
-
47
- function wpcf7c_load_modules() {
48
- $dir = WPCF7C_PLUGIN_MODULES_DIR;
49
-
50
- if ( empty( $dir ) || ! is_dir( $dir ) ) {
51
- return false;
52
- }
53
-
54
- $mods = array(
55
- 'confirm', 'back' );
56
-
57
- foreach ( $mods as $mod ) {
58
- $file = trailingslashit( $dir ) . $mod . '.php';
59
-
60
- if ( file_exists( $file ) ) {
61
- include_once $file;
62
- }
63
- }
64
- }
65
-
66
-
67
- function wpcf7c_plugin_url( $path = '' ) {
68
- $url = untrailingslashit( WPCF7C_PLUGIN_URL );
69
-
70
- if ( ! empty( $path ) && is_string( $path ) && false === strpos( $path, '..' ) )
71
- $url .= '/' . ltrim( $path, '/' );
72
-
73
- return $url;
74
- }
75
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/includes/js/scripts.js DELETED
@@ -1,205 +0,0 @@
1
-
2
-
3
- (function(jQuery){
4
-
5
-
6
-
7
- if(jQuery(".wpcf7c-elm-step1").size() != 0) {
8
- // 対象有り
9
-
10
- jQuery(".wpcf7c-elm-step1").each(function(){
11
- // 親のフォームを検索
12
- var parent = jQuery(this).parents("form");
13
- if(parent.attr("wpcf7c") == undefined) {
14
- // elm-submitをsubmitボタンへもセット
15
- parent.find(".wpcf7-submit").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
16
- parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
17
-
18
- // ajax用ID退避,処理済みフラグセット
19
- var hidden_wpcf7 = parent.find("input[name=_wpcf7]");
20
- var _wpcf7 = hidden_wpcf7.val();
21
- parent.attr("wpcf7c", _wpcf7);
22
-
23
- parent.attr("step", 1);
24
-
25
- hidden_wpcf7.after('<input type="hidden" name="_wpcf7c" value="step1" />');
26
-
27
- //parent.find("input[name=_wpcf7]").val("");
28
-
29
- // 不要要素非表示
30
- parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
31
- parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide");
32
- parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide");
33
-
34
- // 戻って編集ボタン挙動
35
- parent.find(".wpcf7c-btn-back").on("click", function(){
36
- wpcf7c_to_step1(parent, true);
37
- });
38
- }
39
-
40
-
41
-
42
-
43
- });
44
-
45
-
46
-
47
- }
48
-
49
- })(jQuery);
50
-
51
- var wpcf7c_to_step1 = function(parent, scroll){
52
- parent.find(".wpcf7c-conf").each(function(){
53
- // 親フォーム
54
- var parent_form = jQuery(this).parents("form");
55
-
56
- jQuery(this).removeAttr("disabled").removeAttr("readonly").removeClass("wpcf7c-conf");
57
-
58
- });
59
-
60
- jQuery(".wpcf7c-conf-hidden").remove();
61
-
62
- parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
63
- parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide");
64
- parent.find(".wpcf7c-elm-step1").removeClass("wpcf7c-force-hide");
65
-
66
- parent.find("input[name=_wpcf7c]").val("step1");
67
-
68
- var responseOutput = parent.find('div.wpcf7-response-output');
69
- responseOutput.removeClass("wpcf7c-force-hide");
70
- responseOutput.removeClass("wpcf7-mail-sent-ng");
71
- responseOutput.css("display", "none");
72
-
73
- parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
74
-
75
- // スムーズスクロール
76
- if(scroll) {
77
- // スムーズスクロール
78
- setTimeout(function() { wpcf7c_scroll(parent.attr("name")) }, 100);
79
- }
80
-
81
- }
82
-
83
-
84
- var wpcf7c_step1 = function(unit_tag){
85
- // 確認完了
86
-
87
- // 対象フォーム検索
88
- //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]");
89
- jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
90
- if(jQuery(this).val() == unit_tag) {
91
- var parent = jQuery(this).parents("form");
92
-
93
-
94
- var responseOutput = parent.find('div.wpcf7-response-output');
95
- responseOutput.addClass("wpcf7c-force-hide");
96
-
97
- // 確認画面表示
98
- // テキストエリアを伸ばす
99
- parent.find("textarea").each(function(){
100
- if(this.scrollHeight > this.offsetHeight){
101
- this.style.height = (this.scrollHeight + 10) + 'px';
102
- }
103
- });
104
- parent.find("textarea").attr("readonly", true).addClass("wpcf7c-conf");
105
- parent.find("select").each(function(){
106
- jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
107
- jQuery(this).after(
108
- jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
109
- );
110
- });
111
- parent.find("input").each(function(){
112
- switch(jQuery(this).attr("type")) {
113
- case "submit":
114
- case "button":
115
- case "hidden":
116
- case "image":
117
- // なにもしない
118
- break;
119
- case "radio":
120
- case "checkbox":
121
- // 選択されているものだけ対処
122
- jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
123
- if(jQuery(this).is(":checked")) {
124
- jQuery(this).after(
125
- jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
126
- );
127
- }
128
- break;
129
- case "file":
130
- jQuery(this).attr("readonly", true).addClass("wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
131
- jQuery(this).after(
132
- jQuery('<input type="text" />').attr("name", (jQuery(this).attr("name") + "_conf")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden").addClass("wpcf7c-conf").attr("readonly", true).attr("disabled", true)
133
- );
134
-
135
- break;
136
- default:
137
- jQuery(this).attr("readonly", true).addClass("wpcf7c-conf");
138
- jQuery(this).after(
139
- jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
140
- );
141
- break;
142
- }
143
- });
144
-
145
- // 表示切替
146
- parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
147
- parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide");
148
- parent.find(".wpcf7c-elm-step2").removeClass("wpcf7c-force-hide");
149
-
150
- parent.find(".ajax-loader").removeClass("wpcf7c-force-hide");
151
-
152
- parent.find("input[name=_wpcf7c]").val("step2");
153
-
154
- // スムーズスクロール
155
- setTimeout(function() { wpcf7c_scroll(unit_tag) }, 100);
156
-
157
-
158
- }
159
- });
160
- }
161
-
162
- var wpcf7c_scroll = function(unit_tag) {
163
- // エラーの時などにアンカーまでスクロール
164
- jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
165
- if(jQuery(this).val() == unit_tag) {
166
- var parent = jQuery(this).parents("form");
167
- var speed = 1000;
168
- var position = parent.offset().top;
169
- if(jQuery('.wpcf7c-anchor').size() != 0) {
170
- position = jQuery('.wpcf7c-anchor').offset().top;
171
- }
172
- jQuery("html, body").animate({scrollTop:position}, speed, "swing");
173
- }
174
- });
175
- }
176
-
177
- var wpcf7c_step2 = function(unit_tag){
178
- // 確認完了
179
-
180
- // 対象フォーム検索
181
- //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]");
182
- jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
183
- if(jQuery(this).val() == unit_tag) {
184
- var parent = jQuery(this).parents("form");
185
-
186
-
187
- var responseOutput = parent.find('div.wpcf7-response-output');
188
- responseOutput.removeClass("wpcf7c-force-hide");
189
-
190
- // step1状態の画面表示
191
- wpcf7c_to_step1(parent);
192
-
193
- // step3の要素があれば、それに切り替える
194
- if(parent.find(".wpcf7c-elm-step3").size() != 0) {
195
- // 表示切替
196
- parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
197
- parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
198
- parent.find(".wpcf7c-elm-step3").removeClass("wpcf7c-force-hide");
199
- }
200
-
201
-
202
- }
203
- });
204
- }
205
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/contact-form-7-add-confirm-ja.mo DELETED
Binary file
trunk/languages/contact-form-7-add-confirm-ja.po DELETED
@@ -1,55 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Contact Form 7 Confirm\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-02-17 20:03+0900\n"
6
- "PO-Revision-Date: 2014-02-17 20:10+0900\n"
7
- "Last-Translator: Yuichiro ABE <y.abe@eyeta.jp>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-SourceCharset: UTF-8\n"
13
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_c\n"
14
- "X-Poedit-Basepath: ../..\n"
15
- "Plural-Forms: nplurals=1; plural=0;\n"
16
- "X-Generator: Poedit 1.5.5\n"
17
- "X-Poedit-SearchPath-0: contact-form-7-confirm\n"
18
-
19
- #: contact-form-7-confirm/modules/back.php:28
20
- msgid "Backedit"
21
- msgstr "戻って編集"
22
-
23
- #: contact-form-7-confirm/modules/back.php:49
24
- msgid "Back button"
25
- msgstr "戻って編集ボタン"
26
-
27
- #: contact-form-7-confirm/modules/back.php:59
28
- #: contact-form-7-confirm/modules/back.php:62
29
- #: contact-form-7-confirm/modules/back.php:67
30
- #: contact-form-7-confirm/modules/confirm.php:59
31
- #: contact-form-7-confirm/modules/confirm.php:62
32
- #: contact-form-7-confirm/modules/confirm.php:67
33
- msgid "optional"
34
- msgstr ""
35
-
36
- #: contact-form-7-confirm/modules/back.php:67
37
- #: contact-form-7-confirm/modules/confirm.php:67
38
- msgid "Label"
39
- msgstr ""
40
-
41
- #: contact-form-7-confirm/modules/back.php:74
42
- #: contact-form-7-confirm/modules/confirm.php:74
43
- msgid "Copy this code and paste it into the form left."
44
- msgstr ""
45
-
46
- #: contact-form-7-confirm/modules/confirm.php:28
47
- msgid "Confirm"
48
- msgstr "確認"
49
-
50
- #: contact-form-7-confirm/modules/confirm.php:49
51
- msgid "Confirm button"
52
- msgstr "確認ボタン"
53
-
54
- msgid "Add confirm step to contact form 7"
55
- msgstr "Contact Form 7プラグインに確認画面をつけるプラグイン"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/languages/contact-form-7-add-confirm.pot DELETED
@@ -1,17 +0,0 @@
1
- msgid ""
2
- msgstr ""
3
- "Project-Id-Version: Contact Form 7 Confirm\n"
4
- "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-02-17 04:26+0900\n"
6
- "PO-Revision-Date: 2014-02-17 04:26+0900\n"
7
- "Last-Translator: Yuichiro ABE <y.abe@eyeta.jp>\n"
8
- "Language-Team: \n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "X-Poedit-SourceCharset: utf-8\n"
13
- "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_c\n"
14
- "X-Poedit-Basepath: ../..\n"
15
- "Plural-Forms: nplurals=1; plural=0;\n"
16
- "X-Generator: Poedit 1.5.7\n"
17
- "X-Poedit-SearchPath-0: contact-form-7-confirm\n"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/modules/back.php DELETED
@@ -1,79 +0,0 @@
1
- <?php
2
- /**
3
- ** A base module for [back]
4
- **/
5
-
6
- /* Shortcode handler */
7
-
8
- add_action( 'wpcf7_init', 'wpcf7c_add_shortcode_back' );
9
-
10
- function wpcf7c_add_shortcode_back() {
11
- wpcf7_add_shortcode( 'back', 'wpcf7c_back_shortcode_handler' );
12
- }
13
-
14
- function wpcf7c_back_shortcode_handler( $tag ) {
15
- $tag = new WPCF7_Shortcode( $tag );
16
-
17
- $class = wpcf7_form_controls_class( $tag->type );
18
-
19
- $atts = array();
20
-
21
- $atts['class'] = $tag->get_class_option( $class ) . " wpcf7c-elm-step2 wpcf7c-btn-back wpcf7c-force-hide";
22
- $atts['id'] = $tag->get_option( 'id', 'id', true );
23
- $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
24
-
25
- $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
26
-
27
- if ( empty( $value ) )
28
- $value = __( 'Backedit', 'contact-form-7-add-confirm' );
29
-
30
- $atts['type'] = 'button';
31
- $atts['value'] = $value;
32
-
33
- $atts = wpcf7_format_atts( $atts );
34
-
35
- $html = sprintf( '<input %1$s />', $atts );
36
-
37
- return $html;
38
- }
39
-
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
- }
79
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/modules/confirm.php DELETED
@@ -1,79 +0,0 @@
1
- <?php
2
- /**
3
- ** A base module for [confirm]
4
- **/
5
-
6
- /* Shortcode handler */
7
-
8
- add_action( 'wpcf7_init', 'wpcf7c_add_shortcode_confirm' );
9
-
10
- function wpcf7c_add_shortcode_confirm() {
11
- wpcf7_add_shortcode( 'confirm', 'wpcf7c_confirm_shortcode_handler' );
12
- }
13
-
14
- function wpcf7c_confirm_shortcode_handler( $tag ) {
15
- $tag = new WPCF7_Shortcode( $tag );
16
-
17
- $class = wpcf7_form_controls_class( $tag->type );
18
-
19
- $atts = array();
20
-
21
- $atts['class'] = $tag->get_class_option( $class ) . " wpcf7c-elm-step1 wpcf7c-btn-confirm wpcf7c-force-hide";
22
- $atts['id'] = $tag->get_option( 'id', 'id', true );
23
- $atts['tabindex'] = $tag->get_option( 'tabindex', 'int', true );
24
-
25
- $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
26
-
27
- if ( empty( $value ) )
28
- $value = __( 'Confirm', 'contact-form-7-add-confirm' );
29
-
30
- $atts['type'] = 'submit';
31
- $atts['value'] = $value;
32
-
33
- $atts = wpcf7_format_atts( $atts );
34
-
35
- $html = sprintf( '<input %1$s />', $atts );
36
-
37
- return $html;
38
- }
39
-
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
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/readme.txt DELETED
@@ -1,97 +0,0 @@
1
- === Contact Form 7 add confirm ===
2
- Contributors: Yuichiro ABE
3
- Donate link:
4
- Tags: contact, form, contact form
5
- Requires at least: 3.8
6
- Tested up to: 4.0
7
- Stable tag: 1.3.9.5
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
-
11
- "Contact Form 7 add confirm" can add confirm step to "Contact Form 7".
12
-
13
- == Description ==
14
-
15
- "Contact Form 7 add confirm" can add confirm step to "Contact Form 7".
16
- "Contact Form 7 add confirm"に確認画面を追加するプラグインです。
17
-
18
- This plug-in is not related to the developer of the "Contact Form 7".
19
- このプラグインの作者はContact Form 7プラグイン開発元とは関係ありません、ご注意下さい。
20
-
21
- == Installation ==
22
-
23
- 1. If you have not yet, Install Contact Form 7 Plugin
24
- 2. Upload the entire `contact-form-7-confirm` folder to the `/wp-content/plugins/` directory.
25
- 3. Activate the plugin through the 'Plugins' menu in WordPress.
26
-
27
- For basic usage, you can also have a look at the [plugin homepage](http://www.eyeta.jp/archives/908).
28
-
29
- == Frequently asked questions ==
30
-
31
- = A question that someone might have =
32
-
33
- An answer to that question.
34
-
35
- == Screenshots ==
36
-
37
-
38
- == Changelog ==
39
- 1.3.8.5
40
- 言語ファイルの読み込みバグ対応
41
- Javascript非対応のブラウザの場合、送信ボタンを初期から表示するように変更
42
-
43
- 1.3.8.6
44
- 言語ファイルの読み込みバグ対応
45
- captchaで正常に動作していなかった点を修正
46
-
47
- 1.3.8.7
48
- ver記載ミス
49
-
50
- 1.3.8.8
51
- 「Notice: Undefined index」が出ていた箇所を修正
52
-
53
- 1.3.8.9
54
- 「Notice: Undefined index」が出ていた箇所を修正
55
- javascript上で$を利用しないように変更
56
-
57
- 1.3.8.10
58
- デグレしてしまっていた箇所の修正
59
- javascriptのaddClassとremoveClassの順序を変更
60
-
61
- 1.3.8.11
62
- flamingoプラグインで確認ボタンクリック時も記録されてしまう問題を修正
63
-
64
- 1.3.8.12
65
- Contact Form DBプラグインで確認ボタンクリック時に記録されてしまう問題を修正
66
-
67
- 1.3.8.13
68
- 「on_confirm」オプションを追加、確認画面表示時に独自のJavascriptを追加できるようにしました。
69
- 編集に戻る際は、ボタンに直接イベントをつけて下さい。
70
-
71
- 1.3.9.1
72
- せっかくスクロールアンカーをセットできるので
73
-  add_filter("wpcf7c_input_error_scroll", '__return_true');
74
-  とすることで、入力エラーじもアンカーまでスクロールするようにしました。
75
-  要素の表示非表示を制御するとスクロールが思った場所にいかないのでインターバルを入れました。
76
- Contact Form 7 3.9 に(無理矢理ですが)対応しました。
77
- input type="text"などについて、disabledは付けずにreadonlyのみにしました。
78
- textareaについて、入力内容が縦幅より大きい場合、確認画面で高さを伸ばすようにしました。
79
-
80
- 1.3.9.2
81
- エラーメッセージ表示のDIVが確認画面から編集画面に戻る際に
82
- display: blockのままだったものをnoneにするように修正
83
-
84
- 1.3.9.3
85
- WordPress4.0
86
- Contact Form 7 3.9.2に対応
87
-
88
- 1.3.9.4
89
- Contact Form DB 2.8.2以上に対応
90
-
91
- 1.3.9.4
92
- Contact Form DB 2.8.2以上に対応
93
-
94
-
95
- == Upgrade notice ==
96
- 1.3.9.5
97
- バグFIXデバックログ出力が残っていたものを削除
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
trunk/settings.php DELETED
@@ -1,58 +0,0 @@
1
- <?php
2
- /**
3
- *
4
- *
5
- * Created by PhpStorm.
6
- * Author: Eyeta Co.,Ltd.(http://www.eyeta.jp)
7
- *
8
- */
9
-
10
- global $wpcf7_confflag;
11
- $wpcf7_confflag = false;
12
-
13
- require_once WPCF7C_PLUGIN_DIR . '/includes/functions.php';
14
- require_once WPCF7C_PLUGIN_DIR . '/includes/controller.php';
15
-
16
- add_action( 'plugins_loaded', 'wpcf7c', 11 );
17
-
18
- function wpcf7c() {
19
- wpcf7c_load_textdomain();
20
- wpcf7c_load_modules();
21
-
22
- nocache_headers();
23
- }
24
-
25
- add_filter('nocache_headers', "wpcf7c_nocache_headers", 10, 1);
26
- function wpcf7c_nocache_headers($headers) {
27
-
28
- $headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0";
29
-
30
- return $headers;
31
- }
32
-
33
- add_action( 'wpcf7_enqueue_scripts', 'wpcf7c_enqueue_scripts' );
34
- function wpcf7c_enqueue_scripts() {
35
- $in_footer = true;
36
- if ( 'header' === WPCF7_LOAD_JS )
37
- $in_footer = false;
38
-
39
- wp_enqueue_script( 'contact-form-7-confirm',
40
- wpcf7c_plugin_url( 'includes/js/scripts.js' ),
41
- array( 'jquery', 'jquery-form' ), WPCF7C_VERSION, $in_footer );
42
-
43
- }
44
-
45
-
46
- add_action( 'wpcf7_enqueue_styles', 'wpcf7c_enqueue_styles' );
47
- function wpcf7c_enqueue_styles(){
48
- wp_enqueue_style( 'contact-form-7-confirm',
49
- wpcf7c_plugin_url( 'includes/css/styles.css' ),
50
- array(), WPCF7C_VERSION, 'all' );
51
-
52
- if ( wpcf7_is_rtl() ) {
53
- wp_enqueue_style( 'contact-form-7-confirm-rtl',
54
- wpcf7c_plugin_url( 'includes/css/styles-rtl.css' ),
55
- array(), WPCF7_VERSION, 'all' );
56
- }
57
-
58
- }