MW WP Form - Version 1.1.3

Version Description

  • Deprecated: div.mw_wp_form_previewdiv.mw_wp_form_confirm
  • Deprecated: MW_Form::previewPage()MW_Form::confirmPage()
  • Deprecated: [mwform_submitButton]preview_valueconfirm_value
  • Deprecated: [mwform]previewconfirm
  • Cahged : MW_Form::isPreview() -> MW_Form::isConfirm()
  • Cahged : MW_Form::getPreviewButtonName() -> MW_Form::getConfirmButtonName()
  • Added : mwform_default_content
  • Added : mwform_default_postdata
Download this release

Release Info

Developer inc2734
Plugin Icon wp plugin MW WP Form
Version 1.1.3
Comparing to
See all releases

Code changes from version 1.1.2 to 1.1.3

form_fields/mw_form_field_akismet_error.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Akismet Error
4
  * URI: http://2inc.org
5
  * Description: Akismetのエラーを出力。
6
- * Version: 1.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: June 21, 2013
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -51,11 +51,14 @@ class mw_form_field_akismet_error extends mw_form_field {
51
  }
52
 
53
  /**
54
- * previewPage
55
  * 確認ページでのフォーム項目を返す
56
  * @return String HTML
57
  */
 
 
58
  protected function previewPage() {
 
59
  }
60
 
61
  /**
3
  * Name: MW Form Field Akismet Error
4
  * URI: http://2inc.org
5
  * Description: Akismetのエラーを出力。
6
+ * Version: 1.1.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : June 21, 2013
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
51
  }
52
 
53
  /**
54
+ * confirmPage
55
  * 確認ページでのフォーム項目を返す
56
  * @return String HTML
57
  */
58
+ protected function confirmPage() {
59
+ }
60
  protected function previewPage() {
61
+ $this->confirmPage();
62
  }
63
 
64
  /**
form_fields/mw_form_field_back_button.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Back Button
4
  * URI: http://2inc.org
5
  * Description: 戻るボタンを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -52,13 +52,16 @@ class mw_form_field_back_button extends mw_form_field {
52
  }
53
 
54
  /**
55
- * previewPage
56
  * 確認ページでのフォーム項目を返す
57
  * @return String HTML
58
  */
59
- protected function previewPage() {
60
  return $this->Form->submit( $this->Form->getBackButtonName(), $this->atts['value'] );
61
  }
 
 
 
62
 
63
  /**
64
  * add_qtags
3
  * Name: MW Form Field Back Button
4
  * URI: http://2inc.org
5
  * Description: 戻るボタンを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
52
  }
53
 
54
  /**
55
+ * confirmPage
56
  * 確認ページでのフォーム項目を返す
57
  * @return String HTML
58
  */
59
+ protected function confirmPage() {
60
  return $this->Form->submit( $this->Form->getBackButtonName(), $this->atts['value'] );
61
  }
62
+ protected function previewPage() {
63
+ return $this->confirmPage();
64
+ }
65
 
66
  /**
67
  * add_qtags
form_fields/mw_form_field_button.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Button
4
  * URI: http://2inc.org
5
  * Description: ボタンを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -54,13 +54,16 @@ class mw_form_field_button extends mw_form_field {
54
  }
55
 
56
  /**
57
- * previewPage
58
  * 確認ページでのフォーム項目を返す
59
  * @return String HTML
60
  */
61
- protected function previewPage() {
62
  return $this->inputPage();
63
  }
 
 
 
64
 
65
  /**
66
  * add_qtags
3
  * Name: MW Form Field Button
4
  * URI: http://2inc.org
5
  * Description: ボタンを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
54
  }
55
 
56
  /**
57
+ * confirmPage
58
  * 確認ページでのフォーム項目を返す
59
  * @return String HTML
60
  */
61
+ protected function confirmPage() {
62
  return $this->inputPage();
63
  }
64
+ protected function previewPage() {
65
+ return $this->confirmPage();
66
+ }
67
 
68
  /**
69
  * add_qtags
form_fields/mw_form_field_checkbox.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Checkbox
4
  * URI: http://2inc.org
5
  * Description: チェックボックスを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -63,11 +63,11 @@ class mw_form_field_checkbox extends mw_form_field {
63
  }
64
 
65
  /**
66
- * previewPage
67
  * 確認ページでのフォーム項目を返す
68
  * @return String HTML
69
  */
70
- protected function previewPage() {
71
  $children = $this->getChildren( $this->atts['children'] );
72
  $value = $this->Form->getCheckedValue( $this->atts['name'], $children );
73
  $_ret = $value;
@@ -75,6 +75,9 @@ class mw_form_field_checkbox extends mw_form_field {
75
  $_ret .= $this->Form->separator( $this->atts['name'] );
76
  return $_ret;
77
  }
 
 
 
78
 
79
  /**
80
  * add_qtags
3
  * Name: MW Form Field Checkbox
4
  * URI: http://2inc.org
5
  * Description: チェックボックスを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
63
  }
64
 
65
  /**
66
+ * confirmPage
67
  * 確認ページでのフォーム項目を返す
68
  * @return String HTML
69
  */
70
+ protected function confirmPage() {
71
  $children = $this->getChildren( $this->atts['children'] );
72
  $value = $this->Form->getCheckedValue( $this->atts['name'], $children );
73
  $_ret = $value;
75
  $_ret .= $this->Form->separator( $this->atts['name'] );
76
  return $_ret;
77
  }
78
+ protected function previewPage() {
79
+ return $this->confirmPage();
80
+ }
81
 
82
  /**
83
  * add_qtags
form_fields/mw_form_field_confirm_button.php ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Name: MW Form Field Confirm Button
4
+ * URI: http://2inc.org
5
+ * Description: 確認ボタンを出力。
6
+ * Version: 1.2.1
7
+ * Author: Takashi Kitajima
8
+ * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: December 26, 2013
11
+ * License: GPL2
12
+ *
13
+ * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
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, version 2, as
17
+ * published by the Free Software Foundation.
18
+ *
19
+ * This program is distributed in the hope that it will be useful,
20
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ * GNU General Public License for more details.
23
+ *
24
+ * You should have received a copy of the GNU General Public License
25
+ * along with this program; if not, write to the Free Software
26
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+ class mw_form_field_confirm_button extends mw_form_field {
29
+
30
+ /**
31
+ * String $short_code_name
32
+ */
33
+ protected $short_code_name = 'mwform_confirmButton';
34
+
35
+ /**
36
+ * setDefaults
37
+ * $this->defaultsを設定し返す
38
+ * @return Array defaults
39
+ */
40
+ protected function setDefaults() {
41
+ return array(
42
+ 'value' => __( 'Confirm', MWF_Config::DOMAIN ),
43
+ );
44
+ }
45
+
46
+ /**
47
+ * inputPage
48
+ * 入力ページでのフォーム項目を返す
49
+ * @return String HTML
50
+ */
51
+ protected function inputPage() {
52
+ return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['value'] );
53
+ }
54
+
55
+ /**
56
+ * confirmPage
57
+ * 確認ページでのフォーム項目を返す
58
+ * @return String HTML
59
+ */
60
+ protected function confirmPage() {
61
+ }
62
+
63
+ /**
64
+ * add_qtags
65
+ * QTags.addButton を出力
66
+ */
67
+ protected function add_qtags() {
68
+ ?>
69
+ '<?php echo $this->short_code_name; ?>',
70
+ '<?php _e( 'Confirm Button', MWF_Config::DOMAIN ); ?>',
71
+ '[<?php echo $this->short_code_name; ?>]',
72
+ ''
73
+ <?php
74
+ }
75
+ }
form_fields/mw_form_field_datepicker.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Datepicker
4
  * URI: http://2inc.org
5
  * Description: datepickerを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -85,16 +85,19 @@ class mw_form_field_datepicker extends mw_form_field {
85
  }
86
 
87
  /**
88
- * previewPage
89
  * 確認ページでのフォーム項目を返す
90
  * @return String HTML
91
  */
92
- protected function previewPage() {
93
  $value = $this->Form->getValue( $this->atts['name'] );
94
  $_ret = $value;
95
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
96
  return $_ret;
97
  }
 
 
 
98
 
99
  /**
100
  * add_qtags
3
  * Name: MW Form Field Datepicker
4
  * URI: http://2inc.org
5
  * Description: datepickerを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
85
  }
86
 
87
  /**
88
+ * confirmPage
89
  * 確認ページでのフォーム項目を返す
90
  * @return String HTML
91
  */
92
+ protected function confirmPage() {
93
  $value = $this->Form->getValue( $this->atts['name'] );
94
  $_ret = $value;
95
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
96
  return $_ret;
97
  }
98
+ protected function previewPage() {
99
+ return $this->confirmPage();
100
+ }
101
 
102
  /**
103
  * add_qtags
form_fields/mw_form_field_error.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Error
4
  * URI: http://2inc.org
5
  * Description: エラーを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -58,11 +58,14 @@ class mw_form_field_error extends mw_form_field {
58
  }
59
 
60
  /**
61
- * previewPage
62
  * 確認ページでのフォーム項目を返す
63
  * @return String HTML
64
  */
 
 
65
  protected function previewPage() {
 
66
  }
67
 
68
  /**
3
  * Name: MW Form Field Error
4
  * URI: http://2inc.org
5
  * Description: エラーを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
58
  }
59
 
60
  /**
61
+ * confirmPage
62
  * 確認ページでのフォーム項目を返す
63
  * @return String HTML
64
  */
65
+ protected function confirmPage() {
66
+ }
67
  protected function previewPage() {
68
+ $this->confirmPage();
69
  }
70
 
71
  /**
form_fields/mw_form_field_file.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field File
4
  * URI: http://2inc.org
5
  * Description: 画像アップロードフィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: May 17, 2013
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -68,11 +68,11 @@ class mw_form_field_file extends mw_form_field {
68
  }
69
 
70
  /**
71
- * previewPage
72
  * 確認ページでのフォーム項目を返す
73
  * @return String HTML
74
  */
75
- protected function previewPage() {
76
  $value = $this->Form->getValue( $this->atts['name'] );
77
  if ( $value ) {
78
  $_ret = '<div class="' . MWF_Config::NAME . '_file">';
@@ -82,6 +82,9 @@ class mw_form_field_file extends mw_form_field {
82
  return $_ret;
83
  }
84
  }
 
 
 
85
 
86
  /**
87
  * add_qtags
3
  * Name: MW Form Field File
4
  * URI: http://2inc.org
5
  * Description: 画像アップロードフィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : May 17, 2013
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
68
  }
69
 
70
  /**
71
+ * confirmPage
72
  * 確認ページでのフォーム項目を返す
73
  * @return String HTML
74
  */
75
+ protected function confirmPage() {
76
  $value = $this->Form->getValue( $this->atts['name'] );
77
  if ( $value ) {
78
  $_ret = '<div class="' . MWF_Config::NAME . '_file">';
82
  return $_ret;
83
  }
84
  }
85
+ protected function previewPage() {
86
+ return $this->confirmPage();
87
+ }
88
 
89
  /**
90
  * add_qtags
form_fields/mw_form_field_hidden.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Hidden
4
  * URI: http://2inc.org
5
  * Description: hiddenフィールドを出力。
6
- * Version: 1.3
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: December 5, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -59,11 +59,11 @@ class mw_form_field_hidden extends mw_form_field {
59
  }
60
 
61
  /**
62
- * previewPage
63
  * 確認ページでのフォーム項目を返す
64
  * @return String HTML
65
  */
66
- protected function previewPage() {
67
  $value = $this->Form->getValue( $this->atts['name'] );
68
  $echo_value = '';
69
  if ( $this->atts['echo'] === 'true' ) {
@@ -71,6 +71,9 @@ class mw_form_field_hidden extends mw_form_field {
71
  }
72
  return $echo_value . $this->Form->hidden( $this->atts['name'], $value );
73
  }
 
 
 
74
 
75
  /**
76
  * add_qtags
3
  * Name: MW Form Field Hidden
4
  * URI: http://2inc.org
5
  * Description: hiddenフィールドを出力。
6
+ * Version: 1.3.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
59
  }
60
 
61
  /**
62
+ * confirmPage
63
  * 確認ページでのフォーム項目を返す
64
  * @return String HTML
65
  */
66
+ protected function confirmPage() {
67
  $value = $this->Form->getValue( $this->atts['name'] );
68
  $echo_value = '';
69
  if ( $this->atts['echo'] === 'true' ) {
71
  }
72
  return $echo_value . $this->Form->hidden( $this->atts['name'], $value );
73
  }
74
+ protected function previewPage() {
75
+ return $this->confirmPage();
76
+ }
77
 
78
  /**
79
  * add_qtags
form_fields/mw_form_field_image.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Image
4
  * URI: http://2inc.org
5
  * Description: 画像アップロードフィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: May 17, 2013
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -68,11 +68,11 @@ class mw_form_field_image extends mw_form_field {
68
  }
69
 
70
  /**
71
- * previewPage
72
  * 確認ページでのフォーム項目を返す
73
  * @return String HTML
74
  */
75
- protected function previewPage() {
76
  $value = $this->Form->getValue( $this->atts['name'] );
77
  if ( $value ) {
78
  $_ret = '<div class="' . MWF_Config::NAME . '_image">';
@@ -82,6 +82,9 @@ class mw_form_field_image extends mw_form_field {
82
  return $_ret;
83
  }
84
  }
 
 
 
85
 
86
  /**
87
  * add_qtags
3
  * Name: MW Form Field Image
4
  * URI: http://2inc.org
5
  * Description: 画像アップロードフィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : May 17, 2013
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
68
  }
69
 
70
  /**
71
+ * confirmPage
72
  * 確認ページでのフォーム項目を返す
73
  * @return String HTML
74
  */
75
+ protected function confirmPage() {
76
  $value = $this->Form->getValue( $this->atts['name'] );
77
  if ( $value ) {
78
  $_ret = '<div class="' . MWF_Config::NAME . '_image">';
82
  return $_ret;
83
  }
84
  }
85
+ protected function previewPage() {
86
+ return $this->confirmPage();
87
+ }
88
 
89
  /**
90
  * add_qtags
form_fields/mw_form_field_password.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Password
4
  * URI: http://2inc.org
5
  * Description: パスワードフィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -64,14 +64,17 @@ class mw_form_field_password extends mw_form_field {
64
  }
65
 
66
  /**
67
- * previewPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
- protected function previewPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  return '*****' . $this->Form->hidden( $this->atts['name'], $value );
74
  }
 
 
 
75
 
76
  /**
77
  * add_qtags
3
  * Name: MW Form Field Password
4
  * URI: http://2inc.org
5
  * Description: パスワードフィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
64
  }
65
 
66
  /**
67
+ * confirmPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
+ protected function confirmPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  return '*****' . $this->Form->hidden( $this->atts['name'], $value );
74
  }
75
+ protected function previewPage() {
76
+ return $this->confirmPage();
77
+ }
78
 
79
  /**
80
  * add_qtags
form_fields/mw_form_field_preview_button.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Preview Button
4
  * URI: http://2inc.org
5
  * Description: 確認ボタンを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -49,15 +49,18 @@ class mw_form_field_preview_button extends mw_form_field {
49
  * @return String HTML
50
  */
51
  protected function inputPage() {
52
- return $this->Form->submit( $this->Form->getPreviewButtonName(), $this->atts['value'] );
53
  }
54
 
55
  /**
56
- * previewPage
57
  * 確認ページでのフォーム項目を返す
58
  * @return String HTML
59
  */
 
 
60
  protected function previewPage() {
 
61
  }
62
 
63
  /**
3
  * Name: MW Form Field Preview Button
4
  * URI: http://2inc.org
5
  * Description: 確認ボタンを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: December 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
49
  * @return String HTML
50
  */
51
  protected function inputPage() {
52
+ return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['value'] );
53
  }
54
 
55
  /**
56
+ * confirmPage
57
  * 確認ページでのフォーム項目を返す
58
  * @return String HTML
59
  */
60
+ protected function confirmPage() {
61
+ }
62
  protected function previewPage() {
63
+ return $this->confirmPage();
64
  }
65
 
66
  /**
form_fields/mw_form_field_radio.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Radio
4
  * URI: http://2inc.org
5
  * Description: ラジオボタンを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -62,17 +62,20 @@ class mw_form_field_radio extends mw_form_field {
62
  }
63
 
64
  /**
65
- * previewPage
66
  * 確認ページでのフォーム項目を返す
67
  * @return String HTML
68
  */
69
- protected function previewPage() {
70
  $children = $this->getChildren( $this->atts['children'] );
71
  $value = $this->Form->getRadioValue( $this->atts['name'], $children );
72
  $_ret = $value;
73
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
74
  return $_ret;
75
  }
 
 
 
76
 
77
  /**
78
  * add_qtags
3
  * Name: MW Form Field Radio
4
  * URI: http://2inc.org
5
  * Description: ラジオボタンを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
62
  }
63
 
64
  /**
65
+ * confirmPage
66
  * 確認ページでのフォーム項目を返す
67
  * @return String HTML
68
  */
69
+ protected function confirmPage() {
70
  $children = $this->getChildren( $this->atts['children'] );
71
  $value = $this->Form->getRadioValue( $this->atts['name'], $children );
72
  $_ret = $value;
73
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
74
  return $_ret;
75
  }
76
+ protected function previewPage() {
77
+ return $this->confirmPage();
78
+ }
79
 
80
  /**
81
  * add_qtags
form_fields/mw_form_field_select.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Select
4
  * URI: http://2inc.org
5
  * Description: セレクトボックスを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -62,17 +62,20 @@ class mw_form_field_select extends mw_form_field {
62
  }
63
 
64
  /**
65
- * previewPage
66
  * 確認ページでのフォーム項目を返す
67
  * @return String HTML
68
  */
69
- protected function previewPage() {
70
  $children = $this->getChildren( $this->atts['children'] );
71
  $value = $this->Form->getSelectedValue( $this->atts['name'], $children );
72
  $_ret = $value;
73
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
74
  return $_ret;
75
  }
 
 
 
76
 
77
  /**
78
  * add_qtags
3
  * Name: MW Form Field Select
4
  * URI: http://2inc.org
5
  * Description: セレクトボックスを出力。
6
+ * Version: 1.2,1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
62
  }
63
 
64
  /**
65
+ * confirmPage
66
  * 確認ページでのフォーム項目を返す
67
  * @return String HTML
68
  */
69
+ protected function confirmPage() {
70
  $children = $this->getChildren( $this->atts['children'] );
71
  $value = $this->Form->getSelectedValue( $this->atts['name'], $children );
72
  $_ret = $value;
73
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
74
  return $_ret;
75
  }
76
+ protected function previewPage() {
77
+ return $this->confirmPage();
78
+ }
79
 
80
  /**
81
  * add_qtags
form_fields/mw_form_field_submit.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Submit Button
4
  * URI: http://2inc.org
5
  * Description: 送信ボタンを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -54,13 +54,16 @@ class mw_form_field_submit extends mw_form_field {
54
  }
55
 
56
  /**
57
- * previewPage
58
  * 確認ページでのフォーム項目を返す
59
  * @return String HTML
60
  */
61
- protected function previewPage() {
62
  return $this->inputPage( $this->atts );
63
  }
 
 
 
64
 
65
  /**
66
  * add_qtags
3
  * Name: MW Form Field Submit Button
4
  * URI: http://2inc.org
5
  * Description: 送信ボタンを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
54
  }
55
 
56
  /**
57
+ * confirmPage
58
  * 確認ページでのフォーム項目を返す
59
  * @return String HTML
60
  */
61
+ protected function confirmPage() {
62
  return $this->inputPage( $this->atts );
63
  }
64
+ protected function previewPage() {
65
+ return $this->confirmPage();
66
+ }
67
 
68
  /**
69
  * add_qtags
form_fields/mw_form_field_submit_button.php CHANGED
@@ -4,11 +4,11 @@
4
  * URI: http://2inc.org
5
  * Description: サブミットボタンを出力。
6
  * Description: 確認ボタンと送信ボタンを自動出力。
7
- * Version: 1.2
8
  * Author: Takashi Kitajima
9
  * Author URI: http://2inc.org
10
- * Created: December 14, 2012
11
- * Modified: Septermber 19, 2013
12
  * License: GPL2
13
  *
14
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -42,6 +42,7 @@ class mw_form_field_submit_button extends mw_form_field {
42
  return array(
43
  'name' => '',
44
  'preview_value' => __( 'Confirm', MWF_Config::DOMAIN ),
 
45
  'submit_value' => __( 'Send', MWF_Config::DOMAIN ),
46
  );
47
  }
@@ -52,20 +53,25 @@ class mw_form_field_submit_button extends mw_form_field {
52
  * @return String HTML
53
  */
54
  protected function inputPage() {
55
- if ( !empty( $this->atts['preview_value'] ) ) {
56
- return $this->Form->submit( $this->Form->getPreviewButtonName(), $this->atts['preview_value'] );
 
 
57
  }
58
  return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
59
  }
60
 
61
  /**
62
- * previewPage
63
  * 確認ページでのフォーム項目を返す
64
  * @return String HTML
65
  */
66
- protected function previewPage() {
67
  return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
68
  }
 
 
 
69
 
70
  /**
71
  * add_qtags
4
  * URI: http://2inc.org
5
  * Description: サブミットボタンを出力。
6
  * Description: 確認ボタンと送信ボタンを自動出力。
7
+ * Version: 1.2.1
8
  * Author: Takashi Kitajima
9
  * Author URI: http://2inc.org
10
+ * Created : December 14, 2012
11
+ * Modified: November 26, 2013
12
  * License: GPL2
13
  *
14
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
42
  return array(
43
  'name' => '',
44
  'preview_value' => __( 'Confirm', MWF_Config::DOMAIN ),
45
+ 'confirm_value' => __( 'Confirm', MWF_Config::DOMAIN ),
46
  'submit_value' => __( 'Send', MWF_Config::DOMAIN ),
47
  );
48
  }
53
  * @return String HTML
54
  */
55
  protected function inputPage() {
56
+ if ( !empty( $this->atts['confirm_value'] ) ) {
57
+ return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['confirm_value'] );
58
+ } elseif ( !empty( $this->atts['preview_value'] ) ) {
59
+ return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['preview_value'] );
60
  }
61
  return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
62
  }
63
 
64
  /**
65
+ * confirmPage
66
  * 確認ページでのフォーム項目を返す
67
  * @return String HTML
68
  */
69
+ protected function confirmPage() {
70
  return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
71
  }
72
+ protected function previewPage() {
73
+ return $this->confirmPage();
74
+ }
75
 
76
  /**
77
  * add_qtags
form_fields/mw_form_field_tel.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Tel
4
  * URI: http://2inc.org
5
  * Description: 電話番号フィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -57,17 +57,20 @@ class mw_form_field_tel extends mw_form_field {
57
  }
58
 
59
  /**
60
- * previewPage
61
  * 確認ページでのフォーム項目を返す
62
  * @return String HTML
63
  */
64
- protected function previewPage() {
65
  $value = $this->Form->getTelValue( $this->atts['name'] );
66
  $_ret = $value;
67
  $_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
68
  $_ret .= $this->Form->separator( $this->atts['name'] );
69
  return $_ret;
70
  }
 
 
 
71
 
72
  /**
73
  * add_qtags
3
  * Name: MW Form Field Tel
4
  * URI: http://2inc.org
5
  * Description: 電話番号フィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
57
  }
58
 
59
  /**
60
+ * confirmPage
61
  * 確認ページでのフォーム項目を返す
62
  * @return String HTML
63
  */
64
+ protected function confirmPage() {
65
  $value = $this->Form->getTelValue( $this->atts['name'] );
66
  $_ret = $value;
67
  $_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
68
  $_ret .= $this->Form->separator( $this->atts['name'] );
69
  return $_ret;
70
  }
71
+ protected function previewPage() {
72
+ return $this->confirmPage();
73
+ }
74
 
75
  /**
76
  * add_qtags
form_fields/mw_form_field_text.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Text
4
  * URI: http://2inc.org
5
  * Description: テキストフィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -64,16 +64,19 @@ class mw_form_field_text extends mw_form_field {
64
  }
65
 
66
  /**
67
- * previewPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
- protected function previewPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  $_ret = $value;
74
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
75
  return $_ret;
76
  }
 
 
 
77
 
78
  /**
79
  * add_qtags
3
  * Name: MW Form Field Text
4
  * URI: http://2inc.org
5
  * Description: テキストフィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 2, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
64
  }
65
 
66
  /**
67
+ * confirmPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
+ protected function confirmPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  $_ret = $value;
74
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
75
  return $_ret;
76
  }
77
+ protected function previewPage() {
78
+ return $this->confirmPage();
79
+ }
80
 
81
  /**
82
  * add_qtags
form_fields/mw_form_field_textarea.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field TextArea
4
  * URI: http://2inc.org
5
  * Description: テキストエリアを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -64,16 +64,19 @@ class mw_form_field_textarea extends mw_form_field {
64
  }
65
 
66
  /**
67
- * previewPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
- protected function previewPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  $_ret = nl2br( $value );
74
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
75
  return $_ret;
76
  }
 
 
 
77
 
78
  /**
79
  * add_qtags
3
  * Name: MW Form Field TextArea
4
  * URI: http://2inc.org
5
  * Description: テキストエリアを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
64
  }
65
 
66
  /**
67
+ * confirmPage
68
  * 確認ページでのフォーム項目を返す
69
  * @return String HTML
70
  */
71
+ protected function confirmPage() {
72
  $value = $this->Form->getValue( $this->atts['name'] );
73
  $_ret = nl2br( $value );
74
  $_ret .= $this->Form->hidden( $this->atts['name'], $value );
75
  return $_ret;
76
  }
77
+ protected function previewPage() {
78
+ return $this->confirmPage();
79
+ }
80
 
81
  /**
82
  * add_qtags
form_fields/mw_form_field_zip.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field Zip
4
  * URI: http://2inc.org
5
  * Description: 郵便番号フィールドを出力。
6
- * Version: 1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: Septermber 19, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -57,17 +57,20 @@ class mw_form_field_zip extends mw_form_field {
57
  }
58
 
59
  /**
60
- * previewPage
61
  * 確認ページでのフォーム項目を返す
62
  * @return String HTML
63
  */
64
- protected function previewPage() {
65
  $value = $this->Form->getZipValue( $this->atts['name'] );
66
  $_ret = $value;
67
  $_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
68
  $_ret .= $this->Form->separator( $this->atts['name'] );
69
  return $_ret;
70
  }
 
 
 
71
 
72
  /**
73
  * add_qtags
3
  * Name: MW Form Field Zip
4
  * URI: http://2inc.org
5
  * Description: 郵便番号フィールドを出力。
6
+ * Version: 1.2.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
57
  }
58
 
59
  /**
60
+ * confirmPage
61
  * 確認ページでのフォーム項目を返す
62
  * @return String HTML
63
  */
64
+ protected function confirmPage() {
65
  $value = $this->Form->getZipValue( $this->atts['name'] );
66
  $_ret = $value;
67
  $_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
68
  $_ret .= $this->Form->separator( $this->atts['name'] );
69
  return $_ret;
70
  }
71
+ protected function previewPage() {
72
+ return $this->confirmPage();
73
+ }
74
 
75
  /**
76
  * add_qtags
mw-wp-form.php CHANGED
@@ -3,11 +3,11 @@
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
5
  * Description: MW WP Form can create mail form with a confirmation screen.
6
- * Version: 1.1.2
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
- * Modified: November 22, 2013
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
@@ -34,7 +34,7 @@ class mw_wp_form {
34
 
35
  protected $key;
36
  protected $input;
37
- protected $preview;
38
  protected $complete;
39
  protected $validation_error;
40
  protected $Data;
@@ -216,7 +216,7 @@ class mw_wp_form {
216
  // フォームが定義されていない場合は終了
217
  if ( is_null( $this->key ) ||
218
  is_null( $this->input ) ||
219
- is_null( $this->preview ) ||
220
  is_null( $this->complete ) ||
221
  is_null( $this->validation_error ) )
222
  return;
@@ -250,11 +250,11 @@ class mw_wp_form {
250
  $this->redirect( $this->input );
251
  }
252
  // 確認画面のとき
253
- elseif ( $this->Form->isPreview() ) {
254
  if ( $this->Validation->check() ) {
255
- $this->viewFlg = 'preview';
256
  $this->fileUpload();
257
- $this->redirect( $this->preview );
258
  } else {
259
  if ( !empty( $this->validation_error ) ) {
260
  $this->redirect( $this->validation_error );
@@ -301,13 +301,13 @@ class mw_wp_form {
301
  /**
302
  * _meta_mwform
303
  * [mwform〜]を解析し、プロパティを設定
304
- * @param Array ( input, preview, complete, key )
305
  * @example
306
  * 同一画面変遷の場合
307
  * [mwform key="hoge"]〜[/mwform]
308
  * 別ページ画面変遷の場合
309
  * 確認画面ありの場合
310
- * 入力画面 : [mwform preview="/form_preview/" key="hoge"]〜[/mwform]
311
  * 確認画面 : [mwform input="/form_input/" complete="/form_complete/" key="hoge"]〜[/mwform]
312
  * 確認画面なしの場合
313
  * 入力画面 : [mwform complete="/form_complete/" key="hoge"]〜[/mwform]
@@ -316,13 +316,20 @@ class mw_wp_form {
316
  $atts = shortcode_atts( array(
317
  'input' => '',
318
  'preview' => '',
 
319
  'complete' => '',
320
  'validation_error' => '',
321
  'key' => 'mwform'
322
  ), $atts );
323
  $this->key = $atts['key'];
324
  $this->input = $this->parse_url( $atts['input'] );
325
- $this->preview = $this->parse_url( $atts['preview'] );
 
 
 
 
 
 
326
  $this->complete = $this->parse_url( $atts['complete'] );
327
  $this->validation_error = $this->parse_url( $atts['validation_error'] );
328
  }
@@ -347,7 +354,7 @@ class mw_wp_form {
347
  $this->options_by_formkey['post_id'] = $post->ID;
348
  $this->key = MWF_Config::NAME . '-' . $atts['key'];
349
  $this->input = $this->parse_url( $this->options_by_formkey['input_url'] );
350
- $this->preview = $this->parse_url( $this->options_by_formkey['confirmation_url'] );
351
  $this->complete = $this->parse_url( $this->options_by_formkey['complete_url'] );
352
  $this->validation_error = $this->parse_url( $this->options_by_formkey['validation_error_url'] );
353
  }
@@ -732,7 +739,7 @@ class mw_wp_form {
732
  setup_postdata( $post );
733
 
734
  // 入力画面・確認画面
735
- if ( $this->viewFlg == 'input' || $this->viewFlg == 'preview' ) {
736
  $_ret = do_shortcode( '[mwform]' . get_the_content() . '[/mwform]' );
737
  }
738
  // 完了画面
@@ -748,7 +755,7 @@ class mw_wp_form {
748
  * フォームを出力
749
  */
750
  public function _mwform( $atts, $content = '' ) {
751
- if ( $this->viewFlg == 'input' || $this->viewFlg == 'preview' ) {
752
  $this->Error = $this->Validation->Error();
753
  do_action( 'mwform_add_shortcode', $this->Form, $this->viewFlg, $this->Error, $this->key );
754
 
@@ -771,8 +778,9 @@ class mw_wp_form {
771
  $upload_file_hidden .= $this->Form->hidden( MWF_Config::UPLOAD_FILE_KEYS . '[]', $value );
772
  }
773
  }
 
774
  return
775
- '<div id="mw_wp_form_' . $this->key . '" class="mw_wp_form mw_wp_form_' . $this->viewFlg . '">' .
776
  $this->Form->start() .
777
  do_shortcode( $content ) .
778
  $upload_file_hidden .
3
  * Plugin Name: MW WP Form
4
  * Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
5
  * Description: MW WP Form can create mail form with a confirmation screen.
6
+ * Version: 1.1.3
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
+ * Modified: November 26, 2013
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPL2
34
 
35
  protected $key;
36
  protected $input;
37
+ protected $confirm;
38
  protected $complete;
39
  protected $validation_error;
40
  protected $Data;
216
  // フォームが定義されていない場合は終了
217
  if ( is_null( $this->key ) ||
218
  is_null( $this->input ) ||
219
+ is_null( $this->confirm ) ||
220
  is_null( $this->complete ) ||
221
  is_null( $this->validation_error ) )
222
  return;
250
  $this->redirect( $this->input );
251
  }
252
  // 確認画面のとき
253
+ elseif ( $this->Form->isConfirm() ) {
254
  if ( $this->Validation->check() ) {
255
+ $this->viewFlg = 'confirm';
256
  $this->fileUpload();
257
+ $this->redirect( $this->confirm );
258
  } else {
259
  if ( !empty( $this->validation_error ) ) {
260
  $this->redirect( $this->validation_error );
301
  /**
302
  * _meta_mwform
303
  * [mwform〜]を解析し、プロパティを設定
304
+ * @param Array ( input, preview, confirm complete, key )
305
  * @example
306
  * 同一画面変遷の場合
307
  * [mwform key="hoge"]〜[/mwform]
308
  * 別ページ画面変遷の場合
309
  * 確認画面ありの場合
310
+ * 入力画面 : [mwform confirm="/form_confirm/" key="hoge"]〜[/mwform]
311
  * 確認画面 : [mwform input="/form_input/" complete="/form_complete/" key="hoge"]〜[/mwform]
312
  * 確認画面なしの場合
313
  * 入力画面 : [mwform complete="/form_complete/" key="hoge"]〜[/mwform]
316
  $atts = shortcode_atts( array(
317
  'input' => '',
318
  'preview' => '',
319
+ 'confirm' => '',
320
  'complete' => '',
321
  'validation_error' => '',
322
  'key' => 'mwform'
323
  ), $atts );
324
  $this->key = $atts['key'];
325
  $this->input = $this->parse_url( $atts['input'] );
326
+ if ( $atts['confirm'] ) {
327
+ $this->confirm = $this->parse_url( $atts['confirm'] );
328
+ } elseif ( $atts['preview'] ) {
329
+ $this->confirm = $this->parse_url( $atts['preview'] );
330
+ } else {
331
+ $this->confirm = $this->parse_url( $atts['confirm'] );
332
+ }
333
  $this->complete = $this->parse_url( $atts['complete'] );
334
  $this->validation_error = $this->parse_url( $atts['validation_error'] );
335
  }
354
  $this->options_by_formkey['post_id'] = $post->ID;
355
  $this->key = MWF_Config::NAME . '-' . $atts['key'];
356
  $this->input = $this->parse_url( $this->options_by_formkey['input_url'] );
357
+ $this->confirm = $this->parse_url( $this->options_by_formkey['confirmation_url'] );
358
  $this->complete = $this->parse_url( $this->options_by_formkey['complete_url'] );
359
  $this->validation_error = $this->parse_url( $this->options_by_formkey['validation_error_url'] );
360
  }
739
  setup_postdata( $post );
740
 
741
  // 入力画面・確認画面
742
+ if ( $this->viewFlg == 'input' || $this->viewFlg == 'confirm' ) {
743
  $_ret = do_shortcode( '[mwform]' . get_the_content() . '[/mwform]' );
744
  }
745
  // 完了画面
755
  * フォームを出力
756
  */
757
  public function _mwform( $atts, $content = '' ) {
758
+ if ( $this->viewFlg == 'input' || $this->viewFlg == 'confirm' ) {
759
  $this->Error = $this->Validation->Error();
760
  do_action( 'mwform_add_shortcode', $this->Form, $this->viewFlg, $this->Error, $this->key );
761
 
778
  $upload_file_hidden .= $this->Form->hidden( MWF_Config::UPLOAD_FILE_KEYS . '[]', $value );
779
  }
780
  }
781
+ $_preview_class = ( $this->viewFlg === 'confirm' ) ? ' mw_wp_form_preview' : '';
782
  return
783
+ '<div id="mw_wp_form_' . $this->key . '" class="mw_wp_form mw_wp_form_' . $this->viewFlg . $_preview_class . '">' .
784
  $this->Form->start() .
785
  do_shortcode( $content ) .
786
  $upload_file_hidden .
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
4
  Tags: plugin, form, confirm, preview, shortcode
5
  Requires at least: 3.4
6
  Tested up to: 3.6.1
7
- Stable tag: 1.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -37,11 +37,21 @@ http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
37
 
38
  == Changelog ==
39
 
 
 
 
 
 
 
 
 
 
 
40
  = 1.1.2 =
41
- * TODO : メール件名にも{キー}が使用できるようにしたい
42
 
43
  = 1.1.1 =
44
- * Cahged : セッションまわりの処理をリファクタリング
45
 
46
  = 1.1.0 =
47
  * Added : mwform_value_識別子 フィルターフック追加
4
  Tags: plugin, form, confirm, preview, shortcode
5
  Requires at least: 3.4
6
  Tested up to: 3.6.1
7
+ Stable tag: 1.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
37
 
38
  == Changelog ==
39
 
40
+ = 1.1.3 =
41
+ * Deprecated: div.mw_wp_form_previewは次回のバージョンアップで削除予定(div.mw_wp_form_confirmに置換)
42
+ * Deprecated: MW_Form::previewPage()は次回のバージョンアップで削除予定(MW_Form::confirmPage()に置換)
43
+ * Deprecated: [mwform_submitButton]の引数preview_valueは次回のバージョンアップで削除予定(confirm_valueに置換)
44
+ * Deprecated: [mwform]の引数previewは次回のバージョンアップで削除予定(confirmに置換)
45
+ * Cahged : MW_Form::isPreview() -> MW_Form::isConfirm()
46
+ * Cahged : MW_Form::getPreviewButtonName() -> MW_Form::getConfirmButtonName()
47
+ * Added : mwform_default_content フィルターフック
48
+ * Added : mwform_default_postdata フィルターフック
49
+
50
  = 1.1.2 =
51
+ * Cahged : セッションまわりの処理をリファクタリング
52
 
53
  = 1.1.1 =
54
+ * Bug fix: ダウンロードしたCSVに全件表示されないバグを修正
55
 
56
  = 1.1.0 =
57
  * Added : mwform_value_識別子 フィルターフック追加
system/mw_form.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form
4
  * URI: http://2inc.org
5
  * Description: フォームクラス
6
- * Version: 1.3.5
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: September 25, 2012
10
- * Modified: November 22, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -32,6 +32,7 @@ class MW_Form {
32
  protected $token; // トークンの値
33
  protected $data; // データ
34
  protected $Session; // sessionオブジェクト
 
35
  protected $previewButton = 'submitPreview'; // 確認ボタンの名前
36
  protected $backButton = 'submitBack'; // 戻るボタンの名前
37
  protected $modeCheck = 'input';
@@ -55,7 +56,7 @@ class MW_Form {
55
  $this->Session->save( array( $this->tokenName => $this->token ) );
56
  }
57
  // 戻る、確認画面へのポスト、完了画面へのポストでないときはデータを破棄
58
- if ( !( isset( $this->data[$this->backButton] ) || $this->isPreview() || $this->isComplete() ) ) {
59
  // フォームオブジェクト再生成
60
  $this->data = array();
61
  }
@@ -85,12 +86,12 @@ class MW_Form {
85
  }
86
 
87
  /**
88
- * isPreview
89
  * 確認画面かどうか
90
  * @return Boolean
91
  */
92
- public function isPreview() {
93
- if ( !empty( $this->data ) && $this->modeCheck === 'preview' )
94
  return true;
95
  return false;
96
  }
@@ -109,20 +110,22 @@ class MW_Form {
109
  /**
110
  * modeCheck
111
  * 表示画面判定
112
- * @return input || preview || complete
113
  */
114
  protected function modeCheck() {
115
  if ( isset( $this->data[$this->backButton] ) ) {
116
  $backButton = $this->data[$this->backButton];
 
 
117
  } elseif ( isset( $this->data[$this->previewButton] ) ) {
118
- $previewButton = $this->data[$this->previewButton];
119
  }
120
  $_ret = 'input';
121
  if ( isset( $backButton ) ) {
122
  $_ret = 'input';
123
- } elseif ( isset( $previewButton ) ) {
124
- $_ret = 'preview';
125
- } elseif ( !isset( $previewButton ) && !isset( $backButton ) && $this->check() ) {
126
  $_ret = 'complete';
127
  }
128
  return $_ret;
@@ -149,12 +152,12 @@ class MW_Form {
149
  }
150
 
151
  /**
152
- * getPreviewButtonName
153
  * 確認画面への変遷用ボタンのname属性値を返す
154
  * @return String name属性値
155
  */
156
- public function getPreviewButtonName() {
157
- return $this->previewButton;
158
  }
159
 
160
  /**
3
  * Name: MW Form
4
  * URI: http://2inc.org
5
  * Description: フォームクラス
6
+ * Version: 1.3.6
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : September 25, 2012
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
32
  protected $token; // トークンの値
33
  protected $data; // データ
34
  protected $Session; // sessionオブジェクト
35
+ protected $confirmButton = 'submitConfirm'; // 確認ボタンの名前
36
  protected $previewButton = 'submitPreview'; // 確認ボタンの名前
37
  protected $backButton = 'submitBack'; // 戻るボタンの名前
38
  protected $modeCheck = 'input';
56
  $this->Session->save( array( $this->tokenName => $this->token ) );
57
  }
58
  // 戻る、確認画面へのポスト、完了画面へのポストでないときはデータを破棄
59
+ if ( !( isset( $this->data[$this->backButton] ) || $this->isConfirm() || $this->isComplete() ) ) {
60
  // フォームオブジェクト再生成
61
  $this->data = array();
62
  }
86
  }
87
 
88
  /**
89
+ * isConfirm
90
  * 確認画面かどうか
91
  * @return Boolean
92
  */
93
+ public function isConfirm() {
94
+ if ( !empty( $this->data ) && $this->modeCheck === 'confirm' )
95
  return true;
96
  return false;
97
  }
110
  /**
111
  * modeCheck
112
  * 表示画面判定
113
+ * @return input || confirm || complete
114
  */
115
  protected function modeCheck() {
116
  if ( isset( $this->data[$this->backButton] ) ) {
117
  $backButton = $this->data[$this->backButton];
118
+ } elseif ( isset( $this->data[$this->confirmButton] ) ) {
119
+ $confirmButton = $this->data[$this->confirmButton];
120
  } elseif ( isset( $this->data[$this->previewButton] ) ) {
121
+ $confirmButton = $this->data[$this->previewButton];
122
  }
123
  $_ret = 'input';
124
  if ( isset( $backButton ) ) {
125
  $_ret = 'input';
126
+ } elseif ( isset( $confirmButton ) ) {
127
+ $_ret = 'confirm';
128
+ } elseif ( !isset( $confirmButton ) && !isset( $backButton ) && $this->check() ) {
129
  $_ret = 'complete';
130
  }
131
  return $_ret;
152
  }
153
 
154
  /**
155
+ * getConfirmButtonName
156
  * 確認画面への変遷用ボタンのname属性値を返す
157
  * @return String name属性値
158
  */
159
+ public function getConfirmButtonName() {
160
+ return $this->confirmButton;
161
  }
162
 
163
  /**
system/mw_form_field.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW Form Field
4
  * URI: http://2inc.org
5
  * Description: フォームフィールドの抽象クラス
6
- * Version: 1.3
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
- * Created: December 14, 2012
10
- * Modified: December 5, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -104,15 +104,18 @@ abstract class mw_form_field {
104
  }
105
 
106
  /**
107
- * previewPage
108
  * 確認ページでのフォーム項目を返す
109
  * @param Array $atts
110
  * @return String HTML
111
  */
112
- abstract protected function previewPage();
113
- public function _previewPage( $atts ) {
114
  $this->atts = shortcode_atts( $this->defaults, $atts );
115
- return $this->previewPage();
 
 
 
116
  }
117
 
118
  /**
@@ -132,8 +135,8 @@ abstract class mw_form_field {
132
  case 'input' :
133
  add_shortcode( $this->short_code_name, array( $this, '_inputPage' ) );
134
  break;
135
- case 'preview' :
136
- add_shortcode( $this->short_code_name, array( $this, '_previewPage' ) );
137
  break;
138
  default :
139
  exit( '$viewFlg is not right value.' );
3
  * Name: MW Form Field
4
  * URI: http://2inc.org
5
  * Description: フォームフィールドの抽象クラス
6
+ * Version: 1.3.1
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
+ * Created : December 14, 2012
10
+ * Modified: December 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
104
  }
105
 
106
  /**
107
+ * confirmPage
108
  * 確認ページでのフォーム項目を返す
109
  * @param Array $atts
110
  * @return String HTML
111
  */
112
+ abstract protected function confirmPage();
113
+ public function _confirmPage( $atts ) {
114
  $this->atts = shortcode_atts( $this->defaults, $atts );
115
+ return $this->confirmPage();
116
+ }
117
+ protected function previewPage() {
118
+ return $this->confirmPage();
119
  }
120
 
121
  /**
135
  case 'input' :
136
  add_shortcode( $this->short_code_name, array( $this, '_inputPage' ) );
137
  break;
138
+ case 'confirm' :
139
+ add_shortcode( $this->short_code_name, array( $this, '_confirmPage' ) );
140
  break;
141
  default :
142
  exit( '$viewFlg is not right value.' );
system/mw_wp_form_admin_page.php CHANGED
@@ -3,11 +3,11 @@
3
  * Name: MW WP Form Admin Page
4
  * URI: http://2inc.org
5
  * Description: 管理画面クラス
6
- * Version: 1.6.0
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : February 21, 2013
10
- * Modified: December 5, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
@@ -39,6 +39,7 @@ class MW_WP_Form_Admin_Page {
39
  add_action( 'save_post', array( $this, 'save_post' ) );
40
  add_action( 'admin_print_footer_scripts', array( $this, 'add_quicktag' ) );
41
  add_action( 'current_screen', array( $this, 'current_screen' ) );
 
42
  }
43
 
44
  /**
@@ -60,8 +61,26 @@ class MW_WP_Form_Admin_Page {
60
  * フォームの設定データを返す
61
  */
62
  protected function get_post_data( $key ) {
 
63
  if ( isset( $this->postdata[$key] ) ) {
64
  return $this->postdata[$key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
  }
67
 
@@ -172,8 +191,8 @@ class MW_WP_Form_Admin_Page {
172
  $post_type = get_post_type();
173
  if ( MWF_Config::NAME == $post_type ) {
174
  $url = plugin_dir_url( __FILE__ );
175
- wp_register_style( MWF_Config::DOMAIN.'-admin', $url.'../css/admin.css' );
176
- wp_enqueue_style( MWF_Config::DOMAIN.'-admin' );
177
  }
178
  }
179
 
@@ -184,8 +203,8 @@ class MW_WP_Form_Admin_Page {
184
  public function admin_scripts() {
185
  if ( MWF_Config::NAME == get_post_type() ) {
186
  $url = plugin_dir_url( __FILE__ );
187
- wp_register_script( MWF_Config::DOMAIN.'-admin', $url.'../js/admin.js' );
188
- wp_enqueue_script( MWF_Config::DOMAIN.'-admin' );
189
  }
190
  }
191
 
3
  * Name: MW WP Form Admin Page
4
  * URI: http://2inc.org
5
  * Description: 管理画面クラス
6
+ * Version: 1.7.0
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : February 21, 2013
10
+ * Modified: November 26, 2013
11
  * License: GPL2
12
  *
13
  * Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
39
  add_action( 'save_post', array( $this, 'save_post' ) );
40
  add_action( 'admin_print_footer_scripts', array( $this, 'add_quicktag' ) );
41
  add_action( 'current_screen', array( $this, 'current_screen' ) );
42
+ add_filter( 'default_content', array( $this, 'default_content' ) );
43
  }
44
 
45
  /**
61
  * フォームの設定データを返す
62
  */
63
  protected function get_post_data( $key ) {
64
+ global $post;
65
  if ( isset( $this->postdata[$key] ) ) {
66
  return $this->postdata[$key];
67
+ } else {
68
+ $date = $post->post_date;
69
+ $modified = $post->post_modified;
70
+ if ( $date === $modified ){
71
+ return apply_filters( 'mwform_default_postdata', '', $key );
72
+ }
73
+ }
74
+ }
75
+
76
+ /**
77
+ * default_content
78
+ * 本文の初期値を設定
79
+ */
80
+ public function default_content( $content ) {
81
+ global $typenow;
82
+ if ( $typenow === MWF_Config::NAME ) {
83
+ return apply_filters( 'mwform_default_content', '' );
84
  }
85
  }
86
 
191
  $post_type = get_post_type();
192
  if ( MWF_Config::NAME == $post_type ) {
193
  $url = plugin_dir_url( __FILE__ );
194
+ wp_register_style( MWF_Config::DOMAIN . '-admin', $url . '../css/admin.css' );
195
+ wp_enqueue_style( MWF_Config::DOMAIN . '-admin' );
196
  }
197
  }
198
 
203
  public function admin_scripts() {
204
  if ( MWF_Config::NAME == get_post_type() ) {
205
  $url = plugin_dir_url( __FILE__ );
206
+ wp_register_script( MWF_Config::DOMAIN . '-admin', $url . '../js/admin.js' );
207
+ wp_enqueue_script( MWF_Config::DOMAIN . '-admin' );
208
  }
209
  }
210