Contact Form 7 add confirm - Version 1.3.8.2

Version Description

Download this release

Release Info

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

Version 1.3.8.2

contact-form-7-confirm.php ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.8.2
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.2
44
+  戻って編集ボタンのデフォルトテキストが英語だった件を修正
45
+ */
46
+ define( 'WPCF7C_VERSION', '1.3.8.2' );
47
+
48
+ if ( ! defined( 'WPCF7C_PLUGIN_BASENAME' ) )
49
+ define( 'WPCF7C_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
50
+
51
+ if ( ! defined( 'WPCF7C_PLUGIN_NAME' ) )
52
+ define( 'WPCF7C_PLUGIN_NAME', trim( dirname( WPCF7C_PLUGIN_BASENAME ), '/' ) );
53
+
54
+ if ( ! defined( 'WPCF7C_PLUGIN_DIR' ) )
55
+ define( 'WPCF7C_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
56
+
57
+ if ( ! defined( 'WPCF7C_PLUGIN_URL' ) )
58
+ define( 'WPCF7C_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
59
+
60
+ if ( ! defined( 'WPCF7C_PLUGIN_MODULES_DIR' ) )
61
+ define( 'WPCF7C_PLUGIN_MODULES_DIR', WPCF7C_PLUGIN_DIR . '/modules' );
62
+
63
+
64
+
65
+ require_once WPCF7C_PLUGIN_DIR . '/settings.php';
66
+
includes/controller.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ wpcf7c_ajax_json_echo();
14
+ }
15
+
16
+
17
+ function wpcf7c_ajax_json_echo() {
18
+ switch($_POST["_wpcf7c"]) {
19
+ case "step1":
20
+ // $result = apply_filters( 'wpcf7_before_send_mail', $result );
21
+ add_action("wpcf7_before_send_mail", "wpcf7c_before_send_mail_step1", 10, 2);
22
+
23
+ //$items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
24
+ add_filter("wpcf7_ajax_json_echo", "wpcf7c_ajax_json_echo_step1", 10, 3);
25
+
26
+ break;
27
+ case "step2":
28
+ //$items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
29
+ add_filter("wpcf7_ajax_json_echo", "wpcf7c_ajax_json_echo_step2", 10, 3);
30
+
31
+ break;
32
+ }
33
+
34
+
35
+ return;
36
+ }
37
+
38
+ function wpcf7c_before_send_mail_step1(&$cls) {
39
+ //eyeta_log("wpcf7c_before_send_mail_step1");
40
+ $cls->skip_mail = true;
41
+ }
42
+
43
+ function wpcf7c_ajax_json_echo_step1($items, $result) {
44
+ //eyeta_log("wpcf7c_ajax_json_echo_step1");
45
+ if($result['mail_sent']) {
46
+ if($items["onSubmit"] == null) {
47
+ $items["onSubmit"] = array("wpcf7c_step1('" . $_POST['_wpcf7_unit_tag'] . "');");
48
+ } else {
49
+ $items["onSubmit"][] = "wpcf7c_step1('" . $_POST['_wpcf7_unit_tag'] . "');";
50
+ }
51
+ $items["message"] = "";
52
+ $items["mailSent"] = false;
53
+ }
54
+
55
+ return $items;
56
+ }
57
+
58
+ function wpcf7c_ajax_json_echo_step2($items, $result) {
59
+ //eyeta_log("wpcf7c_ajax_json_echo_step1");
60
+ if($result['mail_sent']) {
61
+ if($items["onSubmit"] == null) {
62
+ $items["onSubmit"] = array("wpcf7c_step2('" . $_POST['_wpcf7_unit_tag'] . "');");
63
+ } else {
64
+ $items["onSubmit"][] = "wpcf7c_step2('" . $_POST['_wpcf7_unit_tag'] . "');";
65
+ }
66
+ }
67
+
68
+ return $items;
69
+ }
includes/css/styles-rtl.css ADDED
File without changes
includes/css/styles.css ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
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;}
includes/functions.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-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
+
includes/js/scripts.js ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ (function($){
4
+
5
+
6
+
7
+ if($(".wpcf7c-elm-step1").size() != 0) {
8
+ // 対象有り
9
+
10
+ $(".wpcf7c-elm-step1").each(function(){
11
+ // 親のフォームを検索
12
+ var parent = $(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-step1").removeClass("wpcf7c-force-hide");
31
+ parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
32
+ parent.find(".wpcf7c-elm-step3").addClass("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-step1").removeClass("wpcf7c-force-hide");
63
+ parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
64
+ parent.find(".wpcf7c-elm-step3").addClass("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
+
72
+ parent.find(".ajax-loader").addClass("wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
73
+
74
+ // スムーズスクロール
75
+ if(scroll) {
76
+ var speed = 1000;
77
+ var position = parent.offset().top;
78
+ if($('.wpcf7c-anchor').size() != 0) {
79
+ position = $('.wpcf7c-anchor').offset().top;
80
+ }
81
+ jQuery("html, body").animate({scrollTop:position}, speed, "swing");
82
+ }
83
+
84
+ }
85
+
86
+
87
+ var wpcf7c_step1 = function(unit_tag){
88
+ // 確認完了
89
+
90
+ // 対象フォーム検索
91
+ //var elm_unit_tag = $.find("input[name=_wpcf7_unit_tag]");
92
+ jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
93
+ if(jQuery(this).val() == unit_tag) {
94
+ var parent = jQuery(this).parents("form");
95
+
96
+
97
+ var responseOutput = parent.find('div.wpcf7-response-output');
98
+ responseOutput.addClass("wpcf7c-force-hide");
99
+
100
+ // 確認画面表示
101
+ parent.find("textarea").attr("readonly", true).addClass("wpcf7c-conf");
102
+ parent.find("select").each(function(){
103
+ jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
104
+ jQuery(this).after(
105
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
106
+ );
107
+ });
108
+ parent.find("input").each(function(){
109
+ switch(jQuery(this).attr("type")) {
110
+ case "submit":
111
+ case "button":
112
+ case "hidden":
113
+ case "image":
114
+ // なにもしない
115
+ break;
116
+ case "radio":
117
+ case "checkbox":
118
+ // 選択されているものだけ対処
119
+ jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
120
+ if(jQuery(this).is(":checked")) {
121
+ jQuery(this).after(
122
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
123
+ );
124
+ }
125
+ break;
126
+ case "file":
127
+ jQuery(this).attr("readonly", true).addClass("wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
128
+ jQuery(this).after(
129
+ 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)
130
+ );
131
+
132
+ break;
133
+ default:
134
+ jQuery(this).attr("readonly", true).attr("disabled", true).addClass("wpcf7c-conf");
135
+ jQuery(this).after(
136
+ jQuery('<input type="hidden" />').attr("name", jQuery(this).attr("name")).val(jQuery(this).val()).addClass("wpcf7c-conf-hidden")
137
+ );
138
+ break;
139
+ }
140
+ });
141
+
142
+ // 表示切替
143
+ parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
144
+ parent.find(".wpcf7c-elm-step2").removeClass("wpcf7c-force-hide");
145
+ parent.find(".wpcf7c-elm-step3").addClass("wpcf7c-force-hide");
146
+
147
+ parent.find(".ajax-loader").removeClass("wpcf7c-force-hide");
148
+
149
+ parent.find("input[name=_wpcf7c]").val("step2");
150
+
151
+ // スムーズスクロール
152
+ var speed = 1000;
153
+ var position = parent.offset().top;
154
+ if($('.wpcf7c-anchor').size() != 0) {
155
+ position = $('.wpcf7c-anchor').offset().top;
156
+ }
157
+ jQuery("html, body").animate({scrollTop:position}, speed, "swing");
158
+
159
+ }
160
+ });
161
+ }
162
+
163
+ var wpcf7c_step2 = function(unit_tag){
164
+ // 確認完了
165
+
166
+ // 対象フォーム検索
167
+ //var elm_unit_tag = jQuery.find("input[name=_wpcf7_unit_tag]");
168
+ jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function(){
169
+ if(jQuery(this).val() == unit_tag) {
170
+ var parent = jQuery(this).parents("form");
171
+
172
+
173
+ var responseOutput = parent.find('div.wpcf7-response-output');
174
+ responseOutput.removeClass("wpcf7c-force-hide");
175
+
176
+ // step1状態の画面表示
177
+ wpcf7c_to_step1(parent);
178
+
179
+ // step3の要素があれば、それに切り替える
180
+ if(parent.find(".wpcf7c-elm-step3").size() != 0) {
181
+ // 表示切替
182
+ parent.find(".wpcf7c-elm-step1").addClass("wpcf7c-force-hide");
183
+ parent.find(".wpcf7c-elm-step2").addClass("wpcf7c-force-hide");
184
+ parent.find(".wpcf7c-elm-step3").removeClass("wpcf7c-force-hide");
185
+ }
186
+
187
+
188
+ }
189
+ });
190
+ }
191
+
languages/contact-form-7-confirm-ja.mo ADDED
Binary file
languages/contact-form-7-confirm-ja.po ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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プラグインに確認画面をつけるプラグイン"
languages/contact-form-7-confirm.pot ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"
modules/back.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-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-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
+
modules/confirm.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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";
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-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-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
+
readme.txt ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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: 3.8.1
7
+ Stable tag: 1.3.8.2
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"�Ɋm�F��ʂ�lj�����v���O�C���ł��B
17
+
18
+ This plug-in is not related to the developer of the "Contact Form 7".
19
+ ���̃v���O�C���̍�҂�Contact Form 7�v���O�C���J�����Ƃ͊֌W����܂���A�����Ӊ������B
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
+
40
+
41
+
42
+ == Upgrade notice ==
settings.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ *
4
+ *
5
+ * Created by PhpStorm.
6
+ * Author: Eyeta Co.,Ltd.(http://www.eyeta.jp)
7
+ *
8
+ */
9
+
10
+ require_once WPCF7C_PLUGIN_DIR . '/includes/functions.php';
11
+ require_once WPCF7C_PLUGIN_DIR . '/includes/controller.php';
12
+
13
+ add_action( 'plugins_loaded', 'wpcf7c', 11 );
14
+
15
+ function wpcf7c() {
16
+ wpcf7c_load_textdomain();
17
+ wpcf7c_load_modules();
18
+
19
+ nocache_headers();
20
+ }
21
+
22
+ add_filter('nocache_headers', "wpcf7c_nocache_headers", 10, 1);
23
+ function wpcf7c_nocache_headers($headers) {
24
+
25
+ $headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0";
26
+
27
+ return $headers;
28
+ }
29
+
30
+ add_action( 'wpcf7_enqueue_scripts', 'wpcf7c_enqueue_scripts' );
31
+ function wpcf7c_enqueue_scripts() {
32
+ $in_footer = true;
33
+ if ( 'header' === WPCF7_LOAD_JS )
34
+ $in_footer = false;
35
+
36
+ wp_enqueue_script( 'contact-form-7-confirm',
37
+ wpcf7c_plugin_url( 'includes/js/scripts.js' ),
38
+ array( 'jquery', 'jquery-form' ), WPCF7C_VERSION, $in_footer );
39
+
40
+ }
41
+
42
+
43
+ add_action( 'wpcf7_enqueue_styles', 'wpcf7c_enqueue_styles' );
44
+ function wpcf7c_enqueue_styles(){
45
+ wp_enqueue_style( 'contact-form-7-confirm',
46
+ wpcf7c_plugin_url( 'includes/css/styles.css' ),
47
+ array(), WPCF7C_VERSION, 'all' );
48
+
49
+ if ( wpcf7_is_rtl() ) {
50
+ wp_enqueue_style( 'contact-form-7-confirm-rtl',
51
+ wpcf7c_plugin_url( 'includes/css/styles-rtl.css' ),
52
+ array(), WPCF7_VERSION, 'all' );
53
+ }
54
+
55
+ }