Version Description
- Added : Add mwform_validation_rules filter hook.
- Added : Add API to get the data for mail.
- Added : Add setting of response status in saved contact data.
- Added : Add response status and memo in csv.
- Added : Add returning link from detail of database saving data to list page.
- Changed : Form field is empty if seted null in value of shortcode.
- Changed : WordPress 3.7 higher is required.
Download this release
Release Info
Developer | inc2734 |
Plugin | MW WP Form |
Version | 1.8.0 |
Comparing to | |
See all releases |
Code changes from version 1.7.2 to 1.8.0
- css/admin.css +11 -2
- form_fields/mw_form_field_akismet_error.php +8 -23
- form_fields/mw_form_field_back_button.php +8 -23
- form_fields/mw_form_field_button.php +8 -23
- form_fields/mw_form_field_checkbox.php +7 -22
- form_fields/mw_form_field_confirm_button.php +8 -23
- form_fields/mw_form_field_datepicker.php +8 -23
- form_fields/mw_form_field_error.php +8 -23
- form_fields/mw_form_field_file.php +6 -21
- form_fields/mw_form_field_hidden.php +8 -23
- form_fields/mw_form_field_image.php +6 -21
- form_fields/mw_form_field_password.php +8 -23
- form_fields/mw_form_field_radio.php +7 -22
- form_fields/mw_form_field_select.php +7 -22
- form_fields/mw_form_field_submit.php +8 -23
- form_fields/mw_form_field_submit_button.php +8 -24
- form_fields/mw_form_field_tel.php +8 -23
- form_fields/mw_form_field_text.php +11 -26
- form_fields/mw_form_field_textarea.php +6 -21
- form_fields/mw_form_field_zip.php +8 -23
- languages/mw-wp-form-ja.mo +0 -0
- languages/mw-wp-form-ja.po +357 -330
- languages/mw-wp-form.pot +333 -308
- mw-wp-form.php +73 -52
- readme.txt +12 -3
- system/mw_akismet.php +26 -36
- system/mw_error.php +7 -19
- system/mw_form.php +64 -82
- system/mw_form_field.php +19 -37
- system/mw_mail.php +47 -32
- system/mw_session.php +24 -44
- system/mw_validation.php +35 -560
- system/mw_validation_rule.php +61 -0
- system/mw_wp_form_admin_page.php +41 -77
- system/mw_wp_form_contact_data_page.php +185 -80
- system/mw_wp_form_data.php +84 -21
- system/mw_wp_form_file.php +23 -37
- system/mwf_config.php +4 -19
- system/mwf_functions.php +28 -19
- validation_rules/mw_validation_rule_akismet.php +41 -0
- validation_rules/mw_validation_rule_alpha.php +49 -0
- validation_rules/mw_validation_rule_alphanumeric.php +49 -0
- validation_rules/mw_validation_rule_between.php +73 -0
- validation_rules/mw_validation_rule_date.php +54 -0
- validation_rules/mw_validation_rule_eq.php +56 -0
- validation_rules/mw_validation_rule_filesize.php +58 -0
- validation_rules/mw_validation_rule_filetype.php +61 -0
- validation_rules/mw_validation_rule_hiragana.php +49 -0
- validation_rules/mw_validation_rule_in.php +47 -0
- validation_rules/mw_validation_rule_katakana.php +49 -0
- validation_rules/mw_validation_rule_mail.php +49 -0
- validation_rules/mw_validation_rule_minlength.php +56 -0
- validation_rules/mw_validation_rule_noempty.php +47 -0
- validation_rules/mw_validation_rule_nofalse.php +44 -0
- validation_rules/mw_validation_rule_numeric.php +49 -0
- validation_rules/mw_validation_rule_required.php +49 -0
- validation_rules/mw_validation_rule_tel.php +55 -0
- validation_rules/mw_validation_rule_url.php +49 -0
- validation_rules/mw_validation_rule_zip.php +49 -0
css/admin.css
CHANGED
@@ -46,6 +46,7 @@ span#formkey_field {
|
|
46 |
* URL設定
|
47 |
*/
|
48 |
#mw-wp-form_url table {
|
|
|
49 |
width: 100%;
|
50 |
}
|
51 |
#mw-wp-form_url table th {
|
@@ -81,6 +82,7 @@ span#formkey_field {
|
|
81 |
display: none;
|
82 |
}
|
83 |
#mw-wp-form_validation .validation-box table {
|
|
|
84 |
margin: 10px 0 0;
|
85 |
}
|
86 |
#mw-wp-form_validation .validation-box table td {
|
@@ -96,6 +98,13 @@ span#formkey_field {
|
|
96 |
#mw-wp-form_validation .validation-box table td label input {
|
97 |
margin: 0 2px 0 0;
|
98 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
|
100 |
/**
|
101 |
* 設定
|
@@ -248,11 +257,11 @@ span#formkey_field {
|
|
248 |
display: none;
|
249 |
font-size: 12px;
|
250 |
}
|
251 |
-
.mwform-dialog form p {
|
252 |
margin: 0 0 10px;
|
253 |
padding: 0;
|
254 |
}
|
255 |
-
.mwform-dialog form p strong {
|
256 |
display: block;
|
257 |
font-weight: bold;
|
258 |
margin: 0 0 5px;
|
46 |
* URL設定
|
47 |
*/
|
48 |
#mw-wp-form_url table {
|
49 |
+
font-size: 100%;
|
50 |
width: 100%;
|
51 |
}
|
52 |
#mw-wp-form_url table th {
|
82 |
display: none;
|
83 |
}
|
84 |
#mw-wp-form_validation .validation-box table {
|
85 |
+
font-size: 100%;
|
86 |
margin: 10px 0 0;
|
87 |
}
|
88 |
#mw-wp-form_validation .validation-box table td {
|
98 |
#mw-wp-form_validation .validation-box table td label input {
|
99 |
margin: 0 2px 0 0;
|
100 |
}
|
101 |
+
#mw-wp-form_validation .validation-box table td table {
|
102 |
+
clear: both;
|
103 |
+
margin: 0;
|
104 |
+
}
|
105 |
+
#mw-wp-form_validation .validation-box table td table td {
|
106 |
+
padding-bottom: 0;
|
107 |
+
}
|
108 |
|
109 |
/**
|
110 |
* 設定
|
257 |
display: none;
|
258 |
font-size: 12px;
|
259 |
}
|
260 |
+
.mwform-dialog .form p {
|
261 |
margin: 0 0 10px;
|
262 |
padding: 0;
|
263 |
}
|
264 |
+
.mwform-dialog .form p strong {
|
265 |
display: block;
|
266 |
font-weight: bold;
|
267 |
margin: 0 0 5px;
|
form_fields/mw_form_field_akismet_error.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Akismet Error
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: Akismetのエラーを出力。
|
6 |
-
* Version: 1.3.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : June 21, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_akismet_error extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array();
|
@@ -51,7 +36,7 @@ class mw_form_field_akismet_error extends mw_form_field {
|
|
51 |
/**
|
52 |
* inputPage
|
53 |
* 入力ページでのフォーム項目を返す
|
54 |
-
* @return
|
55 |
*/
|
56 |
protected function inputPage() {
|
57 |
return '<div class="akismet_error">' . $this->getError( MWF_Config::AKISMET ) . '</div>';
|
@@ -60,7 +45,7 @@ class mw_form_field_akismet_error extends mw_form_field {
|
|
60 |
/**
|
61 |
* confirmPage
|
62 |
* 確認ページでのフォーム項目を返す
|
63 |
-
* @return
|
64 |
*/
|
65 |
protected function confirmPage() {
|
66 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Akismet Error
|
|
|
4 |
* Description: Akismetのエラーを出力。
|
5 |
+
* Version: 1.3.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : June 21, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Akismet_Error extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array();
|
36 |
/**
|
37 |
* inputPage
|
38 |
* 入力ページでのフォーム項目を返す
|
39 |
+
* @return string HTML
|
40 |
*/
|
41 |
protected function inputPage() {
|
42 |
return '<div class="akismet_error">' . $this->getError( MWF_Config::AKISMET ) . '</div>';
|
45 |
/**
|
46 |
* confirmPage
|
47 |
* 確認ページでのフォーム項目を返す
|
48 |
+
* @return string HTML
|
49 |
*/
|
50 |
protected function confirmPage() {
|
51 |
}
|
form_fields/mw_form_field_back_button.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Back Button
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 戻るボタンを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_back_button extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -53,7 +38,7 @@ class mw_form_field_back_button extends mw_form_field {
|
|
53 |
/**
|
54 |
* inputPage
|
55 |
* 入力ページでのフォーム項目を返す
|
56 |
-
* @return
|
57 |
*/
|
58 |
protected function inputPage() {
|
59 |
}
|
@@ -61,7 +46,7 @@ class mw_form_field_back_button extends mw_form_field {
|
|
61 |
/**
|
62 |
* confirmPage
|
63 |
* 確認ページでのフォーム項目を返す
|
64 |
-
* @return
|
65 |
*/
|
66 |
protected function confirmPage() {
|
67 |
return $this->Form->submit( $this->Form->getBackButtonName(), $this->atts['value'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Back Button
|
|
|
4 |
* Description: 戻るボタンを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Back_Button extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
38 |
/**
|
39 |
* inputPage
|
40 |
* 入力ページでのフォーム項目を返す
|
41 |
+
* @return string HTML
|
42 |
*/
|
43 |
protected function inputPage() {
|
44 |
}
|
46 |
/**
|
47 |
* confirmPage
|
48 |
* 確認ページでのフォーム項目を返す
|
49 |
+
* @return string HTML
|
50 |
*/
|
51 |
protected function confirmPage() {
|
52 |
return $this->Form->submit( $this->Form->getBackButtonName(), $this->atts['value'] );
|
form_fields/mw_form_field_button.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Button
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: ボタンを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_button extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -54,7 +39,7 @@ class mw_form_field_button extends mw_form_field {
|
|
54 |
/**
|
55 |
* inputPage
|
56 |
* 入力ページでのフォーム項目を返す
|
57 |
-
* @return
|
58 |
*/
|
59 |
protected function inputPage() {
|
60 |
return $this->Form->button( $this->atts['name'], $this->atts['value'] );
|
@@ -63,7 +48,7 @@ class mw_form_field_button extends mw_form_field {
|
|
63 |
/**
|
64 |
* confirmPage
|
65 |
* 確認ページでのフォーム項目を返す
|
66 |
-
* @return
|
67 |
*/
|
68 |
protected function confirmPage() {
|
69 |
return $this->inputPage();
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Button
|
|
|
4 |
* Description: ボタンを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Button extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
39 |
/**
|
40 |
* inputPage
|
41 |
* 入力ページでのフォーム項目を返す
|
42 |
+
* @return string HTML
|
43 |
*/
|
44 |
protected function inputPage() {
|
45 |
return $this->Form->button( $this->atts['name'], $this->atts['value'] );
|
48 |
/**
|
49 |
* confirmPage
|
50 |
* 確認ページでのフォーム項目を返す
|
51 |
+
* @return string HTML
|
52 |
*/
|
53 |
protected function confirmPage() {
|
54 |
return $this->inputPage();
|
form_fields/mw_form_field_checkbox.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Checkbox
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: チェックボックスを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_checkbox extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -74,7 +59,7 @@ class mw_form_field_checkbox extends mw_form_field {
|
|
74 |
/**
|
75 |
* confirmPage
|
76 |
* 確認ページでのフォーム項目を返す
|
77 |
-
* @return
|
78 |
*/
|
79 |
protected function confirmPage() {
|
80 |
$children = $this->getChildren( $this->atts['children'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Checkbox
|
|
|
4 |
* Description: チェックボックスを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Checkbox extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
59 |
/**
|
60 |
* confirmPage
|
61 |
* 確認ページでのフォーム項目を返す
|
62 |
+
* @return string HTML
|
63 |
*/
|
64 |
protected function confirmPage() {
|
65 |
$children = $this->getChildren( $this->atts['children'] );
|
form_fields/mw_form_field_confirm_button.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Confirm Button
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 確認ボタンを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_confirm_button extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -53,7 +38,7 @@ class mw_form_field_confirm_button extends mw_form_field {
|
|
53 |
/**
|
54 |
* inputPage
|
55 |
* 入力ページでのフォーム項目を返す
|
56 |
-
* @return
|
57 |
*/
|
58 |
protected function inputPage() {
|
59 |
return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['value'] );
|
@@ -62,7 +47,7 @@ class mw_form_field_confirm_button extends mw_form_field {
|
|
62 |
/**
|
63 |
* confirmPage
|
64 |
* 確認ページでのフォーム項目を返す
|
65 |
-
* @return
|
66 |
*/
|
67 |
protected function confirmPage() {
|
68 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Confirm Button
|
|
|
4 |
* Description: 確認ボタンを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Confirm_Button extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
38 |
/**
|
39 |
* inputPage
|
40 |
* 入力ページでのフォーム項目を返す
|
41 |
+
* @return string HTML
|
42 |
*/
|
43 |
protected function inputPage() {
|
44 |
return $this->Form->submit( $this->Form->getConfirmButtonName(), $this->atts['value'] );
|
47 |
/**
|
48 |
* confirmPage
|
49 |
* 確認ページでのフォーム項目を返す
|
50 |
+
* @return string HTML
|
51 |
*/
|
52 |
protected function confirmPage() {
|
53 |
}
|
form_fields/mw_form_field_datepicker.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Datepicker
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: datepickerを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_datepicker extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -58,7 +43,7 @@ class mw_form_field_datepicker extends mw_form_field {
|
|
58 |
/**
|
59 |
* inputPage
|
60 |
* 入力ページでのフォーム項目を返す
|
61 |
-
* @return
|
62 |
*/
|
63 |
protected function inputPage() {
|
64 |
global $wp_scripts;
|
@@ -98,7 +83,7 @@ class mw_form_field_datepicker extends mw_form_field {
|
|
98 |
/**
|
99 |
* confirmPage
|
100 |
* 確認ページでのフォーム項目を返す
|
101 |
-
* @return
|
102 |
*/
|
103 |
protected function confirmPage() {
|
104 |
$value = $this->Form->getValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Datepicker
|
|
|
4 |
* Description: datepickerを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Datepicker extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
43 |
/**
|
44 |
* inputPage
|
45 |
* 入力ページでのフォーム項目を返す
|
46 |
+
* @return string HTML
|
47 |
*/
|
48 |
protected function inputPage() {
|
49 |
global $wp_scripts;
|
83 |
/**
|
84 |
* confirmPage
|
85 |
* 確認ページでのフォーム項目を返す
|
86 |
+
* @return string HTML
|
87 |
*/
|
88 |
protected function confirmPage() {
|
89 |
$value = $this->Form->getValue( $this->atts['name'] );
|
form_fields/mw_form_field_error.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Error
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: エラーを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_error extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -53,7 +38,7 @@ class mw_form_field_error extends mw_form_field {
|
|
53 |
/**
|
54 |
* inputPage
|
55 |
* 入力ページでのフォーム項目を返す
|
56 |
-
* @return
|
57 |
*/
|
58 |
protected function inputPage() {
|
59 |
$keys = explode( ',', $this->atts['keys'] );
|
@@ -67,7 +52,7 @@ class mw_form_field_error extends mw_form_field {
|
|
67 |
/**
|
68 |
* confirmPage
|
69 |
* 確認ページでのフォーム項目を返す
|
70 |
-
* @return
|
71 |
*/
|
72 |
protected function confirmPage() {
|
73 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Error
|
|
|
4 |
* Description: エラーを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Error extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
38 |
/**
|
39 |
* inputPage
|
40 |
* 入力ページでのフォーム項目を返す
|
41 |
+
* @return string HTML
|
42 |
*/
|
43 |
protected function inputPage() {
|
44 |
$keys = explode( ',', $this->atts['keys'] );
|
52 |
/**
|
53 |
* confirmPage
|
54 |
* 確認ページでのフォーム項目を返す
|
55 |
+
* @return string HTML
|
56 |
*/
|
57 |
protected function confirmPage() {
|
58 |
}
|
form_fields/mw_form_field_file.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field File
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : May 17, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_file extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field File
|
|
|
4 |
* Description: 画像アップロードフィールドを出力。
|
5 |
+
* Version: 1.4.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : May 17, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_File extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
form_fields/mw_form_field_hidden.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Hidden
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: hiddenフィールドを出力。
|
6 |
-
* Version: 1.5.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_hidden extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -55,7 +40,7 @@ class mw_form_field_hidden extends mw_form_field {
|
|
55 |
/**
|
56 |
* inputPage
|
57 |
* 入力ページでのフォーム項目を返す
|
58 |
-
* @return
|
59 |
*/
|
60 |
protected function inputPage() {
|
61 |
$echo_value = '';
|
@@ -68,7 +53,7 @@ class mw_form_field_hidden extends mw_form_field {
|
|
68 |
/**
|
69 |
* confirmPage
|
70 |
* 確認ページでのフォーム項目を返す
|
71 |
-
* @return
|
72 |
*/
|
73 |
protected function confirmPage() {
|
74 |
$value = $this->Form->getValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Hidden
|
|
|
4 |
* Description: hiddenフィールドを出力。
|
5 |
+
* Version: 1.5.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Hidden extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
40 |
/**
|
41 |
* inputPage
|
42 |
* 入力ページでのフォーム項目を返す
|
43 |
+
* @return string HTML
|
44 |
*/
|
45 |
protected function inputPage() {
|
46 |
$echo_value = '';
|
53 |
/**
|
54 |
* confirmPage
|
55 |
* 確認ページでのフォーム項目を返す
|
56 |
+
* @return string HTML
|
57 |
*/
|
58 |
protected function confirmPage() {
|
59 |
$value = $this->Form->getValue( $this->atts['name'] );
|
form_fields/mw_form_field_image.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Image
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : May 17, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_image extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Image
|
|
|
4 |
* Description: 画像アップロードフィールドを出力。
|
5 |
+
* Version: 1.4.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : May 17, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Image extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
form_fields/mw_form_field_password.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Password
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: パスワードフィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_password extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -59,7 +44,7 @@ class mw_form_field_password extends mw_form_field {
|
|
59 |
/**
|
60 |
* inputPage
|
61 |
* 入力ページでのフォーム項目を返す
|
62 |
-
* @return
|
63 |
*/
|
64 |
protected function inputPage() {
|
65 |
$_ret = $this->Form->password( $this->atts['name'], array(
|
@@ -77,7 +62,7 @@ class mw_form_field_password extends mw_form_field {
|
|
77 |
/**
|
78 |
* confirmPage
|
79 |
* 確認ページでのフォーム項目を返す
|
80 |
-
* @return
|
81 |
*/
|
82 |
protected function confirmPage() {
|
83 |
$value = $this->Form->getValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Password
|
|
|
4 |
* Description: パスワードフィールドを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Password extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
44 |
/**
|
45 |
* inputPage
|
46 |
* 入力ページでのフォーム項目を返す
|
47 |
+
* @return string HTML
|
48 |
*/
|
49 |
protected function inputPage() {
|
50 |
$_ret = $this->Form->password( $this->atts['name'], array(
|
62 |
/**
|
63 |
* confirmPage
|
64 |
* 確認ページでのフォーム項目を返す
|
65 |
+
* @return string HTML
|
66 |
*/
|
67 |
protected function confirmPage() {
|
68 |
$value = $this->Form->getValue( $this->atts['name'] );
|
form_fields/mw_form_field_radio.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Radio
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: ラジオボタンを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_radio extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -73,7 +58,7 @@ class mw_form_field_radio extends mw_form_field {
|
|
73 |
/**
|
74 |
* confirmPage
|
75 |
* 確認ページでのフォーム項目を返す
|
76 |
-
* @return
|
77 |
*/
|
78 |
protected function confirmPage() {
|
79 |
$children = $this->getChildren( $this->atts['children'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Radio
|
|
|
4 |
* Description: ラジオボタンを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Radio extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
58 |
/**
|
59 |
* confirmPage
|
60 |
* 確認ページでのフォーム項目を返す
|
61 |
+
* @return string HTML
|
62 |
*/
|
63 |
protected function confirmPage() {
|
64 |
$children = $this->getChildren( $this->atts['children'] );
|
form_fields/mw_form_field_select.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Select
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: セレクトボックスを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_select extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -73,7 +58,7 @@ class mw_form_field_select extends mw_form_field {
|
|
73 |
/**
|
74 |
* confirmPage
|
75 |
* 確認ページでのフォーム項目を返す
|
76 |
-
* @return
|
77 |
*/
|
78 |
protected function confirmPage() {
|
79 |
$children = $this->getChildren( $this->atts['children'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Select
|
|
|
4 |
* Description: セレクトボックスを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Select extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
58 |
/**
|
59 |
* confirmPage
|
60 |
* 確認ページでのフォーム項目を返す
|
61 |
+
* @return string HTML
|
62 |
*/
|
63 |
protected function confirmPage() {
|
64 |
$children = $this->getChildren( $this->atts['children'] );
|
form_fields/mw_form_field_submit.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Submit Button
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 送信ボタンを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_submit extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -54,7 +39,7 @@ class mw_form_field_submit extends mw_form_field {
|
|
54 |
/**
|
55 |
* inputPage
|
56 |
* 入力ページでのフォーム項目を返す
|
57 |
-
* @return
|
58 |
*/
|
59 |
protected function inputPage() {
|
60 |
return $this->Form->submit( $this->atts['name'], $this->atts['value'] );
|
@@ -63,7 +48,7 @@ class mw_form_field_submit extends mw_form_field {
|
|
63 |
/**
|
64 |
* confirmPage
|
65 |
* 確認ページでのフォーム項目を返す
|
66 |
-
* @return
|
67 |
*/
|
68 |
protected function confirmPage() {
|
69 |
return $this->inputPage( $this->atts );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Submit Button
|
|
|
4 |
* Description: 送信ボタンを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Submit extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
39 |
/**
|
40 |
* inputPage
|
41 |
* 入力ページでのフォーム項目を返す
|
42 |
+
* @return string HTML
|
43 |
*/
|
44 |
protected function inputPage() {
|
45 |
return $this->Form->submit( $this->atts['name'], $this->atts['value'] );
|
48 |
/**
|
49 |
* confirmPage
|
50 |
* 確認ページでのフォーム項目を返す
|
51 |
+
* @return string HTML
|
52 |
*/
|
53 |
protected function confirmPage() {
|
54 |
return $this->inputPage( $this->atts );
|
form_fields/mw_form_field_submit_button.php
CHANGED
@@ -1,32 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Submit
|
4 |
-
* URI: http://2inc.org
|
5 |
-
* Description: サブミットボタンを出力。
|
6 |
* Description: 確認ボタンと送信ボタンを自動出力。
|
7 |
-
* Version: 1.4.
|
8 |
* Author: Takashi Kitajima
|
9 |
* Author URI: http://2inc.org
|
10 |
* Created : December 14, 2012
|
11 |
-
* Modified:
|
12 |
-
* License:
|
13 |
-
*
|
14 |
-
* Copyright 2014 Takashi Kitajima (email : inc@2inc.org)
|
15 |
-
*
|
16 |
-
* This program is free software; you can redistribute it and/or modify
|
17 |
-
* it under the terms of the GNU General Public License, version 2, as
|
18 |
-
* published by the Free Software Foundation.
|
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
28 |
*/
|
29 |
-
class
|
30 |
|
31 |
/**
|
32 |
* set_names
|
@@ -43,7 +27,7 @@ class mw_form_field_submit_button extends mw_form_field {
|
|
43 |
/**
|
44 |
* setDefaults
|
45 |
* $this->defaultsを設定し返す
|
46 |
-
* @return
|
47 |
*/
|
48 |
protected function setDefaults() {
|
49 |
return array(
|
@@ -56,7 +40,7 @@ class mw_form_field_submit_button extends mw_form_field {
|
|
56 |
/**
|
57 |
* inputPage
|
58 |
* 入力ページでのフォーム項目を返す
|
59 |
-
* @return
|
60 |
*/
|
61 |
protected function inputPage() {
|
62 |
if ( !empty( $this->atts['confirm_value'] ) ) {
|
@@ -68,7 +52,7 @@ class mw_form_field_submit_button extends mw_form_field {
|
|
68 |
/**
|
69 |
* confirmPage
|
70 |
* 確認ページでのフォーム項目を返す
|
71 |
-
* @return
|
72 |
*/
|
73 |
protected function confirmPage() {
|
74 |
return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Submit
|
|
|
|
|
4 |
* Description: 確認ボタンと送信ボタンを自動出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Submit_Button extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
40 |
/**
|
41 |
* inputPage
|
42 |
* 入力ページでのフォーム項目を返す
|
43 |
+
* @return string HTML
|
44 |
*/
|
45 |
protected function inputPage() {
|
46 |
if ( !empty( $this->atts['confirm_value'] ) ) {
|
52 |
/**
|
53 |
* confirmPage
|
54 |
* 確認ページでのフォーム項目を返す
|
55 |
+
* @return string HTML
|
56 |
*/
|
57 |
protected function confirmPage() {
|
58 |
return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
|
form_fields/mw_form_field_tel.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Tel
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 電話番号フィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_tel extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -55,7 +40,7 @@ class mw_form_field_tel extends mw_form_field {
|
|
55 |
/**
|
56 |
* inputPage
|
57 |
* 入力ページでのフォーム項目を返す
|
58 |
-
* @return
|
59 |
*/
|
60 |
protected function inputPage() {
|
61 |
$conv_half_alphanumeric = false;
|
@@ -71,7 +56,7 @@ class mw_form_field_tel extends mw_form_field {
|
|
71 |
/**
|
72 |
* confirmPage
|
73 |
* 確認ページでのフォーム項目を返す
|
74 |
-
* @return
|
75 |
*/
|
76 |
protected function confirmPage() {
|
77 |
$value = $this->Form->getTelValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Tel
|
|
|
4 |
* Description: 電話番号フィールドを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Tel extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
40 |
/**
|
41 |
* inputPage
|
42 |
* 入力ページでのフォーム項目を返す
|
43 |
+
* @return string HTML
|
44 |
*/
|
45 |
protected function inputPage() {
|
46 |
$conv_half_alphanumeric = false;
|
56 |
/**
|
57 |
* confirmPage
|
58 |
* 確認ページでのフォーム項目を返す
|
59 |
+
* @return string HTML
|
60 |
*/
|
61 |
protected function confirmPage() {
|
62 |
$value = $this->Form->getTelValue( $this->atts['name'] );
|
form_fields/mw_form_field_text.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Text
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: テキストフィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -68,11 +53,11 @@ class mw_form_field_text extends mw_form_field {
|
|
68 |
$conv_half_alphanumeric = true;
|
69 |
}
|
70 |
$_ret = $this->Form->text( $this->atts['name'], array(
|
71 |
-
'id'
|
72 |
-
'size'
|
73 |
-
'maxlength' => $this->atts['maxlength'],
|
74 |
-
'value'
|
75 |
-
'placeholder'
|
76 |
'conv-half-alphanumeric' => $conv_half_alphanumeric,
|
77 |
) );
|
78 |
if ( $this->atts['show_error'] !== 'false' )
|
@@ -83,7 +68,7 @@ class mw_form_field_text extends mw_form_field {
|
|
83 |
/**
|
84 |
* confirmPage
|
85 |
* 確認ページでのフォーム項目を返す
|
86 |
-
* @return
|
87 |
*/
|
88 |
protected function confirmPage() {
|
89 |
$value = $this->Form->getValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Text
|
|
|
4 |
* Description: テキストフィールドを出力。
|
5 |
+
* Version: 1.4.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Text extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
53 |
$conv_half_alphanumeric = true;
|
54 |
}
|
55 |
$_ret = $this->Form->text( $this->atts['name'], array(
|
56 |
+
'id' => $this->atts['id'],
|
57 |
+
'size' => $this->atts['size'],
|
58 |
+
'maxlength ' => $this->atts['maxlength'],
|
59 |
+
'value' => $this->atts['value'],
|
60 |
+
'placeholder' => $this->atts['placeholder'],
|
61 |
'conv-half-alphanumeric' => $conv_half_alphanumeric,
|
62 |
) );
|
63 |
if ( $this->atts['show_error'] !== 'false' )
|
68 |
/**
|
69 |
* confirmPage
|
70 |
* 確認ページでのフォーム項目を返す
|
71 |
+
* @return string HTML
|
72 |
*/
|
73 |
protected function confirmPage() {
|
74 |
$value = $this->Form->getValue( $this->atts['name'] );
|
form_fields/mw_form_field_textarea.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field TextArea
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: テキストエリアを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -77,7 +62,7 @@ class mw_form_field_textarea extends mw_form_field {
|
|
77 |
/**
|
78 |
* confirmPage
|
79 |
* 確認ページでのフォーム項目を返す
|
80 |
-
* @return
|
81 |
*/
|
82 |
protected function confirmPage() {
|
83 |
$value = $this->Form->getValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field TextArea
|
|
|
4 |
* Description: テキストエリアを出力。
|
5 |
+
* Version: 1.4.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Textarea extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
62 |
/**
|
63 |
* confirmPage
|
64 |
* 確認ページでのフォーム項目を返す
|
65 |
+
* @return string HTML
|
66 |
*/
|
67 |
protected function confirmPage() {
|
68 |
$value = $this->Form->getValue( $this->atts['name'] );
|
form_fields/mw_form_field_zip.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Zip
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 郵便番号フィールドを出力。
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
29 |
|
30 |
/**
|
31 |
* set_names
|
@@ -42,7 +27,7 @@ class mw_form_field_zip extends mw_form_field {
|
|
42 |
/**
|
43 |
* setDefaults
|
44 |
* $this->defaultsを設定し返す
|
45 |
-
* @return
|
46 |
*/
|
47 |
protected function setDefaults() {
|
48 |
return array(
|
@@ -55,7 +40,7 @@ class mw_form_field_zip extends mw_form_field {
|
|
55 |
/**
|
56 |
* inputPage
|
57 |
* 入力ページでのフォーム項目を返す
|
58 |
-
* @return
|
59 |
*/
|
60 |
protected function inputPage() {
|
61 |
$conv_half_alphanumeric = false;
|
@@ -71,7 +56,7 @@ class mw_form_field_zip extends mw_form_field {
|
|
71 |
/**
|
72 |
* confirmPage
|
73 |
* 確認ページでのフォーム項目を返す
|
74 |
-
* @return
|
75 |
*/
|
76 |
protected function confirmPage() {
|
77 |
$value = $this->Form->getZipValue( $this->atts['name'] );
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field Zip
|
|
|
4 |
* Description: 郵便番号フィールドを出力。
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_Form_Field_Zip extends MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* set_names
|
27 |
/**
|
28 |
* setDefaults
|
29 |
* $this->defaultsを設定し返す
|
30 |
+
* @return array defaults
|
31 |
*/
|
32 |
protected function setDefaults() {
|
33 |
return array(
|
40 |
/**
|
41 |
* inputPage
|
42 |
* 入力ページでのフォーム項目を返す
|
43 |
+
* @return string HTML
|
44 |
*/
|
45 |
protected function inputPage() {
|
46 |
$conv_half_alphanumeric = false;
|
56 |
/**
|
57 |
* confirmPage
|
58 |
* 確認ページでのフォーム項目を返す
|
59 |
+
* @return string HTML
|
60 |
*/
|
61 |
protected function confirmPage() {
|
62 |
$value = $this->Form->getZipValue( $this->atts['name'] );
|
languages/mw-wp-form-ja.mo
CHANGED
Binary file
|
languages/mw-wp-form-ja.po
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
# This file is distributed under the same license as the MW WP Form package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MW WP Form 1.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
-
"POT-Creation-Date: 2014-
|
8 |
-
"PO-Revision-Date: 2014-
|
9 |
"Last-Translator: Takashi Kitajima <inc@2inc.org>\n"
|
10 |
"Language-Team: Takashi Kitajima <inc@2inc.org>\n"
|
11 |
"Language: ja\n"
|
@@ -15,392 +15,317 @@ msgstr ""
|
|
15 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
"X-Poedit-Basepath: .\n"
|
18 |
-
"X-Generator: Poedit 1.6.
|
19 |
"X-Poedit-KeywordsList: __;_e;_x\n"
|
20 |
"X-Poedit-SearchPath-0: ..\n"
|
21 |
|
22 |
-
#: form_fields/mw_form_field_akismet_error.php:
|
23 |
msgid "Akismet Error"
|
24 |
msgstr "Akismetエラー"
|
25 |
|
26 |
-
#: form_fields/mw_form_field_back_button.php:
|
27 |
-
#: form_fields/mw_form_field_back_button.php:
|
28 |
msgid "Back"
|
29 |
msgstr "戻る"
|
30 |
|
31 |
-
#: form_fields/mw_form_field_back_button.php:
|
32 |
-
#: form_fields/mw_form_field_button.php:
|
33 |
-
#: form_fields/mw_form_field_submit.php:
|
34 |
msgid "String on the button"
|
35 |
msgstr "ボタンに表示する文字列"
|
36 |
|
37 |
-
#: form_fields/mw_form_field_back_button.php:
|
38 |
-
#: form_fields/mw_form_field_button.php:
|
39 |
-
#: form_fields/mw_form_field_checkbox.php:
|
40 |
-
#: form_fields/mw_form_field_checkbox.php:
|
41 |
-
#: form_fields/mw_form_field_checkbox.php:
|
42 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
43 |
-
#: form_fields/mw_form_field_datepicker.php:
|
44 |
-
#: form_fields/mw_form_field_datepicker.php:
|
45 |
-
#: form_fields/mw_form_field_datepicker.php:
|
46 |
-
#: form_fields/mw_form_field_datepicker.php:
|
47 |
-
#: form_fields/mw_form_field_file.php:
|
48 |
-
#: form_fields/mw_form_field_file.php:
|
49 |
-
#: form_fields/mw_form_field_hidden.php:
|
50 |
-
#: form_fields/mw_form_field_image.php:
|
51 |
-
#: form_fields/mw_form_field_image.php:
|
52 |
-
#: form_fields/mw_form_field_password.php:
|
53 |
-
#: form_fields/mw_form_field_password.php:
|
54 |
-
#: form_fields/mw_form_field_password.php:
|
55 |
-
#: form_fields/mw_form_field_password.php:
|
56 |
-
#: form_fields/mw_form_field_password.php:
|
57 |
-
#: form_fields/mw_form_field_radio.php:
|
58 |
-
#: form_fields/mw_form_field_radio.php:
|
59 |
-
#: form_fields/mw_form_field_radio.php:
|
60 |
-
#: form_fields/mw_form_field_select.php:
|
61 |
-
#: form_fields/mw_form_field_select.php:
|
62 |
-
#: form_fields/mw_form_field_select.php:
|
63 |
-
#: form_fields/mw_form_field_submit.php:
|
64 |
-
#: form_fields/mw_form_field_text.php:
|
65 |
-
#: form_fields/mw_form_field_text.php:
|
66 |
-
#: form_fields/mw_form_field_text.php:
|
67 |
-
#: form_fields/mw_form_field_text.php:
|
68 |
-
#: form_fields/
|
69 |
-
#: form_fields/mw_form_field_textarea.php:
|
70 |
-
#: form_fields/mw_form_field_textarea.php:
|
71 |
-
#: form_fields/mw_form_field_textarea.php:
|
72 |
-
#: form_fields/mw_form_field_textarea.php:
|
73 |
-
#: form_fields/mw_form_field_textarea.php:116
|
74 |
msgid "option"
|
75 |
msgstr "オプション"
|
76 |
|
77 |
-
#: form_fields/mw_form_field_button.php:
|
78 |
msgid "Button"
|
79 |
msgstr "ボタン"
|
80 |
|
81 |
-
#: form_fields/mw_form_field_checkbox.php:
|
82 |
msgid "Checkbox"
|
83 |
msgstr "チェックボックス"
|
84 |
|
85 |
-
#: form_fields/mw_form_field_checkbox.php:
|
86 |
-
#: form_fields/mw_form_field_radio.php:
|
87 |
-
#: form_fields/mw_form_field_select.php:
|
88 |
msgid "Choices"
|
89 |
msgstr "選択肢"
|
90 |
|
91 |
-
#: form_fields/mw_form_field_checkbox.php:
|
92 |
-
#: form_fields/mw_form_field_error.php:
|
93 |
-
#: form_fields/mw_form_field_radio.php:
|
94 |
-
#: form_fields/mw_form_field_select.php:
|
95 |
msgid "Input one line about one item."
|
96 |
msgstr "1項目につき1行で入力してください。"
|
97 |
|
98 |
-
#: form_fields/mw_form_field_checkbox.php:
|
99 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
100 |
-
#: form_fields/mw_form_field_datepicker.php:
|
101 |
-
#: form_fields/mw_form_field_hidden.php:
|
102 |
-
#: form_fields/mw_form_field_password.php:
|
103 |
-
#: form_fields/mw_form_field_radio.php:
|
104 |
-
#: form_fields/mw_form_field_select.php:
|
105 |
-
#: form_fields/mw_form_field_text.php:
|
106 |
-
#: form_fields/mw_form_field_textarea.php:
|
107 |
msgid "Default value"
|
108 |
msgstr "初期値"
|
109 |
|
110 |
-
#: form_fields/mw_form_field_checkbox.php:
|
111 |
-
#: form_fields/mw_form_field_datepicker.php:
|
112 |
-
#: form_fields/mw_form_field_file.php:
|
113 |
-
#: form_fields/mw_form_field_image.php:
|
114 |
-
#: form_fields/mw_form_field_password.php:
|
115 |
-
#: form_fields/mw_form_field_radio.php:
|
116 |
-
#: form_fields/mw_form_field_select.php:
|
117 |
-
#: form_fields/mw_form_field_tel.php:
|
118 |
-
#: form_fields/mw_form_field_textarea.php:
|
119 |
-
#: form_fields/mw_form_field_zip.php:
|
120 |
msgid "Dsiplay error"
|
121 |
msgstr "エラー表示"
|
122 |
|
123 |
-
#: form_fields/mw_form_field_checkbox.php:
|
124 |
-
#: form_fields/mw_form_field_datepicker.php:
|
125 |
-
#: form_fields/mw_form_field_file.php:
|
126 |
-
#: form_fields/mw_form_field_image.php:
|
127 |
-
#: form_fields/mw_form_field_password.php:
|
128 |
-
#: form_fields/mw_form_field_radio.php:
|
129 |
-
#: form_fields/mw_form_field_select.php:
|
130 |
-
#: form_fields/mw_form_field_tel.php:
|
131 |
-
#: form_fields/mw_form_field_textarea.php:
|
132 |
-
#: form_fields/mw_form_field_zip.php:
|
133 |
msgid "Don't display error."
|
134 |
msgstr "エラーを表示しない"
|
135 |
|
136 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
137 |
msgid "Confirm Button"
|
138 |
msgstr "確認ボタン"
|
139 |
|
140 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
141 |
-
#: form_fields/mw_form_field_submit_button.php:
|
142 |
msgid "Confirm"
|
143 |
msgstr "確認画面へ"
|
144 |
|
145 |
-
#: form_fields/mw_form_field_datepicker.php:
|
146 |
msgid "Datepicker"
|
147 |
msgstr "日付"
|
148 |
|
149 |
-
#: form_fields/mw_form_field_error.php:
|
150 |
msgid "Error Message"
|
151 |
msgstr "エラーメッセージ"
|
152 |
|
153 |
-
#: form_fields/mw_form_field_error.php:
|
154 |
msgid "name of the element which wants to display error"
|
155 |
msgstr "エラーを表示したい要素のname属性"
|
156 |
|
157 |
-
#: form_fields/mw_form_field_file.php:
|
158 |
msgid "File"
|
159 |
msgstr "ファイルフィールド"
|
160 |
|
161 |
-
#: form_fields/mw_form_field_file.php:
|
162 |
msgid "Uploaded."
|
163 |
msgstr "アップロードしました。"
|
164 |
|
165 |
-
#: form_fields/mw_form_field_hidden.php:
|
166 |
msgid "Hidden"
|
167 |
msgstr "hiddenフィールド"
|
168 |
|
169 |
-
#: form_fields/mw_form_field_hidden.php:
|
170 |
msgid "Display"
|
171 |
msgstr "表示する"
|
172 |
|
173 |
-
#: form_fields/mw_form_field_hidden.php:
|
174 |
msgid "Display hidden value."
|
175 |
msgstr "hiddenの値を表示"
|
176 |
|
177 |
-
#: form_fields/mw_form_field_image.php:
|
178 |
msgid "Image"
|
179 |
msgstr "画像フィールド"
|
180 |
|
181 |
-
#: form_fields/mw_form_field_password.php:
|
182 |
msgid "Password"
|
183 |
msgstr "パスワードフィールド"
|
184 |
|
185 |
-
#: form_fields/mw_form_field_radio.php:
|
186 |
msgid "Radio"
|
187 |
msgstr "ラジオボタン"
|
188 |
|
189 |
-
#: form_fields/mw_form_field_select.php:
|
190 |
msgid "Select"
|
191 |
msgstr "セレクトボックス"
|
192 |
|
193 |
-
#: form_fields/mw_form_field_submit.php:
|
194 |
msgid "Submit Button"
|
195 |
msgstr "送信ボタン"
|
196 |
|
197 |
-
#: form_fields/mw_form_field_submit.php:
|
198 |
-
#: form_fields/mw_form_field_submit_button.php:
|
199 |
msgid "Send"
|
200 |
msgstr "送信する"
|
201 |
|
202 |
-
#: form_fields/mw_form_field_submit_button.php:
|
203 |
msgid "Confirm & Submit"
|
204 |
msgstr "確認・送信"
|
205 |
|
206 |
-
#: form_fields/mw_form_field_submit_button.php:
|
207 |
msgid "String on the confirm button"
|
208 |
msgstr "確認ボタンに表示する文字列"
|
209 |
|
210 |
-
#: form_fields/mw_form_field_submit_button.php:
|
211 |
msgid "String on the submit button"
|
212 |
msgstr "送信ボタンに表示する文字列"
|
213 |
|
214 |
-
#: form_fields/mw_form_field_tel.php:
|
|
|
215 |
msgid "Tel"
|
216 |
msgstr "電話番号"
|
217 |
|
218 |
-
#: form_fields/mw_form_field_tel.php:
|
219 |
-
#: form_fields/mw_form_field_zip.php:
|
220 |
msgid "Convert half alphanumeric"
|
221 |
msgstr "半角英数字に変換"
|
222 |
|
223 |
-
#: form_fields/mw_form_field_tel.php:
|
224 |
msgid "Don't Convert."
|
225 |
msgstr "変換しない"
|
226 |
|
227 |
-
#: form_fields/mw_form_field_text.php:
|
228 |
msgid "Text"
|
229 |
msgstr "テキストフィールド"
|
230 |
|
231 |
-
#: form_fields/mw_form_field_text.php:
|
232 |
msgid "Convert."
|
233 |
msgstr "変換する"
|
234 |
|
235 |
-
#: form_fields/mw_form_field_textarea.php:
|
236 |
msgid "Textarea"
|
237 |
msgstr "テキストエリア"
|
238 |
|
239 |
-
#: form_fields/mw_form_field_zip.php:
|
|
|
240 |
msgid "Zip Code"
|
241 |
msgstr "郵便番号"
|
242 |
|
243 |
-
#: mw-wp-form.php:
|
244 |
msgid "Validation Object is not a MW Validation Class."
|
245 |
msgstr ""
|
246 |
|
247 |
-
#: system/
|
248 |
-
msgid "This is required."
|
249 |
-
msgstr "必須項目です。"
|
250 |
-
|
251 |
-
#: system/mw_validation.php:98 system/mw_validation.php:116
|
252 |
-
msgid "Please enter."
|
253 |
-
msgstr "未入力です。"
|
254 |
-
|
255 |
-
#: system/mw_validation.php:138
|
256 |
-
msgid "Please enter with a half-width alphabetic character."
|
257 |
-
msgstr "半角英字で入力してください。"
|
258 |
-
|
259 |
-
#: system/mw_validation.php:161
|
260 |
-
msgid "Please enter with a half-width number."
|
261 |
-
msgstr "半角数字で入力してください。"
|
262 |
-
|
263 |
-
#: system/mw_validation.php:184
|
264 |
-
msgid "Please enter with a half-width alphanumeric character."
|
265 |
-
msgstr "半角英数字で入力してください。"
|
266 |
-
|
267 |
-
#: system/mw_validation.php:207
|
268 |
-
msgid "Please enter with a Japanese Katakana."
|
269 |
-
msgstr "カタカナで入力してください。"
|
270 |
-
|
271 |
-
#: system/mw_validation.php:230
|
272 |
-
msgid "Please enter with a Japanese Hiragana."
|
273 |
-
msgstr "ひらがなで入力してください。"
|
274 |
-
|
275 |
-
#: system/mw_validation.php:249
|
276 |
-
msgid "This is not the format of a zip code."
|
277 |
-
msgstr "郵便番号の形式ではありません。"
|
278 |
-
|
279 |
-
#: system/mw_validation.php:272
|
280 |
-
msgid "This is not the format of a tel number."
|
281 |
-
msgstr "電話番号の形式ではありません。"
|
282 |
-
|
283 |
-
#: system/mw_validation.php:305
|
284 |
-
msgid "This is not the format of a mail address."
|
285 |
-
msgstr "メールアドレスの形式ではありません。"
|
286 |
-
|
287 |
-
#: system/mw_validation.php:328
|
288 |
-
msgid "This is not the format of a url."
|
289 |
-
msgstr "URLの形式ではありません。"
|
290 |
-
|
291 |
-
#: system/mw_validation.php:348
|
292 |
-
msgid "This is not in agreement."
|
293 |
-
msgstr "一致しません。"
|
294 |
-
|
295 |
-
#: system/mw_validation.php:374
|
296 |
-
msgid "The number of characters is invalid."
|
297 |
-
msgstr "文字数が正しくありません。"
|
298 |
-
|
299 |
-
#: system/mw_validation.php:411
|
300 |
-
msgid "The number of characters is a few."
|
301 |
-
msgstr "文字数が足りません。"
|
302 |
-
|
303 |
-
#: system/mw_validation.php:436
|
304 |
-
msgid "This value is invalid."
|
305 |
-
msgstr "値が不正です。"
|
306 |
-
|
307 |
-
#: system/mw_validation.php:459
|
308 |
-
msgid "This is not the format of a date."
|
309 |
-
msgstr "日付の形式ではありません。"
|
310 |
-
|
311 |
-
#: system/mw_validation.php:488
|
312 |
-
msgid "This file is invalid."
|
313 |
-
msgstr "許可されたファイルではありません。"
|
314 |
-
|
315 |
-
#: system/mw_validation.php:517
|
316 |
-
msgid "This file size is too big."
|
317 |
-
msgstr "ファイルサイズが大きすぎます。"
|
318 |
-
|
319 |
-
#: system/mw_validation.php:536
|
320 |
-
msgid "The contents which you input were judged with spam."
|
321 |
-
msgstr "あなたの入力した内容はスパムと判定されました。"
|
322 |
-
|
323 |
-
#: system/mw_wp_form_admin_page.php:57
|
324 |
msgid "Your contribution is needed for making this plugin better."
|
325 |
msgstr "あなたの貢献があればこのプラグインをもっと良くすることができます。"
|
326 |
|
327 |
-
#: system/mw_wp_form_admin_page.php:
|
328 |
msgid "Donate"
|
329 |
msgstr "寄付する"
|
330 |
|
331 |
-
#: system/mw_wp_form_admin_page.php:
|
332 |
msgid "Add New Form"
|
333 |
msgstr "フォームを追加"
|
334 |
|
335 |
-
#: system/mw_wp_form_admin_page.php:
|
336 |
msgid "Edit Form"
|
337 |
msgstr "フォームを編集"
|
338 |
|
339 |
-
#: system/mw_wp_form_admin_page.php:
|
340 |
msgid "New Form"
|
341 |
msgstr "新しいフォーム"
|
342 |
|
343 |
-
#: system/mw_wp_form_admin_page.php:
|
344 |
msgid "View Form"
|
345 |
msgstr "フォームを表示"
|
346 |
|
347 |
-
#: system/mw_wp_form_admin_page.php:
|
348 |
msgid "Search Forms"
|
349 |
msgstr "フォームを検索"
|
350 |
|
351 |
-
#: system/mw_wp_form_admin_page.php:
|
352 |
msgid "No Forms found"
|
353 |
msgstr "フォームがありません"
|
354 |
|
355 |
-
#: system/mw_wp_form_admin_page.php:
|
356 |
msgid "No Forms found in Trash"
|
357 |
msgstr "ゴミ箱にフォームはありません"
|
358 |
|
359 |
-
#: system/mw_wp_form_admin_page.php:
|
360 |
msgid "Complete Message"
|
361 |
msgstr "完了画面メッセージ"
|
362 |
|
363 |
-
#: system/mw_wp_form_admin_page.php:
|
364 |
msgid "URL Options"
|
365 |
msgstr "URL設定"
|
366 |
|
367 |
-
#: system/mw_wp_form_admin_page.php:
|
368 |
msgid "Validation Rule"
|
369 |
msgstr "バリデーションルール"
|
370 |
|
371 |
-
#: system/mw_wp_form_admin_page.php:
|
372 |
msgid "Form Key"
|
373 |
msgstr "フォーム識別子"
|
374 |
|
375 |
-
#: system/mw_wp_form_admin_page.php:
|
376 |
msgid "Automatic Reply Email Options"
|
377 |
msgstr "自動返信メール設定"
|
378 |
|
379 |
-
#: system/mw_wp_form_admin_page.php:
|
380 |
msgid "Admin Email Options"
|
381 |
msgstr "管理者宛メール設定"
|
382 |
|
383 |
-
#: system/mw_wp_form_admin_page.php:
|
384 |
msgid "settings"
|
385 |
msgstr "設定"
|
386 |
|
387 |
-
#: system/mw_wp_form_admin_page.php:
|
388 |
msgid "Style setting"
|
389 |
msgstr "スタイル設定"
|
390 |
|
391 |
-
#: system/mw_wp_form_admin_page.php:
|
392 |
msgid "Copy and Paste this shortcode."
|
393 |
msgstr "このショートコードをコピー&ペーストしてください。"
|
394 |
|
395 |
-
#: system/mw_wp_form_admin_page.php:
|
396 |
msgid "The key to use with hook is "
|
397 |
msgstr "各フックで使用する修飾子は"
|
398 |
|
399 |
-
#: system/mw_wp_form_admin_page.php:
|
400 |
msgid "Activate Query string of post"
|
401 |
msgstr "URL引数を有効にする"
|
402 |
|
403 |
-
#: system/mw_wp_form_admin_page.php:
|
404 |
msgid ""
|
405 |
"If this field is active, MW WP Form get query string. And get post data from "
|
406 |
"query string \"post_id\". You can use $post's property in editor."
|
@@ -409,59 +334,59 @@ msgstr ""
|
|
409 |
"とに投稿を取得します。その投稿($post) のプロパティを使用できるようになりま"
|
410 |
"す。"
|
411 |
|
412 |
-
#: system/mw_wp_form_admin_page.php:
|
413 |
msgid "Example: {ID}, {post_title}, {post_meta} etc..."
|
414 |
msgstr "例:{ID}、{post_title}、{post_meta}など…"
|
415 |
|
416 |
-
#: system/mw_wp_form_admin_page.php:
|
417 |
msgid "Saving inquiry data in database"
|
418 |
msgstr "問い合わせデータをデータベースに保存"
|
419 |
|
420 |
-
#: system/mw_wp_form_admin_page.php:
|
421 |
msgid "Akismet Setting"
|
422 |
msgstr "Akismet 設定"
|
423 |
|
424 |
-
#: system/mw_wp_form_admin_page.php:
|
425 |
msgid "Input the key to use Akismet."
|
426 |
msgstr "Akismetを使用する項目のキーを入力してください。"
|
427 |
|
428 |
-
#: system/mw_wp_form_admin_page.php:
|
429 |
msgid "{key} is converted form data."
|
430 |
msgstr "{キー}でそのフォーム項目に変換されます。"
|
431 |
|
432 |
-
#: system/mw_wp_form_admin_page.php:
|
433 |
msgid "Subject"
|
434 |
msgstr "件名"
|
435 |
|
436 |
-
#: system/mw_wp_form_admin_page.php:
|
437 |
msgid "Sender"
|
438 |
msgstr "送信者"
|
439 |
|
440 |
-
#: system/mw_wp_form_admin_page.php:
|
441 |
-
#: system/mw_wp_form_admin_page.php:
|
442 |
-
#: system/mw_wp_form_admin_page.php:
|
443 |
msgid "If empty:"
|
444 |
msgstr "未入力の場合:"
|
445 |
|
446 |
-
#: system/mw_wp_form_admin_page.php:
|
447 |
msgid "From ( E-mail address )"
|
448 |
msgstr "送信元(E-mailアドレス)"
|
449 |
|
450 |
-
#: system/mw_wp_form_admin_page.php:
|
451 |
msgid "Content"
|
452 |
msgstr "本文"
|
453 |
|
454 |
-
#: system/mw_wp_form_admin_page.php:
|
455 |
msgid "Automatic reply email"
|
456 |
msgstr "自動返信メール"
|
457 |
|
458 |
-
#: system/mw_wp_form_admin_page.php:
|
459 |
msgid ""
|
460 |
"Input the key to use as transmission to automatic reply email. {} is "
|
461 |
"unnecessary."
|
462 |
msgstr "自動返信メールに使用する項目のキーを入力してください。{ }は不要です。"
|
463 |
|
464 |
-
#: system/mw_wp_form_admin_page.php:
|
465 |
msgid ""
|
466 |
"If Admin Email Options is a blank, Automatic Replay Email Options is used as "
|
467 |
"Admin Email Options."
|
@@ -469,35 +394,35 @@ msgstr ""
|
|
469 |
"管理者宛メール設定が空のときは自動返信メール設定に管理者宛メール設定が使用さ"
|
470 |
"れます。"
|
471 |
|
472 |
-
#: system/mw_wp_form_admin_page.php:
|
473 |
msgid "To ( E-mail address )"
|
474 |
msgstr "送信先(E-mailアドレス)"
|
475 |
|
476 |
-
#: system/mw_wp_form_admin_page.php:
|
477 |
msgid "CC ( E-mail address )"
|
478 |
msgstr "CC(E-mailアドレス)"
|
479 |
|
480 |
-
#: system/mw_wp_form_admin_page.php:
|
481 |
msgid "BCC ( E-mail address )"
|
482 |
msgstr "BCC(E-mailアドレス)"
|
483 |
|
484 |
-
#: system/mw_wp_form_admin_page.php:
|
485 |
msgid "Input Page URL"
|
486 |
msgstr "入力画面URL"
|
487 |
|
488 |
-
#: system/mw_wp_form_admin_page.php:
|
489 |
msgid "Confirmation Page URL"
|
490 |
msgstr "確認画面URL"
|
491 |
|
492 |
-
#: system/mw_wp_form_admin_page.php:
|
493 |
msgid "Complete Page URL"
|
494 |
msgstr "完了画面URL"
|
495 |
|
496 |
-
#: system/mw_wp_form_admin_page.php:
|
497 |
msgid "Validation Error Page URL"
|
498 |
msgstr "エラー画面URL"
|
499 |
|
500 |
-
#: system/mw_wp_form_admin_page.php:
|
501 |
msgid ""
|
502 |
"This urls are the redirection urls at the time of button press. When URL "
|
503 |
"setting is empty, The page redirect on the same page."
|
@@ -505,137 +430,90 @@ msgstr ""
|
|
505 |
"上記URLはボタン押下時のリダイレクトURLです。URLの設定が空のときは、同一ページ"
|
506 |
"上でリダイレクトします。"
|
507 |
|
508 |
-
#: system/mw_wp_form_admin_page.php:
|
509 |
msgid "When a URL doesn't begin http or https, %s is complemented."
|
510 |
msgstr "URLが http または https で始まっていない場合は %s が補完されます。"
|
511 |
|
512 |
-
#: system/mw_wp_form_admin_page.php:
|
513 |
msgid "Add Validation rule"
|
514 |
msgstr "バリデーションルールを追加"
|
515 |
|
516 |
-
#: system/mw_wp_form_admin_page.php:
|
517 |
msgid "The key which applies validation"
|
518 |
msgstr "バリデーションを適用する項目"
|
519 |
|
520 |
-
#: system/mw_wp_form_admin_page.php:
|
521 |
-
msgid "No empty"
|
522 |
-
msgstr "必須項目"
|
523 |
-
|
524 |
-
#: system/mw_wp_form_admin_page.php:523
|
525 |
-
msgid "No empty( with checkbox )"
|
526 |
-
msgstr "必須項目(チェックボックス)"
|
527 |
-
|
528 |
-
#: system/mw_wp_form_admin_page.php:524
|
529 |
-
msgid "Numeric"
|
530 |
-
msgstr "半角数字"
|
531 |
-
|
532 |
-
#: system/mw_wp_form_admin_page.php:525
|
533 |
-
msgid "Alphabet"
|
534 |
-
msgstr "半角英字"
|
535 |
-
|
536 |
-
#: system/mw_wp_form_admin_page.php:526
|
537 |
-
msgid "Alphabet and Numeric"
|
538 |
-
msgstr "半角英数字"
|
539 |
-
|
540 |
-
#: system/mw_wp_form_admin_page.php:527
|
541 |
-
msgid "Japanese Katakana"
|
542 |
-
msgstr "カタカナ"
|
543 |
-
|
544 |
-
#: system/mw_wp_form_admin_page.php:528
|
545 |
-
msgid "Japanese Hiragana"
|
546 |
-
msgstr "ひらがな"
|
547 |
-
|
548 |
-
#: system/mw_wp_form_admin_page.php:531
|
549 |
-
msgid "E-mail"
|
550 |
-
msgstr "メールアドレス"
|
551 |
-
|
552 |
-
#: system/mw_wp_form_admin_page.php:532
|
553 |
-
msgid "URL"
|
554 |
-
msgstr "URL"
|
555 |
-
|
556 |
-
#: system/mw_wp_form_admin_page.php:533
|
557 |
-
msgid "Date"
|
558 |
-
msgstr "日付"
|
559 |
-
|
560 |
-
#: system/mw_wp_form_admin_page.php:537
|
561 |
-
msgid "The key at same value"
|
562 |
-
msgstr "一致する項目"
|
563 |
-
|
564 |
-
#: system/mw_wp_form_admin_page.php:541
|
565 |
-
msgid "The range of the number of characters"
|
566 |
-
msgstr "文字数の範囲"
|
567 |
-
|
568 |
-
#: system/mw_wp_form_admin_page.php:549
|
569 |
-
msgid "The number of the minimum characters"
|
570 |
-
msgstr "最小文字数"
|
571 |
-
|
572 |
-
#: system/mw_wp_form_admin_page.php:553
|
573 |
-
msgid "Permitted Extension"
|
574 |
-
msgstr "拡張子制限"
|
575 |
-
|
576 |
-
#: system/mw_wp_form_admin_page.php:554
|
577 |
-
msgid "Example:jpg or jpg,txt,…"
|
578 |
-
msgstr "例:jpg もしくは jpg,txt…"
|
579 |
-
|
580 |
-
#: system/mw_wp_form_admin_page.php:557
|
581 |
-
msgid "Permitted file size"
|
582 |
-
msgstr "サイズ制限"
|
583 |
-
|
584 |
-
#: system/mw_wp_form_admin_page.php:558
|
585 |
-
msgid "bytes"
|
586 |
-
msgstr "バイト"
|
587 |
-
|
588 |
-
#: system/mw_wp_form_admin_page.php:574
|
589 |
msgid "Select Style"
|
590 |
msgstr "スタイルを選択"
|
591 |
|
592 |
-
#: system/mw_wp_form_admin_page.php:
|
593 |
msgid "Add form tag"
|
594 |
msgstr "フォームタグを追加"
|
595 |
|
596 |
-
#: system/mw_wp_form_contact_data_page.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
msgid "Edit "
|
598 |
msgstr "編集"
|
599 |
|
600 |
-
#: system/mw_wp_form_contact_data_page.php:
|
601 |
msgid "View"
|
602 |
msgstr "表示"
|
603 |
|
604 |
-
#: system/mw_wp_form_contact_data_page.php:
|
605 |
msgid "Search"
|
606 |
msgstr "検索"
|
607 |
|
608 |
-
#: system/mw_wp_form_contact_data_page.php:
|
609 |
msgid "No data found"
|
610 |
msgstr "データがありません"
|
611 |
|
612 |
-
#: system/mw_wp_form_contact_data_page.php:
|
613 |
msgid "No data found in Trash"
|
614 |
msgstr "ゴミ箱にデータはありません"
|
615 |
|
616 |
-
#: system/mw_wp_form_contact_data_page.php:
|
617 |
msgid "CSV Download"
|
618 |
msgstr "CSVダウンロード"
|
619 |
|
620 |
-
#: system/mw_wp_form_contact_data_page.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
621 |
msgid "Custom Fields"
|
622 |
msgstr "カスタムフィールド"
|
623 |
|
624 |
-
#: system/mw_wp_form_contact_data_page.php:
|
625 |
msgid "Registed Date"
|
626 |
msgstr "登録日時"
|
627 |
|
628 |
-
#: system/mw_wp_form_contact_data_page.php:
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
#: system/mw_wp_form_contact_data_page.php:386
|
633 |
-
#: system/mw_wp_form_contact_data_page.php:387
|
634 |
-
#: system/mw_wp_form_contact_data_page.php:401
|
635 |
msgid "Inquiry data"
|
636 |
msgstr "問い合わせデータ"
|
637 |
|
638 |
-
#: system/mw_wp_form_contact_data_page.php:
|
639 |
msgid ""
|
640 |
"You can see the inquiry data that are saved in the database by clicking on "
|
641 |
"the link below."
|
@@ -643,30 +521,179 @@ msgstr ""
|
|
643 |
"リンクをクリックすることでデータベースに保存された問い合わせデータを見ること"
|
644 |
"ができます。"
|
645 |
|
646 |
-
#: system/mw_wp_form_contact_data_page.php:
|
647 |
msgid "Form title"
|
648 |
msgstr "フォーム名"
|
649 |
|
650 |
-
#: system/mw_wp_form_contact_data_page.php:
|
651 |
msgid "The number of inquiries"
|
652 |
msgstr "問い合わせ件数"
|
653 |
|
654 |
-
#: system/mw_wp_form_contact_data_page.php:
|
655 |
msgid "Updated date"
|
656 |
msgstr "更新日"
|
657 |
|
658 |
-
#: system/mw_wp_form_contact_data_page.php:
|
659 |
msgid "Created date"
|
660 |
msgstr "作成日"
|
661 |
|
662 |
-
#: system/mw_wp_form_contact_data_page.php:
|
663 |
msgid "cases"
|
664 |
msgstr "件"
|
665 |
|
666 |
-
#: system/
|
|
|
|
|
|
|
|
|
667 |
msgid "Uploaded from "
|
668 |
msgstr "Uploaded from "
|
669 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
#. Plugin Name of the plugin/theme
|
671 |
msgid "MW WP Form"
|
672 |
msgstr "MW WP Form"
|
2 |
# This file is distributed under the same license as the MW WP Form package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MW WP Form 1.8.0\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
+
"POT-Creation-Date: 2014-08-04 13:03:45+00:00\n"
|
8 |
+
"PO-Revision-Date: 2014-08-04 22:05+0900\n"
|
9 |
"Last-Translator: Takashi Kitajima <inc@2inc.org>\n"
|
10 |
"Language-Team: Takashi Kitajima <inc@2inc.org>\n"
|
11 |
"Language: ja\n"
|
15 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
"X-Poedit-Basepath: .\n"
|
18 |
+
"X-Generator: Poedit 1.6.7\n"
|
19 |
"X-Poedit-KeywordsList: __;_e;_x\n"
|
20 |
"X-Poedit-SearchPath-0: ..\n"
|
21 |
|
22 |
+
#: form_fields/mw_form_field_akismet_error.php:23
|
23 |
msgid "Akismet Error"
|
24 |
msgstr "Akismetエラー"
|
25 |
|
26 |
+
#: form_fields/mw_form_field_back_button.php:23
|
27 |
+
#: form_fields/mw_form_field_back_button.php:34
|
28 |
msgid "Back"
|
29 |
msgstr "戻る"
|
30 |
|
31 |
+
#: form_fields/mw_form_field_back_button.php:62
|
32 |
+
#: form_fields/mw_form_field_button.php:68
|
33 |
+
#: form_fields/mw_form_field_submit.php:68
|
34 |
msgid "String on the button"
|
35 |
msgstr "ボタンに表示する文字列"
|
36 |
|
37 |
+
#: form_fields/mw_form_field_back_button.php:62
|
38 |
+
#: form_fields/mw_form_field_button.php:68
|
39 |
+
#: form_fields/mw_form_field_checkbox.php:84
|
40 |
+
#: form_fields/mw_form_field_checkbox.php:88
|
41 |
+
#: form_fields/mw_form_field_checkbox.php:95
|
42 |
+
#: form_fields/mw_form_field_confirm_button.php:62
|
43 |
+
#: form_fields/mw_form_field_datepicker.php:106
|
44 |
+
#: form_fields/mw_form_field_datepicker.php:110
|
45 |
+
#: form_fields/mw_form_field_datepicker.php:114
|
46 |
+
#: form_fields/mw_form_field_datepicker.php:118
|
47 |
+
#: form_fields/mw_form_field_file.php:97
|
48 |
+
#: form_fields/mw_form_field_file.php:101
|
49 |
+
#: form_fields/mw_form_field_hidden.php:78
|
50 |
+
#: form_fields/mw_form_field_image.php:98
|
51 |
+
#: form_fields/mw_form_field_image.php:102
|
52 |
+
#: form_fields/mw_form_field_password.php:83
|
53 |
+
#: form_fields/mw_form_field_password.php:87
|
54 |
+
#: form_fields/mw_form_field_password.php:91
|
55 |
+
#: form_fields/mw_form_field_password.php:95
|
56 |
+
#: form_fields/mw_form_field_password.php:99
|
57 |
+
#: form_fields/mw_form_field_radio.php:82
|
58 |
+
#: form_fields/mw_form_field_radio.php:86
|
59 |
+
#: form_fields/mw_form_field_radio.php:93
|
60 |
+
#: form_fields/mw_form_field_select.php:82
|
61 |
+
#: form_fields/mw_form_field_select.php:86
|
62 |
+
#: form_fields/mw_form_field_select.php:93
|
63 |
+
#: form_fields/mw_form_field_submit.php:68
|
64 |
+
#: form_fields/mw_form_field_text.php:91 form_fields/mw_form_field_text.php:95
|
65 |
+
#: form_fields/mw_form_field_text.php:99
|
66 |
+
#: form_fields/mw_form_field_text.php:103
|
67 |
+
#: form_fields/mw_form_field_text.php:107
|
68 |
+
#: form_fields/mw_form_field_textarea.php:85
|
69 |
+
#: form_fields/mw_form_field_textarea.php:89
|
70 |
+
#: form_fields/mw_form_field_textarea.php:93
|
71 |
+
#: form_fields/mw_form_field_textarea.php:97
|
72 |
+
#: form_fields/mw_form_field_textarea.php:101
|
|
|
73 |
msgid "option"
|
74 |
msgstr "オプション"
|
75 |
|
76 |
+
#: form_fields/mw_form_field_button.php:23
|
77 |
msgid "Button"
|
78 |
msgstr "ボタン"
|
79 |
|
80 |
+
#: form_fields/mw_form_field_checkbox.php:23
|
81 |
msgid "Checkbox"
|
82 |
msgstr "チェックボックス"
|
83 |
|
84 |
+
#: form_fields/mw_form_field_checkbox.php:88
|
85 |
+
#: form_fields/mw_form_field_radio.php:86
|
86 |
+
#: form_fields/mw_form_field_select.php:86
|
87 |
msgid "Choices"
|
88 |
msgstr "選択肢"
|
89 |
|
90 |
+
#: form_fields/mw_form_field_checkbox.php:91
|
91 |
+
#: form_fields/mw_form_field_error.php:70
|
92 |
+
#: form_fields/mw_form_field_radio.php:89
|
93 |
+
#: form_fields/mw_form_field_select.php:89
|
94 |
msgid "Input one line about one item."
|
95 |
msgstr "1項目につき1行で入力してください。"
|
96 |
|
97 |
+
#: form_fields/mw_form_field_checkbox.php:95
|
98 |
+
#: form_fields/mw_form_field_confirm_button.php:62
|
99 |
+
#: form_fields/mw_form_field_datepicker.php:118
|
100 |
+
#: form_fields/mw_form_field_hidden.php:78
|
101 |
+
#: form_fields/mw_form_field_password.php:95
|
102 |
+
#: form_fields/mw_form_field_radio.php:93
|
103 |
+
#: form_fields/mw_form_field_select.php:93
|
104 |
+
#: form_fields/mw_form_field_text.php:103
|
105 |
+
#: form_fields/mw_form_field_textarea.php:97
|
106 |
msgid "Default value"
|
107 |
msgstr "初期値"
|
108 |
|
109 |
+
#: form_fields/mw_form_field_checkbox.php:99
|
110 |
+
#: form_fields/mw_form_field_datepicker.php:122
|
111 |
+
#: form_fields/mw_form_field_file.php:105
|
112 |
+
#: form_fields/mw_form_field_image.php:106
|
113 |
+
#: form_fields/mw_form_field_password.php:103
|
114 |
+
#: form_fields/mw_form_field_radio.php:97
|
115 |
+
#: form_fields/mw_form_field_select.php:97
|
116 |
+
#: form_fields/mw_form_field_tel.php:80 form_fields/mw_form_field_text.php:111
|
117 |
+
#: form_fields/mw_form_field_textarea.php:105
|
118 |
+
#: form_fields/mw_form_field_zip.php:80
|
119 |
msgid "Dsiplay error"
|
120 |
msgstr "エラー表示"
|
121 |
|
122 |
+
#: form_fields/mw_form_field_checkbox.php:100
|
123 |
+
#: form_fields/mw_form_field_datepicker.php:123
|
124 |
+
#: form_fields/mw_form_field_file.php:106
|
125 |
+
#: form_fields/mw_form_field_image.php:107
|
126 |
+
#: form_fields/mw_form_field_password.php:104
|
127 |
+
#: form_fields/mw_form_field_radio.php:98
|
128 |
+
#: form_fields/mw_form_field_select.php:98
|
129 |
+
#: form_fields/mw_form_field_tel.php:81 form_fields/mw_form_field_text.php:112
|
130 |
+
#: form_fields/mw_form_field_textarea.php:106
|
131 |
+
#: form_fields/mw_form_field_zip.php:81
|
132 |
msgid "Don't display error."
|
133 |
msgstr "エラーを表示しない"
|
134 |
|
135 |
+
#: form_fields/mw_form_field_confirm_button.php:23
|
136 |
msgid "Confirm Button"
|
137 |
msgstr "確認ボタン"
|
138 |
|
139 |
+
#: form_fields/mw_form_field_confirm_button.php:34
|
140 |
+
#: form_fields/mw_form_field_submit_button.php:35
|
141 |
msgid "Confirm"
|
142 |
msgstr "確認画面へ"
|
143 |
|
144 |
+
#: form_fields/mw_form_field_datepicker.php:23
|
145 |
msgid "Datepicker"
|
146 |
msgstr "日付"
|
147 |
|
148 |
+
#: form_fields/mw_form_field_error.php:23
|
149 |
msgid "Error Message"
|
150 |
msgstr "エラーメッセージ"
|
151 |
|
152 |
+
#: form_fields/mw_form_field_error.php:67
|
153 |
msgid "name of the element which wants to display error"
|
154 |
msgstr "エラーを表示したい要素のname属性"
|
155 |
|
156 |
+
#: form_fields/mw_form_field_file.php:23
|
157 |
msgid "File"
|
158 |
msgstr "ファイルフィールド"
|
159 |
|
160 |
+
#: form_fields/mw_form_field_file.php:57 form_fields/mw_form_field_file.php:78
|
161 |
msgid "Uploaded."
|
162 |
msgstr "アップロードしました。"
|
163 |
|
164 |
+
#: form_fields/mw_form_field_hidden.php:23
|
165 |
msgid "Hidden"
|
166 |
msgstr "hiddenフィールド"
|
167 |
|
168 |
+
#: form_fields/mw_form_field_hidden.php:82
|
169 |
msgid "Display"
|
170 |
msgstr "表示する"
|
171 |
|
172 |
+
#: form_fields/mw_form_field_hidden.php:83
|
173 |
msgid "Display hidden value."
|
174 |
msgstr "hiddenの値を表示"
|
175 |
|
176 |
+
#: form_fields/mw_form_field_image.php:23
|
177 |
msgid "Image"
|
178 |
msgstr "画像フィールド"
|
179 |
|
180 |
+
#: form_fields/mw_form_field_password.php:23
|
181 |
msgid "Password"
|
182 |
msgstr "パスワードフィールド"
|
183 |
|
184 |
+
#: form_fields/mw_form_field_radio.php:23
|
185 |
msgid "Radio"
|
186 |
msgstr "ラジオボタン"
|
187 |
|
188 |
+
#: form_fields/mw_form_field_select.php:23
|
189 |
msgid "Select"
|
190 |
msgstr "セレクトボックス"
|
191 |
|
192 |
+
#: form_fields/mw_form_field_submit.php:23
|
193 |
msgid "Submit Button"
|
194 |
msgstr "送信ボタン"
|
195 |
|
196 |
+
#: form_fields/mw_form_field_submit.php:35
|
197 |
+
#: form_fields/mw_form_field_submit_button.php:36
|
198 |
msgid "Send"
|
199 |
msgstr "送信する"
|
200 |
|
201 |
+
#: form_fields/mw_form_field_submit_button.php:23
|
202 |
msgid "Confirm & Submit"
|
203 |
msgstr "確認・送信"
|
204 |
|
205 |
+
#: form_fields/mw_form_field_submit_button.php:72
|
206 |
msgid "String on the confirm button"
|
207 |
msgstr "確認ボタンに表示する文字列"
|
208 |
|
209 |
+
#: form_fields/mw_form_field_submit_button.php:76
|
210 |
msgid "String on the submit button"
|
211 |
msgstr "送信ボタンに表示する文字列"
|
212 |
|
213 |
+
#: form_fields/mw_form_field_tel.php:23
|
214 |
+
#: validation_rules/mw_validation_rule_tel.php:52
|
215 |
msgid "Tel"
|
216 |
msgstr "電話番号"
|
217 |
|
218 |
+
#: form_fields/mw_form_field_tel.php:84 form_fields/mw_form_field_text.php:115
|
219 |
+
#: form_fields/mw_form_field_zip.php:84
|
220 |
msgid "Convert half alphanumeric"
|
221 |
msgstr "半角英数字に変換"
|
222 |
|
223 |
+
#: form_fields/mw_form_field_tel.php:85 form_fields/mw_form_field_zip.php:85
|
224 |
msgid "Don't Convert."
|
225 |
msgstr "変換しない"
|
226 |
|
227 |
+
#: form_fields/mw_form_field_text.php:23
|
228 |
msgid "Text"
|
229 |
msgstr "テキストフィールド"
|
230 |
|
231 |
+
#: form_fields/mw_form_field_text.php:116
|
232 |
msgid "Convert."
|
233 |
msgstr "変換する"
|
234 |
|
235 |
+
#: form_fields/mw_form_field_textarea.php:23
|
236 |
msgid "Textarea"
|
237 |
msgstr "テキストエリア"
|
238 |
|
239 |
+
#: form_fields/mw_form_field_zip.php:23
|
240 |
+
#: validation_rules/mw_validation_rule_zip.php:46
|
241 |
msgid "Zip Code"
|
242 |
msgstr "郵便番号"
|
243 |
|
244 |
+
#: mw-wp-form.php:521
|
245 |
msgid "Validation Object is not a MW Validation Class."
|
246 |
msgstr ""
|
247 |
|
248 |
+
#: system/mw_wp_form_admin_page.php:54
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
msgid "Your contribution is needed for making this plugin better."
|
250 |
msgstr "あなたの貢献があればこのプラグインをもっと良くすることができます。"
|
251 |
|
252 |
+
#: system/mw_wp_form_admin_page.php:54
|
253 |
msgid "Donate"
|
254 |
msgstr "寄付する"
|
255 |
|
256 |
+
#: system/mw_wp_form_admin_page.php:100
|
257 |
msgid "Add New Form"
|
258 |
msgstr "フォームを追加"
|
259 |
|
260 |
+
#: system/mw_wp_form_admin_page.php:101
|
261 |
msgid "Edit Form"
|
262 |
msgstr "フォームを編集"
|
263 |
|
264 |
+
#: system/mw_wp_form_admin_page.php:102
|
265 |
msgid "New Form"
|
266 |
msgstr "新しいフォーム"
|
267 |
|
268 |
+
#: system/mw_wp_form_admin_page.php:103
|
269 |
msgid "View Form"
|
270 |
msgstr "フォームを表示"
|
271 |
|
272 |
+
#: system/mw_wp_form_admin_page.php:104
|
273 |
msgid "Search Forms"
|
274 |
msgstr "フォームを検索"
|
275 |
|
276 |
+
#: system/mw_wp_form_admin_page.php:105
|
277 |
msgid "No Forms found"
|
278 |
msgstr "フォームがありません"
|
279 |
|
280 |
+
#: system/mw_wp_form_admin_page.php:106
|
281 |
msgid "No Forms found in Trash"
|
282 |
msgstr "ゴミ箱にフォームはありません"
|
283 |
|
284 |
+
#: system/mw_wp_form_admin_page.php:126
|
285 |
msgid "Complete Message"
|
286 |
msgstr "完了画面メッセージ"
|
287 |
|
288 |
+
#: system/mw_wp_form_admin_page.php:133
|
289 |
msgid "URL Options"
|
290 |
msgstr "URL設定"
|
291 |
|
292 |
+
#: system/mw_wp_form_admin_page.php:140
|
293 |
msgid "Validation Rule"
|
294 |
msgstr "バリデーションルール"
|
295 |
|
296 |
+
#: system/mw_wp_form_admin_page.php:147
|
297 |
msgid "Form Key"
|
298 |
msgstr "フォーム識別子"
|
299 |
|
300 |
+
#: system/mw_wp_form_admin_page.php:154
|
301 |
msgid "Automatic Reply Email Options"
|
302 |
msgstr "自動返信メール設定"
|
303 |
|
304 |
+
#: system/mw_wp_form_admin_page.php:161
|
305 |
msgid "Admin Email Options"
|
306 |
msgstr "管理者宛メール設定"
|
307 |
|
308 |
+
#: system/mw_wp_form_admin_page.php:168
|
309 |
msgid "settings"
|
310 |
msgstr "設定"
|
311 |
|
312 |
+
#: system/mw_wp_form_admin_page.php:177
|
313 |
msgid "Style setting"
|
314 |
msgstr "スタイル設定"
|
315 |
|
316 |
+
#: system/mw_wp_form_admin_page.php:302
|
317 |
msgid "Copy and Paste this shortcode."
|
318 |
msgstr "このショートコードをコピー&ペーストしてください。"
|
319 |
|
320 |
+
#: system/mw_wp_form_admin_page.php:303
|
321 |
msgid "The key to use with hook is "
|
322 |
msgstr "各フックで使用する修飾子は"
|
323 |
|
324 |
+
#: system/mw_wp_form_admin_page.php:317
|
325 |
msgid "Activate Query string of post"
|
326 |
msgstr "URL引数を有効にする"
|
327 |
|
328 |
+
#: system/mw_wp_form_admin_page.php:318
|
329 |
msgid ""
|
330 |
"If this field is active, MW WP Form get query string. And get post data from "
|
331 |
"query string \"post_id\". You can use $post's property in editor."
|
334 |
"とに投稿を取得します。その投稿($post) のプロパティを使用できるようになりま"
|
335 |
"す。"
|
336 |
|
337 |
+
#: system/mw_wp_form_admin_page.php:319
|
338 |
msgid "Example: {ID}, {post_title}, {post_meta} etc..."
|
339 |
msgstr "例:{ID}、{post_title}、{post_meta}など…"
|
340 |
|
341 |
+
#: system/mw_wp_form_admin_page.php:322
|
342 |
msgid "Saving inquiry data in database"
|
343 |
msgstr "問い合わせデータをデータベースに保存"
|
344 |
|
345 |
+
#: system/mw_wp_form_admin_page.php:326
|
346 |
msgid "Akismet Setting"
|
347 |
msgstr "Akismet 設定"
|
348 |
|
349 |
+
#: system/mw_wp_form_admin_page.php:341
|
350 |
msgid "Input the key to use Akismet."
|
351 |
msgstr "Akismetを使用する項目のキーを入力してください。"
|
352 |
|
353 |
+
#: system/mw_wp_form_admin_page.php:366 system/mw_wp_form_admin_page.php:402
|
354 |
msgid "{key} is converted form data."
|
355 |
msgstr "{キー}でそのフォーム項目に変換されます。"
|
356 |
|
357 |
+
#: system/mw_wp_form_admin_page.php:369 system/mw_wp_form_admin_page.php:421
|
358 |
msgid "Subject"
|
359 |
msgstr "件名"
|
360 |
|
361 |
+
#: system/mw_wp_form_admin_page.php:373 system/mw_wp_form_admin_page.php:425
|
362 |
msgid "Sender"
|
363 |
msgstr "送信者"
|
364 |
|
365 |
+
#: system/mw_wp_form_admin_page.php:375 system/mw_wp_form_admin_page.php:380
|
366 |
+
#: system/mw_wp_form_admin_page.php:410 system/mw_wp_form_admin_page.php:427
|
367 |
+
#: system/mw_wp_form_admin_page.php:432
|
368 |
msgid "If empty:"
|
369 |
msgstr "未入力の場合:"
|
370 |
|
371 |
+
#: system/mw_wp_form_admin_page.php:378 system/mw_wp_form_admin_page.php:430
|
372 |
msgid "From ( E-mail address )"
|
373 |
msgstr "送信元(E-mailアドレス)"
|
374 |
|
375 |
+
#: system/mw_wp_form_admin_page.php:383 system/mw_wp_form_admin_page.php:435
|
376 |
msgid "Content"
|
377 |
msgstr "本文"
|
378 |
|
379 |
+
#: system/mw_wp_form_admin_page.php:387
|
380 |
msgid "Automatic reply email"
|
381 |
msgstr "自動返信メール"
|
382 |
|
383 |
+
#: system/mw_wp_form_admin_page.php:389
|
384 |
msgid ""
|
385 |
"Input the key to use as transmission to automatic reply email. {} is "
|
386 |
"unnecessary."
|
387 |
msgstr "自動返信メールに使用する項目のキーを入力してください。{ }は不要です。"
|
388 |
|
389 |
+
#: system/mw_wp_form_admin_page.php:405
|
390 |
msgid ""
|
391 |
"If Admin Email Options is a blank, Automatic Replay Email Options is used as "
|
392 |
"Admin Email Options."
|
394 |
"管理者宛メール設定が空のときは自動返信メール設定に管理者宛メール設定が使用さ"
|
395 |
"れます。"
|
396 |
|
397 |
+
#: system/mw_wp_form_admin_page.php:408
|
398 |
msgid "To ( E-mail address )"
|
399 |
msgstr "送信先(E-mailアドレス)"
|
400 |
|
401 |
+
#: system/mw_wp_form_admin_page.php:413
|
402 |
msgid "CC ( E-mail address )"
|
403 |
msgstr "CC(E-mailアドレス)"
|
404 |
|
405 |
+
#: system/mw_wp_form_admin_page.php:417
|
406 |
msgid "BCC ( E-mail address )"
|
407 |
msgstr "BCC(E-mailアドレス)"
|
408 |
|
409 |
+
#: system/mw_wp_form_admin_page.php:451
|
410 |
msgid "Input Page URL"
|
411 |
msgstr "入力画面URL"
|
412 |
|
413 |
+
#: system/mw_wp_form_admin_page.php:457
|
414 |
msgid "Confirmation Page URL"
|
415 |
msgstr "確認画面URL"
|
416 |
|
417 |
+
#: system/mw_wp_form_admin_page.php:463
|
418 |
msgid "Complete Page URL"
|
419 |
msgstr "完了画面URL"
|
420 |
|
421 |
+
#: system/mw_wp_form_admin_page.php:469
|
422 |
msgid "Validation Error Page URL"
|
423 |
msgstr "エラー画面URL"
|
424 |
|
425 |
+
#: system/mw_wp_form_admin_page.php:476
|
426 |
msgid ""
|
427 |
"This urls are the redirection urls at the time of button press. When URL "
|
428 |
"setting is empty, The page redirect on the same page."
|
430 |
"上記URLはボタン押下時のリダイレクトURLです。URLの設定が空のときは、同一ページ"
|
431 |
"上でリダイレクトします。"
|
432 |
|
433 |
+
#: system/mw_wp_form_admin_page.php:477
|
434 |
msgid "When a URL doesn't begin http or https, %s is complemented."
|
435 |
msgstr "URLが http または https で始まっていない場合は %s が補完されます。"
|
436 |
|
437 |
+
#: system/mw_wp_form_admin_page.php:509
|
438 |
msgid "Add Validation rule"
|
439 |
msgstr "バリデーションルールを追加"
|
440 |
|
441 |
+
#: system/mw_wp_form_admin_page.php:515
|
442 |
msgid "The key which applies validation"
|
443 |
msgstr "バリデーションを適用する項目"
|
444 |
|
445 |
+
#: system/mw_wp_form_admin_page.php:538
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
446 |
msgid "Select Style"
|
447 |
msgstr "スタイルを選択"
|
448 |
|
449 |
+
#: system/mw_wp_form_admin_page.php:575
|
450 |
msgid "Add form tag"
|
451 |
msgstr "フォームタグを追加"
|
452 |
|
453 |
+
#: system/mw_wp_form_contact_data_page.php:52
|
454 |
+
msgid "Not supported"
|
455 |
+
msgstr "未対応"
|
456 |
+
|
457 |
+
#: system/mw_wp_form_contact_data_page.php:53
|
458 |
+
msgid "Reservation"
|
459 |
+
msgstr "保留"
|
460 |
+
|
461 |
+
#: system/mw_wp_form_contact_data_page.php:54
|
462 |
+
msgid "Supported"
|
463 |
+
msgstr "対応済み"
|
464 |
+
|
465 |
+
#: system/mw_wp_form_contact_data_page.php:103
|
466 |
msgid "Edit "
|
467 |
msgstr "編集"
|
468 |
|
469 |
+
#: system/mw_wp_form_contact_data_page.php:104
|
470 |
msgid "View"
|
471 |
msgstr "表示"
|
472 |
|
473 |
+
#: system/mw_wp_form_contact_data_page.php:105
|
474 |
msgid "Search"
|
475 |
msgstr "検索"
|
476 |
|
477 |
+
#: system/mw_wp_form_contact_data_page.php:106
|
478 |
msgid "No data found"
|
479 |
msgstr "データがありません"
|
480 |
|
481 |
+
#: system/mw_wp_form_contact_data_page.php:107
|
482 |
msgid "No data found in Trash"
|
483 |
msgstr "ゴミ箱にデータはありません"
|
484 |
|
485 |
+
#: system/mw_wp_form_contact_data_page.php:151
|
486 |
msgid "CSV Download"
|
487 |
msgstr "CSVダウンロード"
|
488 |
|
489 |
+
#: system/mw_wp_form_contact_data_page.php:181
|
490 |
+
#: system/mw_wp_form_contact_data_page.php:213
|
491 |
+
#: system/mw_wp_form_contact_data_page.php:296
|
492 |
+
#: system/mw_wp_form_contact_data_page.php:393
|
493 |
+
msgid "Response Status"
|
494 |
+
msgstr "対応状況"
|
495 |
+
|
496 |
+
#: system/mw_wp_form_contact_data_page.php:204
|
497 |
+
#: system/mw_wp_form_contact_data_page.php:215
|
498 |
+
#: system/mw_wp_form_contact_data_page.php:405
|
499 |
+
msgid "Memo"
|
500 |
+
msgstr "メモ"
|
501 |
+
|
502 |
+
#: system/mw_wp_form_contact_data_page.php:271
|
503 |
msgid "Custom Fields"
|
504 |
msgstr "カスタムフィールド"
|
505 |
|
506 |
+
#: system/mw_wp_form_contact_data_page.php:295
|
507 |
msgid "Registed Date"
|
508 |
msgstr "登録日時"
|
509 |
|
510 |
+
#: system/mw_wp_form_contact_data_page.php:451
|
511 |
+
#: system/mw_wp_form_contact_data_page.php:452
|
512 |
+
#: system/mw_wp_form_contact_data_page.php:466
|
|
|
|
|
|
|
|
|
513 |
msgid "Inquiry data"
|
514 |
msgstr "問い合わせデータ"
|
515 |
|
516 |
+
#: system/mw_wp_form_contact_data_page.php:468
|
517 |
msgid ""
|
518 |
"You can see the inquiry data that are saved in the database by clicking on "
|
519 |
"the link below."
|
521 |
"リンクをクリックすることでデータベースに保存された問い合わせデータを見ること"
|
522 |
"ができます。"
|
523 |
|
524 |
+
#: system/mw_wp_form_contact_data_page.php:472
|
525 |
msgid "Form title"
|
526 |
msgstr "フォーム名"
|
527 |
|
528 |
+
#: system/mw_wp_form_contact_data_page.php:473
|
529 |
msgid "The number of inquiries"
|
530 |
msgstr "問い合わせ件数"
|
531 |
|
532 |
+
#: system/mw_wp_form_contact_data_page.php:474
|
533 |
msgid "Updated date"
|
534 |
msgstr "更新日"
|
535 |
|
536 |
+
#: system/mw_wp_form_contact_data_page.php:475
|
537 |
msgid "Created date"
|
538 |
msgstr "作成日"
|
539 |
|
540 |
+
#: system/mw_wp_form_contact_data_page.php:482
|
541 |
msgid "cases"
|
542 |
msgstr "件"
|
543 |
|
544 |
+
#: system/mw_wp_form_contact_data_page.php:504
|
545 |
+
msgid "« Back to the list"
|
546 |
+
msgstr "« 一覧に戻る"
|
547 |
+
|
548 |
+
#: system/mw_wp_form_file.php:149
|
549 |
msgid "Uploaded from "
|
550 |
msgstr "Uploaded from "
|
551 |
|
552 |
+
#: validation_rules/mw_validation_rule_akismet.php:28
|
553 |
+
msgid "The contents which you input were judged with spam."
|
554 |
+
msgstr "あなたの入力した内容はスパムと判定されました。"
|
555 |
+
|
556 |
+
#: validation_rules/mw_validation_rule_alpha.php:31
|
557 |
+
msgid "Please enter with a half-width alphabetic character."
|
558 |
+
msgstr "半角英字で入力してください。"
|
559 |
+
|
560 |
+
#: validation_rules/mw_validation_rule_alpha.php:46
|
561 |
+
msgid "Alphabet"
|
562 |
+
msgstr "半角英字"
|
563 |
+
|
564 |
+
#: validation_rules/mw_validation_rule_alphanumeric.php:31
|
565 |
+
msgid "Please enter with a half-width alphanumeric character."
|
566 |
+
msgstr "半角英数字で入力してください。"
|
567 |
+
|
568 |
+
#: validation_rules/mw_validation_rule_alphanumeric.php:46
|
569 |
+
msgid "Alphabet and Numeric"
|
570 |
+
msgstr "半角英数字"
|
571 |
+
|
572 |
+
#: validation_rules/mw_validation_rule_between.php:32
|
573 |
+
msgid "The number of characters is invalid."
|
574 |
+
msgstr "文字数が正しくありません。"
|
575 |
+
|
576 |
+
#: validation_rules/mw_validation_rule_between.php:63
|
577 |
+
msgid "The range of the number of characters"
|
578 |
+
msgstr "文字数の範囲"
|
579 |
+
|
580 |
+
#: validation_rules/mw_validation_rule_date.php:30
|
581 |
+
msgid "This is not the format of a date."
|
582 |
+
msgstr "日付の形式ではありません。"
|
583 |
+
|
584 |
+
#: validation_rules/mw_validation_rule_date.php:51
|
585 |
+
msgid "Date"
|
586 |
+
msgstr "日付"
|
587 |
+
|
588 |
+
#: validation_rules/mw_validation_rule_eq.php:31
|
589 |
+
msgid "This is not in agreement."
|
590 |
+
msgstr "一致しません。"
|
591 |
+
|
592 |
+
#: validation_rules/mw_validation_rule_eq.php:50
|
593 |
+
msgid "The key at same value"
|
594 |
+
msgstr "一致する項目"
|
595 |
+
|
596 |
+
#: validation_rules/mw_validation_rule_filesize.php:33
|
597 |
+
msgid "This file size is too big."
|
598 |
+
msgstr "ファイルサイズが大きすぎます。"
|
599 |
+
|
600 |
+
#: validation_rules/mw_validation_rule_filesize.php:52
|
601 |
+
msgid "Permitted file size"
|
602 |
+
msgstr "サイズ制限"
|
603 |
+
|
604 |
+
#: validation_rules/mw_validation_rule_filesize.php:53
|
605 |
+
msgid "bytes"
|
606 |
+
msgstr "バイト"
|
607 |
+
|
608 |
+
#: validation_rules/mw_validation_rule_filetype.php:31
|
609 |
+
msgid "This file is invalid."
|
610 |
+
msgstr "許可されたファイルではありません。"
|
611 |
+
|
612 |
+
#: validation_rules/mw_validation_rule_filetype.php:55
|
613 |
+
msgid "Permitted Extension"
|
614 |
+
msgstr "拡張子制限"
|
615 |
+
|
616 |
+
#: validation_rules/mw_validation_rule_filetype.php:56
|
617 |
+
msgid "Example:jpg or jpg,txt,…"
|
618 |
+
msgstr "例:jpg もしくは jpg,txt…"
|
619 |
+
|
620 |
+
#: validation_rules/mw_validation_rule_hiragana.php:31
|
621 |
+
msgid "Please enter with a Japanese Hiragana."
|
622 |
+
msgstr "ひらがなで入力してください。"
|
623 |
+
|
624 |
+
#: validation_rules/mw_validation_rule_hiragana.php:46
|
625 |
+
msgid "Japanese Hiragana"
|
626 |
+
msgstr "ひらがな"
|
627 |
+
|
628 |
+
#: validation_rules/mw_validation_rule_in.php:31
|
629 |
+
msgid "This value is invalid."
|
630 |
+
msgstr "値が不正です。"
|
631 |
+
|
632 |
+
#: validation_rules/mw_validation_rule_katakana.php:31
|
633 |
+
msgid "Please enter with a Japanese Katakana."
|
634 |
+
msgstr "カタカナで入力してください。"
|
635 |
+
|
636 |
+
#: validation_rules/mw_validation_rule_katakana.php:46
|
637 |
+
msgid "Japanese Katakana"
|
638 |
+
msgstr "カタカナ"
|
639 |
+
|
640 |
+
#: validation_rules/mw_validation_rule_mail.php:31
|
641 |
+
msgid "This is not the format of a mail address."
|
642 |
+
msgstr "メールアドレスの形式ではありません。"
|
643 |
+
|
644 |
+
#: validation_rules/mw_validation_rule_mail.php:46
|
645 |
+
msgid "E-mail"
|
646 |
+
msgstr "メールアドレス"
|
647 |
+
|
648 |
+
#: validation_rules/mw_validation_rule_minlength.php:31
|
649 |
+
msgid "The number of characters is a few."
|
650 |
+
msgstr "文字数が足りません。"
|
651 |
+
|
652 |
+
#: validation_rules/mw_validation_rule_minlength.php:50
|
653 |
+
msgid "The number of the minimum characters"
|
654 |
+
msgstr "最小文字数"
|
655 |
+
|
656 |
+
#: validation_rules/mw_validation_rule_noempty.php:30
|
657 |
+
#: validation_rules/mw_validation_rule_nofalse.php:30
|
658 |
+
msgid "Please enter."
|
659 |
+
msgstr "未入力です。"
|
660 |
+
|
661 |
+
#: validation_rules/mw_validation_rule_noempty.php:44
|
662 |
+
msgid "No empty"
|
663 |
+
msgstr "必須項目"
|
664 |
+
|
665 |
+
#: validation_rules/mw_validation_rule_numeric.php:31
|
666 |
+
msgid "Please enter with a half-width number."
|
667 |
+
msgstr "半角数字で入力してください。"
|
668 |
+
|
669 |
+
#: validation_rules/mw_validation_rule_numeric.php:46
|
670 |
+
msgid "Numeric"
|
671 |
+
msgstr "半角数字"
|
672 |
+
|
673 |
+
#: validation_rules/mw_validation_rule_required.php:33
|
674 |
+
msgid "This is required."
|
675 |
+
msgstr "必須項目です。"
|
676 |
+
|
677 |
+
#: validation_rules/mw_validation_rule_required.php:46
|
678 |
+
msgid "No empty( with checkbox )"
|
679 |
+
msgstr "必須項目(チェックボックス)"
|
680 |
+
|
681 |
+
#: validation_rules/mw_validation_rule_tel.php:30
|
682 |
+
msgid "This is not the format of a tel number."
|
683 |
+
msgstr "電話番号の形式ではありません。"
|
684 |
+
|
685 |
+
#: validation_rules/mw_validation_rule_url.php:31
|
686 |
+
msgid "This is not the format of a url."
|
687 |
+
msgstr "URLの形式ではありません。"
|
688 |
+
|
689 |
+
#: validation_rules/mw_validation_rule_url.php:46
|
690 |
+
msgid "URL"
|
691 |
+
msgstr "URL"
|
692 |
+
|
693 |
+
#: validation_rules/mw_validation_rule_zip.php:30
|
694 |
+
msgid "This is not the format of a zip code."
|
695 |
+
msgstr "郵便番号の形式ではありません。"
|
696 |
+
|
697 |
#. Plugin Name of the plugin/theme
|
698 |
msgid "MW WP Form"
|
699 |
msgstr "MW WP Form"
|
languages/mw-wp-form.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the same license as the MW WP Form package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: MW WP Form 1.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
-
"POT-Creation-Date: 2014-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -14,637 +14,662 @@ msgstr ""
|
|
14 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
"X-Poedit-Basepath: .\n"
|
17 |
-
"X-Generator: Poedit 1.6.
|
18 |
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
"X-Poedit-SearchPath-0: ..\n"
|
20 |
|
21 |
-
#: form_fields/mw_form_field_akismet_error.php:
|
22 |
msgid "Akismet Error"
|
23 |
msgstr ""
|
24 |
|
25 |
-
#: form_fields/mw_form_field_back_button.php:
|
26 |
-
#: form_fields/mw_form_field_back_button.php:
|
27 |
msgid "Back"
|
28 |
msgstr ""
|
29 |
|
30 |
-
#: form_fields/mw_form_field_back_button.php:
|
31 |
-
#: form_fields/mw_form_field_button.php:
|
32 |
-
#: form_fields/mw_form_field_submit.php:
|
33 |
msgid "String on the button"
|
34 |
msgstr ""
|
35 |
|
36 |
-
#: form_fields/mw_form_field_back_button.php:
|
37 |
-
#: form_fields/mw_form_field_button.php:
|
38 |
-
#: form_fields/mw_form_field_checkbox.php:
|
39 |
-
#: form_fields/mw_form_field_checkbox.php:
|
40 |
-
#: form_fields/mw_form_field_checkbox.php:
|
41 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
42 |
-
#: form_fields/mw_form_field_datepicker.php:
|
43 |
-
#: form_fields/mw_form_field_datepicker.php:
|
44 |
-
#: form_fields/mw_form_field_datepicker.php:
|
45 |
-
#: form_fields/mw_form_field_datepicker.php:
|
46 |
-
#: form_fields/mw_form_field_file.php:
|
47 |
-
#: form_fields/
|
48 |
-
#: form_fields/
|
49 |
-
#: form_fields/mw_form_field_image.php:
|
50 |
-
#: form_fields/
|
51 |
-
#: form_fields/mw_form_field_password.php:
|
52 |
-
#: form_fields/mw_form_field_password.php:
|
53 |
-
#: form_fields/mw_form_field_password.php:
|
54 |
-
#: form_fields/mw_form_field_password.php:
|
55 |
-
#: form_fields/
|
56 |
-
#: form_fields/mw_form_field_radio.php:
|
57 |
-
#: form_fields/mw_form_field_radio.php:
|
58 |
-
#: form_fields/
|
59 |
-
#: form_fields/mw_form_field_select.php:
|
60 |
-
#: form_fields/mw_form_field_select.php:
|
61 |
-
#: form_fields/
|
62 |
-
#: form_fields/
|
63 |
-
#: form_fields/mw_form_field_text.php:
|
64 |
-
#: form_fields/mw_form_field_text.php:
|
65 |
-
#: form_fields/
|
66 |
-
#: form_fields/
|
67 |
-
#: form_fields/
|
68 |
-
#: form_fields/mw_form_field_textarea.php:
|
69 |
-
#: form_fields/mw_form_field_textarea.php:
|
70 |
-
#: form_fields/mw_form_field_textarea.php:108
|
71 |
-
#: form_fields/mw_form_field_textarea.php:112
|
72 |
-
#: form_fields/mw_form_field_textarea.php:116
|
73 |
msgid "option"
|
74 |
msgstr ""
|
75 |
|
76 |
-
#: form_fields/mw_form_field_button.php:
|
77 |
msgid "Button"
|
78 |
msgstr ""
|
79 |
|
80 |
-
#: form_fields/mw_form_field_checkbox.php:
|
81 |
msgid "Checkbox"
|
82 |
msgstr ""
|
83 |
|
84 |
-
#: form_fields/mw_form_field_checkbox.php:
|
85 |
-
#: form_fields/mw_form_field_radio.php:
|
86 |
-
#: form_fields/mw_form_field_select.php:
|
87 |
msgid "Choices"
|
88 |
msgstr ""
|
89 |
|
90 |
-
#: form_fields/mw_form_field_checkbox.php:
|
91 |
-
#: form_fields/mw_form_field_error.php:
|
92 |
-
#: form_fields/mw_form_field_radio.php:
|
93 |
-
#: form_fields/mw_form_field_select.php:
|
94 |
msgid "Input one line about one item."
|
95 |
msgstr ""
|
96 |
|
97 |
-
#: form_fields/mw_form_field_checkbox.php:
|
98 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
99 |
-
#: form_fields/mw_form_field_datepicker.php:
|
100 |
-
#: form_fields/mw_form_field_hidden.php:
|
101 |
-
#: form_fields/mw_form_field_password.php:
|
102 |
-
#: form_fields/mw_form_field_radio.php:
|
103 |
-
#: form_fields/mw_form_field_select.php:
|
104 |
-
#: form_fields/mw_form_field_text.php:
|
105 |
-
#: form_fields/mw_form_field_textarea.php:
|
106 |
msgid "Default value"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: form_fields/mw_form_field_checkbox.php:
|
110 |
-
#: form_fields/mw_form_field_datepicker.php:
|
111 |
-
#: form_fields/mw_form_field_file.php:
|
112 |
-
#: form_fields/mw_form_field_image.php:
|
113 |
-
#: form_fields/mw_form_field_password.php:
|
114 |
-
#: form_fields/mw_form_field_radio.php:
|
115 |
-
#: form_fields/mw_form_field_select.php:
|
116 |
-
#: form_fields/
|
117 |
-
#: form_fields/mw_form_field_textarea.php:
|
118 |
-
#: form_fields/mw_form_field_zip.php:
|
119 |
msgid "Dsiplay error"
|
120 |
msgstr ""
|
121 |
|
122 |
-
#: form_fields/mw_form_field_checkbox.php:
|
123 |
-
#: form_fields/mw_form_field_datepicker.php:
|
124 |
-
#: form_fields/mw_form_field_file.php:
|
125 |
-
#: form_fields/mw_form_field_image.php:
|
126 |
-
#: form_fields/mw_form_field_password.php:
|
127 |
-
#: form_fields/mw_form_field_radio.php:
|
128 |
-
#: form_fields/mw_form_field_select.php:
|
129 |
-
#: form_fields/
|
130 |
-
#: form_fields/mw_form_field_textarea.php:
|
131 |
-
#: form_fields/mw_form_field_zip.php:
|
132 |
msgid "Don't display error."
|
133 |
msgstr ""
|
134 |
|
135 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
136 |
msgid "Confirm Button"
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: form_fields/mw_form_field_confirm_button.php:
|
140 |
-
#: form_fields/mw_form_field_submit_button.php:
|
141 |
msgid "Confirm"
|
142 |
msgstr ""
|
143 |
|
144 |
-
#: form_fields/mw_form_field_datepicker.php:
|
145 |
msgid "Datepicker"
|
146 |
msgstr ""
|
147 |
|
148 |
-
#: form_fields/mw_form_field_error.php:
|
149 |
msgid "Error Message"
|
150 |
msgstr ""
|
151 |
|
152 |
-
#: form_fields/mw_form_field_error.php:
|
153 |
msgid "name of the element which wants to display error"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: form_fields/mw_form_field_file.php:
|
157 |
msgid "File"
|
158 |
msgstr ""
|
159 |
|
160 |
-
#: form_fields/mw_form_field_file.php:
|
161 |
msgid "Uploaded."
|
162 |
msgstr ""
|
163 |
|
164 |
-
#: form_fields/mw_form_field_hidden.php:
|
165 |
msgid "Hidden"
|
166 |
msgstr ""
|
167 |
|
168 |
-
#: form_fields/mw_form_field_hidden.php:
|
169 |
msgid "Display"
|
170 |
msgstr ""
|
171 |
|
172 |
-
#: form_fields/mw_form_field_hidden.php:
|
173 |
msgid "Display hidden value."
|
174 |
msgstr ""
|
175 |
|
176 |
-
#: form_fields/mw_form_field_image.php:
|
177 |
msgid "Image"
|
178 |
msgstr ""
|
179 |
|
180 |
-
#: form_fields/mw_form_field_password.php:
|
181 |
msgid "Password"
|
182 |
msgstr ""
|
183 |
|
184 |
-
#: form_fields/mw_form_field_radio.php:
|
185 |
msgid "Radio"
|
186 |
msgstr ""
|
187 |
|
188 |
-
#: form_fields/mw_form_field_select.php:
|
189 |
msgid "Select"
|
190 |
msgstr ""
|
191 |
|
192 |
-
#: form_fields/mw_form_field_submit.php:
|
193 |
msgid "Submit Button"
|
194 |
msgstr ""
|
195 |
|
196 |
-
#: form_fields/mw_form_field_submit.php:
|
197 |
-
#: form_fields/mw_form_field_submit_button.php:
|
198 |
msgid "Send"
|
199 |
msgstr ""
|
200 |
|
201 |
-
#: form_fields/mw_form_field_submit_button.php:
|
202 |
msgid "Confirm & Submit"
|
203 |
msgstr ""
|
204 |
|
205 |
-
#: form_fields/mw_form_field_submit_button.php:
|
206 |
msgid "String on the confirm button"
|
207 |
msgstr ""
|
208 |
|
209 |
-
#: form_fields/mw_form_field_submit_button.php:
|
210 |
msgid "String on the submit button"
|
211 |
msgstr ""
|
212 |
|
213 |
-
#: form_fields/mw_form_field_tel.php:
|
|
|
214 |
msgid "Tel"
|
215 |
msgstr ""
|
216 |
|
217 |
-
#: form_fields/mw_form_field_tel.php:
|
218 |
-
#: form_fields/mw_form_field_zip.php:
|
219 |
msgid "Convert half alphanumeric"
|
220 |
msgstr ""
|
221 |
|
222 |
-
#: form_fields/mw_form_field_tel.php:
|
223 |
msgid "Don't Convert."
|
224 |
msgstr ""
|
225 |
|
226 |
-
#: form_fields/mw_form_field_text.php:
|
227 |
msgid "Text"
|
228 |
msgstr ""
|
229 |
|
230 |
-
#: form_fields/mw_form_field_text.php:
|
231 |
msgid "Convert."
|
232 |
msgstr ""
|
233 |
|
234 |
-
#: form_fields/mw_form_field_textarea.php:
|
235 |
msgid "Textarea"
|
236 |
msgstr ""
|
237 |
|
238 |
-
#: form_fields/mw_form_field_zip.php:
|
|
|
239 |
msgid "Zip Code"
|
240 |
msgstr ""
|
241 |
|
242 |
-
#: mw-wp-form.php:
|
243 |
msgid "Validation Object is not a MW Validation Class."
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: system/
|
247 |
-
msgid "This is required."
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: system/mw_validation.php:98 system/mw_validation.php:116
|
251 |
-
msgid "Please enter."
|
252 |
-
msgstr ""
|
253 |
-
|
254 |
-
#: system/mw_validation.php:138
|
255 |
-
msgid "Please enter with a half-width alphabetic character."
|
256 |
-
msgstr ""
|
257 |
-
|
258 |
-
#: system/mw_validation.php:161
|
259 |
-
msgid "Please enter with a half-width number."
|
260 |
-
msgstr ""
|
261 |
-
|
262 |
-
#: system/mw_validation.php:184
|
263 |
-
msgid "Please enter with a half-width alphanumeric character."
|
264 |
-
msgstr ""
|
265 |
-
|
266 |
-
#: system/mw_validation.php:207
|
267 |
-
msgid "Please enter with a Japanese Katakana."
|
268 |
-
msgstr ""
|
269 |
-
|
270 |
-
#: system/mw_validation.php:230
|
271 |
-
msgid "Please enter with a Japanese Hiragana."
|
272 |
-
msgstr ""
|
273 |
-
|
274 |
-
#: system/mw_validation.php:249
|
275 |
-
msgid "This is not the format of a zip code."
|
276 |
-
msgstr ""
|
277 |
-
|
278 |
-
#: system/mw_validation.php:272
|
279 |
-
msgid "This is not the format of a tel number."
|
280 |
-
msgstr ""
|
281 |
-
|
282 |
-
#: system/mw_validation.php:305
|
283 |
-
msgid "This is not the format of a mail address."
|
284 |
-
msgstr ""
|
285 |
-
|
286 |
-
#: system/mw_validation.php:328
|
287 |
-
msgid "This is not the format of a url."
|
288 |
-
msgstr ""
|
289 |
-
|
290 |
-
#: system/mw_validation.php:348
|
291 |
-
msgid "This is not in agreement."
|
292 |
-
msgstr ""
|
293 |
-
|
294 |
-
#: system/mw_validation.php:374
|
295 |
-
msgid "The number of characters is invalid."
|
296 |
-
msgstr ""
|
297 |
-
|
298 |
-
#: system/mw_validation.php:411
|
299 |
-
msgid "The number of characters is a few."
|
300 |
-
msgstr ""
|
301 |
-
|
302 |
-
#: system/mw_validation.php:436
|
303 |
-
msgid "This value is invalid."
|
304 |
-
msgstr ""
|
305 |
-
|
306 |
-
#: system/mw_validation.php:459
|
307 |
-
msgid "This is not the format of a date."
|
308 |
-
msgstr ""
|
309 |
-
|
310 |
-
#: system/mw_validation.php:488
|
311 |
-
msgid "This file is invalid."
|
312 |
-
msgstr ""
|
313 |
-
|
314 |
-
#: system/mw_validation.php:517
|
315 |
-
msgid "This file size is too big."
|
316 |
-
msgstr ""
|
317 |
-
|
318 |
-
#: system/mw_validation.php:536
|
319 |
-
msgid "The contents which you input were judged with spam."
|
320 |
-
msgstr ""
|
321 |
-
|
322 |
-
#: system/mw_wp_form_admin_page.php:57
|
323 |
msgid "Your contribution is needed for making this plugin better."
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: system/mw_wp_form_admin_page.php:
|
327 |
msgid "Donate"
|
328 |
msgstr ""
|
329 |
|
330 |
-
#: system/mw_wp_form_admin_page.php:
|
331 |
msgid "Add New Form"
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: system/mw_wp_form_admin_page.php:
|
335 |
msgid "Edit Form"
|
336 |
msgstr ""
|
337 |
|
338 |
-
#: system/mw_wp_form_admin_page.php:
|
339 |
msgid "New Form"
|
340 |
msgstr ""
|
341 |
|
342 |
-
#: system/mw_wp_form_admin_page.php:
|
343 |
msgid "View Form"
|
344 |
msgstr ""
|
345 |
|
346 |
-
#: system/mw_wp_form_admin_page.php:
|
347 |
msgid "Search Forms"
|
348 |
msgstr ""
|
349 |
|
350 |
-
#: system/mw_wp_form_admin_page.php:
|
351 |
msgid "No Forms found"
|
352 |
msgstr ""
|
353 |
|
354 |
-
#: system/mw_wp_form_admin_page.php:
|
355 |
msgid "No Forms found in Trash"
|
356 |
msgstr ""
|
357 |
|
358 |
-
#: system/mw_wp_form_admin_page.php:
|
359 |
msgid "Complete Message"
|
360 |
msgstr ""
|
361 |
|
362 |
-
#: system/mw_wp_form_admin_page.php:
|
363 |
msgid "URL Options"
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: system/mw_wp_form_admin_page.php:
|
367 |
msgid "Validation Rule"
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: system/mw_wp_form_admin_page.php:
|
371 |
msgid "Form Key"
|
372 |
msgstr ""
|
373 |
|
374 |
-
#: system/mw_wp_form_admin_page.php:
|
375 |
msgid "Automatic Reply Email Options"
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: system/mw_wp_form_admin_page.php:
|
379 |
msgid "Admin Email Options"
|
380 |
msgstr ""
|
381 |
|
382 |
-
#: system/mw_wp_form_admin_page.php:
|
383 |
msgid "settings"
|
384 |
msgstr ""
|
385 |
|
386 |
-
#: system/mw_wp_form_admin_page.php:
|
387 |
msgid "Style setting"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: system/mw_wp_form_admin_page.php:
|
391 |
msgid "Copy and Paste this shortcode."
|
392 |
msgstr ""
|
393 |
|
394 |
-
#: system/mw_wp_form_admin_page.php:
|
395 |
msgid "The key to use with hook is "
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: system/mw_wp_form_admin_page.php:
|
399 |
msgid "Activate Query string of post"
|
400 |
msgstr ""
|
401 |
|
402 |
-
#: system/mw_wp_form_admin_page.php:
|
403 |
msgid "If this field is active, MW WP Form get query string. And get post data from query string \"post_id\". You can use $post's property in editor."
|
404 |
msgstr ""
|
405 |
|
406 |
-
#: system/mw_wp_form_admin_page.php:
|
407 |
msgid "Example: {ID}, {post_title}, {post_meta} etc..."
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: system/mw_wp_form_admin_page.php:
|
411 |
msgid "Saving inquiry data in database"
|
412 |
msgstr ""
|
413 |
|
414 |
-
#: system/mw_wp_form_admin_page.php:
|
415 |
msgid "Akismet Setting"
|
416 |
msgstr ""
|
417 |
|
418 |
-
#: system/mw_wp_form_admin_page.php:
|
419 |
msgid "Input the key to use Akismet."
|
420 |
msgstr ""
|
421 |
|
422 |
-
#: system/mw_wp_form_admin_page.php:
|
423 |
msgid "{key} is converted form data."
|
424 |
msgstr ""
|
425 |
|
426 |
-
#: system/mw_wp_form_admin_page.php:
|
427 |
msgid "Subject"
|
428 |
msgstr ""
|
429 |
|
430 |
-
#: system/mw_wp_form_admin_page.php:
|
431 |
msgid "Sender"
|
432 |
msgstr ""
|
433 |
|
434 |
-
#: system/mw_wp_form_admin_page.php:
|
435 |
-
#: system/mw_wp_form_admin_page.php:
|
436 |
-
#: system/mw_wp_form_admin_page.php:
|
437 |
msgid "If empty:"
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: system/mw_wp_form_admin_page.php:
|
441 |
msgid "From ( E-mail address )"
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: system/mw_wp_form_admin_page.php:
|
445 |
msgid "Content"
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: system/mw_wp_form_admin_page.php:
|
449 |
msgid "Automatic reply email"
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: system/mw_wp_form_admin_page.php:
|
453 |
msgid "Input the key to use as transmission to automatic reply email. {} is unnecessary."
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: system/mw_wp_form_admin_page.php:
|
457 |
msgid "If Admin Email Options is a blank, Automatic Replay Email Options is used as Admin Email Options."
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: system/mw_wp_form_admin_page.php:
|
461 |
msgid "To ( E-mail address )"
|
462 |
msgstr ""
|
463 |
|
464 |
-
#: system/mw_wp_form_admin_page.php:
|
465 |
msgid "CC ( E-mail address )"
|
466 |
msgstr ""
|
467 |
|
468 |
-
#: system/mw_wp_form_admin_page.php:
|
469 |
msgid "BCC ( E-mail address )"
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: system/mw_wp_form_admin_page.php:
|
473 |
msgid "Input Page URL"
|
474 |
msgstr ""
|
475 |
|
476 |
-
#: system/mw_wp_form_admin_page.php:
|
477 |
msgid "Confirmation Page URL"
|
478 |
msgstr ""
|
479 |
|
480 |
-
#: system/mw_wp_form_admin_page.php:
|
481 |
msgid "Complete Page URL"
|
482 |
msgstr ""
|
483 |
|
484 |
-
#: system/mw_wp_form_admin_page.php:
|
485 |
msgid "Validation Error Page URL"
|
486 |
msgstr ""
|
487 |
|
488 |
-
#: system/mw_wp_form_admin_page.php:
|
489 |
msgid "This urls are the redirection urls at the time of button press. When URL setting is empty, The page redirect on the same page."
|
490 |
msgstr ""
|
491 |
|
492 |
-
#: system/mw_wp_form_admin_page.php:
|
493 |
msgid "When a URL doesn't begin http or https, %s is complemented."
|
494 |
msgstr ""
|
495 |
|
496 |
-
#: system/mw_wp_form_admin_page.php:
|
497 |
msgid "Add Validation rule"
|
498 |
msgstr ""
|
499 |
|
500 |
-
#: system/mw_wp_form_admin_page.php:
|
501 |
msgid "The key which applies validation"
|
502 |
msgstr ""
|
503 |
|
504 |
-
#: system/mw_wp_form_admin_page.php:
|
505 |
-
msgid "
|
506 |
msgstr ""
|
507 |
|
508 |
-
#: system/mw_wp_form_admin_page.php:
|
509 |
-
msgid "
|
510 |
msgstr ""
|
511 |
|
512 |
-
#: system/
|
513 |
-
msgid "
|
514 |
msgstr ""
|
515 |
|
516 |
-
#: system/
|
517 |
-
msgid "
|
518 |
msgstr ""
|
519 |
|
520 |
-
#: system/
|
521 |
-
msgid "
|
522 |
msgstr ""
|
523 |
|
524 |
-
#: system/
|
525 |
-
msgid "
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: system/
|
529 |
-
msgid "
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: system/
|
533 |
-
msgid "
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: system/
|
537 |
-
msgid "
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: system/
|
541 |
-
msgid "
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: system/
|
545 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: system/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
549 |
msgid "The range of the number of characters"
|
550 |
msgstr ""
|
551 |
|
552 |
-
#:
|
553 |
-
msgid "
|
554 |
msgstr ""
|
555 |
|
556 |
-
#:
|
557 |
-
msgid "
|
558 |
msgstr ""
|
559 |
|
560 |
-
#:
|
561 |
-
msgid "
|
562 |
msgstr ""
|
563 |
|
564 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
msgid "Permitted file size"
|
566 |
msgstr ""
|
567 |
|
568 |
-
#:
|
569 |
msgid "bytes"
|
570 |
msgstr ""
|
571 |
|
572 |
-
#:
|
573 |
-
msgid "
|
574 |
msgstr ""
|
575 |
|
576 |
-
#:
|
577 |
-
msgid "
|
578 |
msgstr ""
|
579 |
|
580 |
-
#:
|
581 |
-
msgid "
|
582 |
msgstr ""
|
583 |
|
584 |
-
#:
|
585 |
-
msgid "
|
586 |
msgstr ""
|
587 |
|
588 |
-
#:
|
589 |
-
msgid "
|
590 |
msgstr ""
|
591 |
|
592 |
-
#:
|
593 |
-
msgid "
|
594 |
msgstr ""
|
595 |
|
596 |
-
#:
|
597 |
-
msgid "
|
598 |
msgstr ""
|
599 |
|
600 |
-
#:
|
601 |
-
msgid "
|
602 |
msgstr ""
|
603 |
|
604 |
-
#:
|
605 |
-
msgid "
|
606 |
msgstr ""
|
607 |
|
608 |
-
#:
|
609 |
-
msgid "
|
610 |
msgstr ""
|
611 |
|
612 |
-
#:
|
613 |
-
msgid "
|
614 |
msgstr ""
|
615 |
|
616 |
-
#:
|
617 |
-
|
618 |
-
#: system/mw_wp_form_contact_data_page.php:401
|
619 |
-
msgid "Inquiry data"
|
620 |
msgstr ""
|
621 |
|
622 |
-
#:
|
623 |
-
|
|
|
624 |
msgstr ""
|
625 |
|
626 |
-
#:
|
627 |
-
msgid "
|
628 |
msgstr ""
|
629 |
|
630 |
-
#:
|
631 |
-
msgid "
|
632 |
msgstr ""
|
633 |
|
634 |
-
#:
|
635 |
-
msgid "
|
636 |
msgstr ""
|
637 |
|
638 |
-
#:
|
639 |
-
msgid "
|
640 |
msgstr ""
|
641 |
|
642 |
-
#:
|
643 |
-
msgid "
|
644 |
msgstr ""
|
645 |
|
646 |
-
#:
|
647 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
648 |
msgstr ""
|
649 |
#. Plugin Name of the plugin/theme
|
650 |
msgid "MW WP Form"
|
2 |
# This file is distributed under the same license as the MW WP Form package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: MW WP Form 1.8.0\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
+
"POT-Creation-Date: 2014-08-04 13:03:45+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
14 |
"Plural-Forms: nplurals=1; plural=0;\n"
|
15 |
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
"X-Poedit-Basepath: .\n"
|
17 |
+
"X-Generator: Poedit 1.6.7\n"
|
18 |
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
"X-Poedit-SearchPath-0: ..\n"
|
20 |
|
21 |
+
#: form_fields/mw_form_field_akismet_error.php:23
|
22 |
msgid "Akismet Error"
|
23 |
msgstr ""
|
24 |
|
25 |
+
#: form_fields/mw_form_field_back_button.php:23
|
26 |
+
#: form_fields/mw_form_field_back_button.php:34
|
27 |
msgid "Back"
|
28 |
msgstr ""
|
29 |
|
30 |
+
#: form_fields/mw_form_field_back_button.php:62
|
31 |
+
#: form_fields/mw_form_field_button.php:68
|
32 |
+
#: form_fields/mw_form_field_submit.php:68
|
33 |
msgid "String on the button"
|
34 |
msgstr ""
|
35 |
|
36 |
+
#: form_fields/mw_form_field_back_button.php:62
|
37 |
+
#: form_fields/mw_form_field_button.php:68
|
38 |
+
#: form_fields/mw_form_field_checkbox.php:84
|
39 |
+
#: form_fields/mw_form_field_checkbox.php:88
|
40 |
+
#: form_fields/mw_form_field_checkbox.php:95
|
41 |
+
#: form_fields/mw_form_field_confirm_button.php:62
|
42 |
+
#: form_fields/mw_form_field_datepicker.php:106
|
43 |
+
#: form_fields/mw_form_field_datepicker.php:110
|
44 |
+
#: form_fields/mw_form_field_datepicker.php:114
|
45 |
+
#: form_fields/mw_form_field_datepicker.php:118
|
46 |
+
#: form_fields/mw_form_field_file.php:97 form_fields/mw_form_field_file.php:101
|
47 |
+
#: form_fields/mw_form_field_hidden.php:78
|
48 |
+
#: form_fields/mw_form_field_image.php:98
|
49 |
+
#: form_fields/mw_form_field_image.php:102
|
50 |
+
#: form_fields/mw_form_field_password.php:83
|
51 |
+
#: form_fields/mw_form_field_password.php:87
|
52 |
+
#: form_fields/mw_form_field_password.php:91
|
53 |
+
#: form_fields/mw_form_field_password.php:95
|
54 |
+
#: form_fields/mw_form_field_password.php:99
|
55 |
+
#: form_fields/mw_form_field_radio.php:82
|
56 |
+
#: form_fields/mw_form_field_radio.php:86
|
57 |
+
#: form_fields/mw_form_field_radio.php:93
|
58 |
+
#: form_fields/mw_form_field_select.php:82
|
59 |
+
#: form_fields/mw_form_field_select.php:86
|
60 |
+
#: form_fields/mw_form_field_select.php:93
|
61 |
+
#: form_fields/mw_form_field_submit.php:68
|
62 |
+
#: form_fields/mw_form_field_text.php:91 form_fields/mw_form_field_text.php:95
|
63 |
+
#: form_fields/mw_form_field_text.php:99 form_fields/mw_form_field_text.php:103
|
64 |
+
#: form_fields/mw_form_field_text.php:107
|
65 |
+
#: form_fields/mw_form_field_textarea.php:85
|
66 |
+
#: form_fields/mw_form_field_textarea.php:89
|
67 |
+
#: form_fields/mw_form_field_textarea.php:93
|
68 |
+
#: form_fields/mw_form_field_textarea.php:97
|
69 |
+
#: form_fields/mw_form_field_textarea.php:101
|
|
|
|
|
|
|
70 |
msgid "option"
|
71 |
msgstr ""
|
72 |
|
73 |
+
#: form_fields/mw_form_field_button.php:23
|
74 |
msgid "Button"
|
75 |
msgstr ""
|
76 |
|
77 |
+
#: form_fields/mw_form_field_checkbox.php:23
|
78 |
msgid "Checkbox"
|
79 |
msgstr ""
|
80 |
|
81 |
+
#: form_fields/mw_form_field_checkbox.php:88
|
82 |
+
#: form_fields/mw_form_field_radio.php:86
|
83 |
+
#: form_fields/mw_form_field_select.php:86
|
84 |
msgid "Choices"
|
85 |
msgstr ""
|
86 |
|
87 |
+
#: form_fields/mw_form_field_checkbox.php:91
|
88 |
+
#: form_fields/mw_form_field_error.php:70
|
89 |
+
#: form_fields/mw_form_field_radio.php:89
|
90 |
+
#: form_fields/mw_form_field_select.php:89
|
91 |
msgid "Input one line about one item."
|
92 |
msgstr ""
|
93 |
|
94 |
+
#: form_fields/mw_form_field_checkbox.php:95
|
95 |
+
#: form_fields/mw_form_field_confirm_button.php:62
|
96 |
+
#: form_fields/mw_form_field_datepicker.php:118
|
97 |
+
#: form_fields/mw_form_field_hidden.php:78
|
98 |
+
#: form_fields/mw_form_field_password.php:95
|
99 |
+
#: form_fields/mw_form_field_radio.php:93
|
100 |
+
#: form_fields/mw_form_field_select.php:93
|
101 |
+
#: form_fields/mw_form_field_text.php:103
|
102 |
+
#: form_fields/mw_form_field_textarea.php:97
|
103 |
msgid "Default value"
|
104 |
msgstr ""
|
105 |
|
106 |
+
#: form_fields/mw_form_field_checkbox.php:99
|
107 |
+
#: form_fields/mw_form_field_datepicker.php:122
|
108 |
+
#: form_fields/mw_form_field_file.php:105
|
109 |
+
#: form_fields/mw_form_field_image.php:106
|
110 |
+
#: form_fields/mw_form_field_password.php:103
|
111 |
+
#: form_fields/mw_form_field_radio.php:97
|
112 |
+
#: form_fields/mw_form_field_select.php:97 form_fields/mw_form_field_tel.php:80
|
113 |
+
#: form_fields/mw_form_field_text.php:111
|
114 |
+
#: form_fields/mw_form_field_textarea.php:105
|
115 |
+
#: form_fields/mw_form_field_zip.php:80
|
116 |
msgid "Dsiplay error"
|
117 |
msgstr ""
|
118 |
|
119 |
+
#: form_fields/mw_form_field_checkbox.php:100
|
120 |
+
#: form_fields/mw_form_field_datepicker.php:123
|
121 |
+
#: form_fields/mw_form_field_file.php:106
|
122 |
+
#: form_fields/mw_form_field_image.php:107
|
123 |
+
#: form_fields/mw_form_field_password.php:104
|
124 |
+
#: form_fields/mw_form_field_radio.php:98
|
125 |
+
#: form_fields/mw_form_field_select.php:98 form_fields/mw_form_field_tel.php:81
|
126 |
+
#: form_fields/mw_form_field_text.php:112
|
127 |
+
#: form_fields/mw_form_field_textarea.php:106
|
128 |
+
#: form_fields/mw_form_field_zip.php:81
|
129 |
msgid "Don't display error."
|
130 |
msgstr ""
|
131 |
|
132 |
+
#: form_fields/mw_form_field_confirm_button.php:23
|
133 |
msgid "Confirm Button"
|
134 |
msgstr ""
|
135 |
|
136 |
+
#: form_fields/mw_form_field_confirm_button.php:34
|
137 |
+
#: form_fields/mw_form_field_submit_button.php:35
|
138 |
msgid "Confirm"
|
139 |
msgstr ""
|
140 |
|
141 |
+
#: form_fields/mw_form_field_datepicker.php:23
|
142 |
msgid "Datepicker"
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: form_fields/mw_form_field_error.php:23
|
146 |
msgid "Error Message"
|
147 |
msgstr ""
|
148 |
|
149 |
+
#: form_fields/mw_form_field_error.php:67
|
150 |
msgid "name of the element which wants to display error"
|
151 |
msgstr ""
|
152 |
|
153 |
+
#: form_fields/mw_form_field_file.php:23
|
154 |
msgid "File"
|
155 |
msgstr ""
|
156 |
|
157 |
+
#: form_fields/mw_form_field_file.php:57 form_fields/mw_form_field_file.php:78
|
158 |
msgid "Uploaded."
|
159 |
msgstr ""
|
160 |
|
161 |
+
#: form_fields/mw_form_field_hidden.php:23
|
162 |
msgid "Hidden"
|
163 |
msgstr ""
|
164 |
|
165 |
+
#: form_fields/mw_form_field_hidden.php:82
|
166 |
msgid "Display"
|
167 |
msgstr ""
|
168 |
|
169 |
+
#: form_fields/mw_form_field_hidden.php:83
|
170 |
msgid "Display hidden value."
|
171 |
msgstr ""
|
172 |
|
173 |
+
#: form_fields/mw_form_field_image.php:23
|
174 |
msgid "Image"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: form_fields/mw_form_field_password.php:23
|
178 |
msgid "Password"
|
179 |
msgstr ""
|
180 |
|
181 |
+
#: form_fields/mw_form_field_radio.php:23
|
182 |
msgid "Radio"
|
183 |
msgstr ""
|
184 |
|
185 |
+
#: form_fields/mw_form_field_select.php:23
|
186 |
msgid "Select"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: form_fields/mw_form_field_submit.php:23
|
190 |
msgid "Submit Button"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: form_fields/mw_form_field_submit.php:35
|
194 |
+
#: form_fields/mw_form_field_submit_button.php:36
|
195 |
msgid "Send"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: form_fields/mw_form_field_submit_button.php:23
|
199 |
msgid "Confirm & Submit"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: form_fields/mw_form_field_submit_button.php:72
|
203 |
msgid "String on the confirm button"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: form_fields/mw_form_field_submit_button.php:76
|
207 |
msgid "String on the submit button"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: form_fields/mw_form_field_tel.php:23
|
211 |
+
#: validation_rules/mw_validation_rule_tel.php:52
|
212 |
msgid "Tel"
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: form_fields/mw_form_field_tel.php:84 form_fields/mw_form_field_text.php:115
|
216 |
+
#: form_fields/mw_form_field_zip.php:84
|
217 |
msgid "Convert half alphanumeric"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: form_fields/mw_form_field_tel.php:85 form_fields/mw_form_field_zip.php:85
|
221 |
msgid "Don't Convert."
|
222 |
msgstr ""
|
223 |
|
224 |
+
#: form_fields/mw_form_field_text.php:23
|
225 |
msgid "Text"
|
226 |
msgstr ""
|
227 |
|
228 |
+
#: form_fields/mw_form_field_text.php:116
|
229 |
msgid "Convert."
|
230 |
msgstr ""
|
231 |
|
232 |
+
#: form_fields/mw_form_field_textarea.php:23
|
233 |
msgid "Textarea"
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: form_fields/mw_form_field_zip.php:23
|
237 |
+
#: validation_rules/mw_validation_rule_zip.php:46
|
238 |
msgid "Zip Code"
|
239 |
msgstr ""
|
240 |
|
241 |
+
#: mw-wp-form.php:521
|
242 |
msgid "Validation Object is not a MW Validation Class."
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: system/mw_wp_form_admin_page.php:54
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
msgid "Your contribution is needed for making this plugin better."
|
247 |
msgstr ""
|
248 |
|
249 |
+
#: system/mw_wp_form_admin_page.php:54
|
250 |
msgid "Donate"
|
251 |
msgstr ""
|
252 |
|
253 |
+
#: system/mw_wp_form_admin_page.php:100
|
254 |
msgid "Add New Form"
|
255 |
msgstr ""
|
256 |
|
257 |
+
#: system/mw_wp_form_admin_page.php:101
|
258 |
msgid "Edit Form"
|
259 |
msgstr ""
|
260 |
|
261 |
+
#: system/mw_wp_form_admin_page.php:102
|
262 |
msgid "New Form"
|
263 |
msgstr ""
|
264 |
|
265 |
+
#: system/mw_wp_form_admin_page.php:103
|
266 |
msgid "View Form"
|
267 |
msgstr ""
|
268 |
|
269 |
+
#: system/mw_wp_form_admin_page.php:104
|
270 |
msgid "Search Forms"
|
271 |
msgstr ""
|
272 |
|
273 |
+
#: system/mw_wp_form_admin_page.php:105
|
274 |
msgid "No Forms found"
|
275 |
msgstr ""
|
276 |
|
277 |
+
#: system/mw_wp_form_admin_page.php:106
|
278 |
msgid "No Forms found in Trash"
|
279 |
msgstr ""
|
280 |
|
281 |
+
#: system/mw_wp_form_admin_page.php:126
|
282 |
msgid "Complete Message"
|
283 |
msgstr ""
|
284 |
|
285 |
+
#: system/mw_wp_form_admin_page.php:133
|
286 |
msgid "URL Options"
|
287 |
msgstr ""
|
288 |
|
289 |
+
#: system/mw_wp_form_admin_page.php:140
|
290 |
msgid "Validation Rule"
|
291 |
msgstr ""
|
292 |
|
293 |
+
#: system/mw_wp_form_admin_page.php:147
|
294 |
msgid "Form Key"
|
295 |
msgstr ""
|
296 |
|
297 |
+
#: system/mw_wp_form_admin_page.php:154
|
298 |
msgid "Automatic Reply Email Options"
|
299 |
msgstr ""
|
300 |
|
301 |
+
#: system/mw_wp_form_admin_page.php:161
|
302 |
msgid "Admin Email Options"
|
303 |
msgstr ""
|
304 |
|
305 |
+
#: system/mw_wp_form_admin_page.php:168
|
306 |
msgid "settings"
|
307 |
msgstr ""
|
308 |
|
309 |
+
#: system/mw_wp_form_admin_page.php:177
|
310 |
msgid "Style setting"
|
311 |
msgstr ""
|
312 |
|
313 |
+
#: system/mw_wp_form_admin_page.php:302
|
314 |
msgid "Copy and Paste this shortcode."
|
315 |
msgstr ""
|
316 |
|
317 |
+
#: system/mw_wp_form_admin_page.php:303
|
318 |
msgid "The key to use with hook is "
|
319 |
msgstr ""
|
320 |
|
321 |
+
#: system/mw_wp_form_admin_page.php:317
|
322 |
msgid "Activate Query string of post"
|
323 |
msgstr ""
|
324 |
|
325 |
+
#: system/mw_wp_form_admin_page.php:318
|
326 |
msgid "If this field is active, MW WP Form get query string. And get post data from query string \"post_id\". You can use $post's property in editor."
|
327 |
msgstr ""
|
328 |
|
329 |
+
#: system/mw_wp_form_admin_page.php:319
|
330 |
msgid "Example: {ID}, {post_title}, {post_meta} etc..."
|
331 |
msgstr ""
|
332 |
|
333 |
+
#: system/mw_wp_form_admin_page.php:322
|
334 |
msgid "Saving inquiry data in database"
|
335 |
msgstr ""
|
336 |
|
337 |
+
#: system/mw_wp_form_admin_page.php:326
|
338 |
msgid "Akismet Setting"
|
339 |
msgstr ""
|
340 |
|
341 |
+
#: system/mw_wp_form_admin_page.php:341
|
342 |
msgid "Input the key to use Akismet."
|
343 |
msgstr ""
|
344 |
|
345 |
+
#: system/mw_wp_form_admin_page.php:366 system/mw_wp_form_admin_page.php:402
|
346 |
msgid "{key} is converted form data."
|
347 |
msgstr ""
|
348 |
|
349 |
+
#: system/mw_wp_form_admin_page.php:369 system/mw_wp_form_admin_page.php:421
|
350 |
msgid "Subject"
|
351 |
msgstr ""
|
352 |
|
353 |
+
#: system/mw_wp_form_admin_page.php:373 system/mw_wp_form_admin_page.php:425
|
354 |
msgid "Sender"
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: system/mw_wp_form_admin_page.php:375 system/mw_wp_form_admin_page.php:380
|
358 |
+
#: system/mw_wp_form_admin_page.php:410 system/mw_wp_form_admin_page.php:427
|
359 |
+
#: system/mw_wp_form_admin_page.php:432
|
360 |
msgid "If empty:"
|
361 |
msgstr ""
|
362 |
|
363 |
+
#: system/mw_wp_form_admin_page.php:378 system/mw_wp_form_admin_page.php:430
|
364 |
msgid "From ( E-mail address )"
|
365 |
msgstr ""
|
366 |
|
367 |
+
#: system/mw_wp_form_admin_page.php:383 system/mw_wp_form_admin_page.php:435
|
368 |
msgid "Content"
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: system/mw_wp_form_admin_page.php:387
|
372 |
msgid "Automatic reply email"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: system/mw_wp_form_admin_page.php:389
|
376 |
msgid "Input the key to use as transmission to automatic reply email. {} is unnecessary."
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: system/mw_wp_form_admin_page.php:405
|
380 |
msgid "If Admin Email Options is a blank, Automatic Replay Email Options is used as Admin Email Options."
|
381 |
msgstr ""
|
382 |
|
383 |
+
#: system/mw_wp_form_admin_page.php:408
|
384 |
msgid "To ( E-mail address )"
|
385 |
msgstr ""
|
386 |
|
387 |
+
#: system/mw_wp_form_admin_page.php:413
|
388 |
msgid "CC ( E-mail address )"
|
389 |
msgstr ""
|
390 |
|
391 |
+
#: system/mw_wp_form_admin_page.php:417
|
392 |
msgid "BCC ( E-mail address )"
|
393 |
msgstr ""
|
394 |
|
395 |
+
#: system/mw_wp_form_admin_page.php:451
|
396 |
msgid "Input Page URL"
|
397 |
msgstr ""
|
398 |
|
399 |
+
#: system/mw_wp_form_admin_page.php:457
|
400 |
msgid "Confirmation Page URL"
|
401 |
msgstr ""
|
402 |
|
403 |
+
#: system/mw_wp_form_admin_page.php:463
|
404 |
msgid "Complete Page URL"
|
405 |
msgstr ""
|
406 |
|
407 |
+
#: system/mw_wp_form_admin_page.php:469
|
408 |
msgid "Validation Error Page URL"
|
409 |
msgstr ""
|
410 |
|
411 |
+
#: system/mw_wp_form_admin_page.php:476
|
412 |
msgid "This urls are the redirection urls at the time of button press. When URL setting is empty, The page redirect on the same page."
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: system/mw_wp_form_admin_page.php:477
|
416 |
msgid "When a URL doesn't begin http or https, %s is complemented."
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: system/mw_wp_form_admin_page.php:509
|
420 |
msgid "Add Validation rule"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: system/mw_wp_form_admin_page.php:515
|
424 |
msgid "The key which applies validation"
|
425 |
msgstr ""
|
426 |
|
427 |
+
#: system/mw_wp_form_admin_page.php:538
|
428 |
+
msgid "Select Style"
|
429 |
msgstr ""
|
430 |
|
431 |
+
#: system/mw_wp_form_admin_page.php:575
|
432 |
+
msgid "Add form tag"
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: system/mw_wp_form_contact_data_page.php:52
|
436 |
+
msgid "Not supported"
|
437 |
msgstr ""
|
438 |
|
439 |
+
#: system/mw_wp_form_contact_data_page.php:53
|
440 |
+
msgid "Reservation"
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: system/mw_wp_form_contact_data_page.php:54
|
444 |
+
msgid "Supported"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: system/mw_wp_form_contact_data_page.php:103
|
448 |
+
msgid "Edit "
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: system/mw_wp_form_contact_data_page.php:104
|
452 |
+
msgid "View"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: system/mw_wp_form_contact_data_page.php:105
|
456 |
+
msgid "Search"
|
457 |
msgstr ""
|
458 |
|
459 |
+
#: system/mw_wp_form_contact_data_page.php:106
|
460 |
+
msgid "No data found"
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: system/mw_wp_form_contact_data_page.php:107
|
464 |
+
msgid "No data found in Trash"
|
465 |
msgstr ""
|
466 |
|
467 |
+
#: system/mw_wp_form_contact_data_page.php:151
|
468 |
+
msgid "CSV Download"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: system/mw_wp_form_contact_data_page.php:181
|
472 |
+
#: system/mw_wp_form_contact_data_page.php:213
|
473 |
+
#: system/mw_wp_form_contact_data_page.php:296
|
474 |
+
#: system/mw_wp_form_contact_data_page.php:393
|
475 |
+
msgid "Response Status"
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: system/mw_wp_form_contact_data_page.php:204
|
479 |
+
#: system/mw_wp_form_contact_data_page.php:215
|
480 |
+
#: system/mw_wp_form_contact_data_page.php:405
|
481 |
+
msgid "Memo"
|
482 |
+
msgstr ""
|
483 |
+
|
484 |
+
#: system/mw_wp_form_contact_data_page.php:271
|
485 |
+
msgid "Custom Fields"
|
486 |
+
msgstr ""
|
487 |
+
|
488 |
+
#: system/mw_wp_form_contact_data_page.php:295
|
489 |
+
msgid "Registed Date"
|
490 |
+
msgstr ""
|
491 |
+
|
492 |
+
#: system/mw_wp_form_contact_data_page.php:451
|
493 |
+
#: system/mw_wp_form_contact_data_page.php:452
|
494 |
+
#: system/mw_wp_form_contact_data_page.php:466
|
495 |
+
msgid "Inquiry data"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
#: system/mw_wp_form_contact_data_page.php:468
|
499 |
+
msgid "You can see the inquiry data that are saved in the database by clicking on the link below."
|
500 |
+
msgstr ""
|
501 |
+
|
502 |
+
#: system/mw_wp_form_contact_data_page.php:472
|
503 |
+
msgid "Form title"
|
504 |
+
msgstr ""
|
505 |
+
|
506 |
+
#: system/mw_wp_form_contact_data_page.php:473
|
507 |
+
msgid "The number of inquiries"
|
508 |
+
msgstr ""
|
509 |
+
|
510 |
+
#: system/mw_wp_form_contact_data_page.php:474
|
511 |
+
msgid "Updated date"
|
512 |
+
msgstr ""
|
513 |
+
|
514 |
+
#: system/mw_wp_form_contact_data_page.php:475
|
515 |
+
msgid "Created date"
|
516 |
+
msgstr ""
|
517 |
+
|
518 |
+
#: system/mw_wp_form_contact_data_page.php:482
|
519 |
+
msgid "cases"
|
520 |
+
msgstr ""
|
521 |
+
|
522 |
+
#: system/mw_wp_form_contact_data_page.php:504
|
523 |
+
msgid "« Back to the list"
|
524 |
msgstr ""
|
525 |
|
526 |
+
#: system/mw_wp_form_file.php:149
|
527 |
+
msgid "Uploaded from "
|
528 |
+
msgstr ""
|
529 |
+
|
530 |
+
#: validation_rules/mw_validation_rule_akismet.php:28
|
531 |
+
msgid "The contents which you input were judged with spam."
|
532 |
+
msgstr ""
|
533 |
+
|
534 |
+
#: validation_rules/mw_validation_rule_alpha.php:31
|
535 |
+
msgid "Please enter with a half-width alphabetic character."
|
536 |
+
msgstr ""
|
537 |
+
|
538 |
+
#: validation_rules/mw_validation_rule_alpha.php:46
|
539 |
+
msgid "Alphabet"
|
540 |
+
msgstr ""
|
541 |
+
|
542 |
+
#: validation_rules/mw_validation_rule_alphanumeric.php:31
|
543 |
+
msgid "Please enter with a half-width alphanumeric character."
|
544 |
+
msgstr ""
|
545 |
+
|
546 |
+
#: validation_rules/mw_validation_rule_alphanumeric.php:46
|
547 |
+
msgid "Alphabet and Numeric"
|
548 |
+
msgstr ""
|
549 |
+
|
550 |
+
#: validation_rules/mw_validation_rule_between.php:32
|
551 |
+
msgid "The number of characters is invalid."
|
552 |
+
msgstr ""
|
553 |
+
|
554 |
+
#: validation_rules/mw_validation_rule_between.php:63
|
555 |
msgid "The range of the number of characters"
|
556 |
msgstr ""
|
557 |
|
558 |
+
#: validation_rules/mw_validation_rule_date.php:30
|
559 |
+
msgid "This is not the format of a date."
|
560 |
msgstr ""
|
561 |
|
562 |
+
#: validation_rules/mw_validation_rule_date.php:51
|
563 |
+
msgid "Date"
|
564 |
msgstr ""
|
565 |
|
566 |
+
#: validation_rules/mw_validation_rule_eq.php:31
|
567 |
+
msgid "This is not in agreement."
|
568 |
msgstr ""
|
569 |
|
570 |
+
#: validation_rules/mw_validation_rule_eq.php:50
|
571 |
+
msgid "The key at same value"
|
572 |
+
msgstr ""
|
573 |
+
|
574 |
+
#: validation_rules/mw_validation_rule_filesize.php:33
|
575 |
+
msgid "This file size is too big."
|
576 |
+
msgstr ""
|
577 |
+
|
578 |
+
#: validation_rules/mw_validation_rule_filesize.php:52
|
579 |
msgid "Permitted file size"
|
580 |
msgstr ""
|
581 |
|
582 |
+
#: validation_rules/mw_validation_rule_filesize.php:53
|
583 |
msgid "bytes"
|
584 |
msgstr ""
|
585 |
|
586 |
+
#: validation_rules/mw_validation_rule_filetype.php:31
|
587 |
+
msgid "This file is invalid."
|
588 |
msgstr ""
|
589 |
|
590 |
+
#: validation_rules/mw_validation_rule_filetype.php:55
|
591 |
+
msgid "Permitted Extension"
|
592 |
msgstr ""
|
593 |
|
594 |
+
#: validation_rules/mw_validation_rule_filetype.php:56
|
595 |
+
msgid "Example:jpg or jpg,txt,…"
|
596 |
msgstr ""
|
597 |
|
598 |
+
#: validation_rules/mw_validation_rule_hiragana.php:31
|
599 |
+
msgid "Please enter with a Japanese Hiragana."
|
600 |
msgstr ""
|
601 |
|
602 |
+
#: validation_rules/mw_validation_rule_hiragana.php:46
|
603 |
+
msgid "Japanese Hiragana"
|
604 |
msgstr ""
|
605 |
|
606 |
+
#: validation_rules/mw_validation_rule_in.php:31
|
607 |
+
msgid "This value is invalid."
|
608 |
msgstr ""
|
609 |
|
610 |
+
#: validation_rules/mw_validation_rule_katakana.php:31
|
611 |
+
msgid "Please enter with a Japanese Katakana."
|
612 |
msgstr ""
|
613 |
|
614 |
+
#: validation_rules/mw_validation_rule_katakana.php:46
|
615 |
+
msgid "Japanese Katakana"
|
616 |
msgstr ""
|
617 |
|
618 |
+
#: validation_rules/mw_validation_rule_mail.php:31
|
619 |
+
msgid "This is not the format of a mail address."
|
620 |
msgstr ""
|
621 |
|
622 |
+
#: validation_rules/mw_validation_rule_mail.php:46
|
623 |
+
msgid "E-mail"
|
624 |
msgstr ""
|
625 |
|
626 |
+
#: validation_rules/mw_validation_rule_minlength.php:31
|
627 |
+
msgid "The number of characters is a few."
|
628 |
msgstr ""
|
629 |
|
630 |
+
#: validation_rules/mw_validation_rule_minlength.php:50
|
631 |
+
msgid "The number of the minimum characters"
|
|
|
|
|
632 |
msgstr ""
|
633 |
|
634 |
+
#: validation_rules/mw_validation_rule_noempty.php:30
|
635 |
+
#: validation_rules/mw_validation_rule_nofalse.php:30
|
636 |
+
msgid "Please enter."
|
637 |
msgstr ""
|
638 |
|
639 |
+
#: validation_rules/mw_validation_rule_noempty.php:44
|
640 |
+
msgid "No empty"
|
641 |
msgstr ""
|
642 |
|
643 |
+
#: validation_rules/mw_validation_rule_numeric.php:31
|
644 |
+
msgid "Please enter with a half-width number."
|
645 |
msgstr ""
|
646 |
|
647 |
+
#: validation_rules/mw_validation_rule_numeric.php:46
|
648 |
+
msgid "Numeric"
|
649 |
msgstr ""
|
650 |
|
651 |
+
#: validation_rules/mw_validation_rule_required.php:33
|
652 |
+
msgid "This is required."
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: validation_rules/mw_validation_rule_required.php:46
|
656 |
+
msgid "No empty( with checkbox )"
|
657 |
msgstr ""
|
658 |
|
659 |
+
#: validation_rules/mw_validation_rule_tel.php:30
|
660 |
+
msgid "This is not the format of a tel number."
|
661 |
+
msgstr ""
|
662 |
+
|
663 |
+
#: validation_rules/mw_validation_rule_url.php:31
|
664 |
+
msgid "This is not the format of a url."
|
665 |
+
msgstr ""
|
666 |
+
|
667 |
+
#: validation_rules/mw_validation_rule_url.php:46
|
668 |
+
msgid "URL"
|
669 |
+
msgstr ""
|
670 |
+
|
671 |
+
#: validation_rules/mw_validation_rule_zip.php:30
|
672 |
+
msgid "This is not the format of a zip code."
|
673 |
msgstr ""
|
674 |
#. Plugin Name of the plugin/theme
|
675 |
msgid "MW WP Form"
|
mw-wp-form.php
CHANGED
@@ -3,29 +3,15 @@
|
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://plugins.2inc.org/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
10 |
* Modified: July 29, 2014
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
-
* License:
|
14 |
-
*
|
15 |
-
* Copyright 2014 Takashi Kitajima (email : inc@2inc.org)
|
16 |
-
*
|
17 |
-
* This program is free software; you can redistribute it and/or modify
|
18 |
-
* it under the terms of the GNU General Public License, version 2, as
|
19 |
-
* published by the Free Software Foundation.
|
20 |
-
*
|
21 |
-
* This program is distributed in the hope that it will be useful,
|
22 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 |
-
* GNU General Public License for more details.
|
25 |
-
*
|
26 |
-
* You should have received a copy of the GNU General Public License
|
27 |
-
* along with this program; if not, write to the Free Software
|
28 |
-
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
29 |
*/
|
30 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mwf_functions.php' );
|
31 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mwf_config.php' );
|
@@ -44,9 +30,28 @@ class mw_wp_form {
|
|
44 |
protected $File;
|
45 |
protected $viewFlg = 'input';
|
46 |
protected $MW_WP_Form_Admin_Page;
|
47 |
-
protected $MW_WP_Form_Contact_Data_Page;
|
48 |
protected $options_by_formkey;
|
49 |
protected $insert_id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
private $defaults = array(
|
51 |
'mail_subject' => '',
|
52 |
'mail_from' => '',
|
@@ -78,13 +83,27 @@ class mw_wp_form {
|
|
78 |
* __construct
|
79 |
*/
|
80 |
public function __construct() {
|
81 |
-
add_action( 'plugins_loaded', array( $this, '
|
|
|
82 |
// 有効化した時の処理
|
83 |
register_activation_hook( __FILE__, array( __CLASS__, 'activation' ) );
|
84 |
// アンインストールした時の処理
|
85 |
register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );
|
86 |
}
|
87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
/**
|
89 |
* init
|
90 |
* ファイルの読み込み等
|
@@ -93,14 +112,11 @@ class mw_wp_form {
|
|
93 |
load_plugin_textdomain( MWF_Config::DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );
|
94 |
|
95 |
// 管理画面の実行
|
96 |
-
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_admin_page.php' );
|
97 |
$this->MW_WP_Form_Admin_Page = new MW_WP_Form_Admin_Page();
|
98 |
-
|
99 |
-
$this->MW_WP_Form_Contact_Data_Page = new MW_WP_Form_Contact_Data_Page();
|
100 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
101 |
|
102 |
// フォームフィールドの読み込み、インスタンス化
|
103 |
-
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_form_field.php' );
|
104 |
foreach ( glob( plugin_dir_path( __FILE__ ) . 'form_fields/*.php' ) as $form_field ) {
|
105 |
include_once $form_field;
|
106 |
$className = basename( $form_field, '.php' );
|
@@ -109,15 +125,30 @@ class mw_wp_form {
|
|
109 |
}
|
110 |
}
|
111 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
if ( is_admin() ) return;
|
113 |
|
114 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_akismet.php' );
|
115 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_error.php' );
|
116 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_form.php' );
|
117 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_mail.php' );
|
118 |
-
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_session.php' );
|
119 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_validation.php' );
|
120 |
-
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_data.php' );
|
121 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_file.php' );
|
122 |
add_action( 'nocache_headers' , array( $this, 'nocache_headers' ) , 1 );
|
123 |
add_filter( 'template_include', array( $this, 'main' ), 10000 );
|
@@ -285,11 +316,11 @@ class mw_wp_form {
|
|
285 |
return $template;
|
286 |
|
287 |
// セッション初期化
|
288 |
-
$this->Session = MW_Session::start( $this->key );
|
289 |
-
// $_POSTがあるときは$_POST、無いときは$this->Session->getValues()
|
290 |
-
$_data = ( !empty( $_POST ) ) ? $_POST : $this->Session->getValues();
|
291 |
$this->Data = MW_WP_Form_Data::getInstance( $this->key );
|
292 |
-
|
|
|
|
|
|
|
293 |
|
294 |
// $_FILESがあるときは$this->dataに統合
|
295 |
$files = array();
|
@@ -313,6 +344,11 @@ class mw_wp_form {
|
|
313 |
|
314 |
// バリデーションオブジェクト生成
|
315 |
$this->Validation = new MW_Validation( $this->key );
|
|
|
|
|
|
|
|
|
|
|
316 |
// バリデーション実行(Validation->dataに値がないと$Errorは返さない(true))
|
317 |
$this->apply_filters_mwform_validation();
|
318 |
|
@@ -474,7 +510,7 @@ class mw_wp_form {
|
|
474 |
$this->options_by_formkey['akismet_author'],
|
475 |
$this->options_by_formkey['akismet_author_email'],
|
476 |
$this->options_by_formkey['akismet_author_url'],
|
477 |
-
$this->Data
|
478 |
);
|
479 |
if ( $akismet_check ) {
|
480 |
$this->Validation->setRule( MWF_Config::AKISMET, 'akismet_check' );
|
@@ -574,7 +610,7 @@ class mw_wp_form {
|
|
574 |
|
575 |
if ( isset( $this->options_by_formkey['automatic_reply_email'] ) ) {
|
576 |
$automatic_reply_email = $this->Data->getValue( $this->options_by_formkey['automatic_reply_email'] );
|
577 |
-
if ( $automatic_reply_email && !$this->
|
578 |
$Mail_raw = $this->set_reply_mail_raw_params( $Mail_raw );
|
579 |
|
580 |
// 自動返信メールからは添付ファイルを削除
|
@@ -653,26 +689,11 @@ class mw_wp_form {
|
|
653 |
* 第2引数でDB保存するか判定
|
654 |
*/
|
655 |
protected function parse_mail_body( $matches, $doUpdate = false ) {
|
656 |
-
$
|
657 |
-
if ( $
|
658 |
-
|
659 |
-
if ( is_array( $match ) ) {
|
660 |
-
if ( !array_key_exists( 'data', $match ) )
|
661 |
-
return;
|
662 |
-
if ( is_array( $match['data'] ) ) {
|
663 |
-
$value = $this->Form->getZipValue( $matches[1] );
|
664 |
-
if ( $doUpdate )
|
665 |
-
update_post_meta( $this->insert_id, $matches[1], $value );
|
666 |
-
return $value;
|
667 |
-
}
|
668 |
-
if ( $doUpdate )
|
669 |
-
update_post_meta( $this->insert_id, $matches[1], $match['data'] );
|
670 |
-
return $match['data'];
|
671 |
-
} else {
|
672 |
-
if ( $doUpdate )
|
673 |
-
update_post_meta( $this->insert_id, $matches[1], $match );
|
674 |
-
return $match;
|
675 |
}
|
|
|
676 |
}
|
677 |
|
678 |
/**
|
@@ -973,7 +994,7 @@ class mw_wp_form {
|
|
973 |
$admin_mail_sender = get_bloginfo( 'name' );
|
974 |
|
975 |
if ( !$Mail->to ) {
|
976 |
-
$Mail->to = $admin_mail_to
|
977 |
}
|
978 |
if ( !$Mail->from ) {
|
979 |
$Mail->from = $admin_mail_from;;
|
@@ -1068,7 +1089,7 @@ class mw_wp_form {
|
|
1068 |
$Mail->bcc = '';
|
1069 |
if ( $this->options_by_formkey ) {
|
1070 |
$automatic_reply_email = $this->Data->getValue( $this->options_by_formkey['automatic_reply_email'] );
|
1071 |
-
if ( $automatic_reply_email && !$this->
|
1072 |
// 送信先を指定
|
1073 |
$Mail->to = $automatic_reply_email;
|
1074 |
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://plugins.2inc.org/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
+
* Version: 1.8.0
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
10 |
* Modified: July 29, 2014
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
+
* License: GPLv2
|
14 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
*/
|
16 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mwf_functions.php' );
|
17 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mwf_config.php' );
|
30 |
protected $File;
|
31 |
protected $viewFlg = 'input';
|
32 |
protected $MW_WP_Form_Admin_Page;
|
|
|
33 |
protected $options_by_formkey;
|
34 |
protected $insert_id;
|
35 |
+
private $validation_rules = array(
|
36 |
+
'akismet_check' => '',
|
37 |
+
'noempty' => '',
|
38 |
+
'required' => '',
|
39 |
+
'numeric' => '',
|
40 |
+
'alpha' => '',
|
41 |
+
'alphanumeric' => '',
|
42 |
+
'katakana' => '',
|
43 |
+
'hiragana' => '',
|
44 |
+
'zip' => '',
|
45 |
+
'tel' => '',
|
46 |
+
'mail' => '',
|
47 |
+
'date' => '',
|
48 |
+
'url' => '',
|
49 |
+
'eq' => '',
|
50 |
+
'between' => '',
|
51 |
+
'minlength' => '',
|
52 |
+
'filetype' => '',
|
53 |
+
'filesize' => '',
|
54 |
+
);
|
55 |
private $defaults = array(
|
56 |
'mail_subject' => '',
|
57 |
'mail_from' => '',
|
83 |
* __construct
|
84 |
*/
|
85 |
public function __construct() {
|
86 |
+
add_action( 'plugins_loaded', array( $this, 'load_init_files' ), 9 );
|
87 |
+
add_action( 'plugins_loaded', array( $this, 'init' ), 11 );
|
88 |
// 有効化した時の処理
|
89 |
register_activation_hook( __FILE__, array( __CLASS__, 'activation' ) );
|
90 |
// アンインストールした時の処理
|
91 |
register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );
|
92 |
}
|
93 |
|
94 |
+
/**
|
95 |
+
* load_init_files
|
96 |
+
* init に必要なファイルをロード
|
97 |
+
*/
|
98 |
+
public function load_init_files() {
|
99 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_admin_page.php' );
|
100 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_contact_data_page.php' );
|
101 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_session.php' );
|
102 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_data.php' );
|
103 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_validation_rule.php' );
|
104 |
+
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_form_field.php' );
|
105 |
+
}
|
106 |
+
|
107 |
/**
|
108 |
* init
|
109 |
* ファイルの読み込み等
|
112 |
load_plugin_textdomain( MWF_Config::DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );
|
113 |
|
114 |
// 管理画面の実行
|
|
|
115 |
$this->MW_WP_Form_Admin_Page = new MW_WP_Form_Admin_Page();
|
116 |
+
$MW_WP_Form_Contact_Data_Page = new MW_WP_Form_Contact_Data_Page();
|
|
|
117 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
118 |
|
119 |
// フォームフィールドの読み込み、インスタンス化
|
|
|
120 |
foreach ( glob( plugin_dir_path( __FILE__ ) . 'form_fields/*.php' ) as $form_field ) {
|
121 |
include_once $form_field;
|
122 |
$className = basename( $form_field, '.php' );
|
125 |
}
|
126 |
}
|
127 |
|
128 |
+
// バリデーションルールの読み込み、インスタンス化
|
129 |
+
$validation_rules = $this->validation_rules;
|
130 |
+
foreach ( glob( plugin_dir_path( __FILE__ ) . 'validation_rules/*.php' ) as $validation_rule ) {
|
131 |
+
include_once $validation_rule;
|
132 |
+
$className = basename( $validation_rule, '.php' );
|
133 |
+
if ( class_exists( $className ) ) {
|
134 |
+
$validation_rules[$className::getName()] = new $className( $this->key );
|
135 |
+
}
|
136 |
+
}
|
137 |
+
$validation_rules = apply_filters( 'mwform_validation_rules', $validation_rules, $this->key );
|
138 |
+
foreach ( $validation_rules as $validation_name => $instance ) {
|
139 |
+
if ( is_callable( array( $instance, 'admin' ) ) ) {
|
140 |
+
$this->MW_WP_Form_Admin_Page->add_validation_rule( get_class( $instance ) );
|
141 |
+
}
|
142 |
+
}
|
143 |
+
$this->validation_rules = $validation_rules;
|
144 |
+
|
145 |
if ( is_admin() ) return;
|
146 |
|
147 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_akismet.php' );
|
148 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_error.php' );
|
149 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_form.php' );
|
150 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_mail.php' );
|
|
|
151 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_validation.php' );
|
|
|
152 |
include_once( plugin_dir_path( __FILE__ ) . 'system/mw_wp_form_file.php' );
|
153 |
add_action( 'nocache_headers' , array( $this, 'nocache_headers' ) , 1 );
|
154 |
add_filter( 'template_include', array( $this, 'main' ), 10000 );
|
316 |
return $template;
|
317 |
|
318 |
// セッション初期化
|
|
|
|
|
|
|
319 |
$this->Data = MW_WP_Form_Data::getInstance( $this->key );
|
320 |
+
// $_POSTがあるときは$_POST
|
321 |
+
if ( !empty( $_POST ) ) {
|
322 |
+
$this->Data->setValues( $_POST );
|
323 |
+
}
|
324 |
|
325 |
// $_FILESがあるときは$this->dataに統合
|
326 |
$files = array();
|
344 |
|
345 |
// バリデーションオブジェクト生成
|
346 |
$this->Validation = new MW_Validation( $this->key );
|
347 |
+
foreach ( $this->validation_rules as $validation_name => $instance ) {
|
348 |
+
if ( is_callable( array( $instance, 'rule' ) ) ) {
|
349 |
+
$this->Validation->add_validation_rule( $instance::getName(), $instance );
|
350 |
+
}
|
351 |
+
}
|
352 |
// バリデーション実行(Validation->dataに値がないと$Errorは返さない(true))
|
353 |
$this->apply_filters_mwform_validation();
|
354 |
|
510 |
$this->options_by_formkey['akismet_author'],
|
511 |
$this->options_by_formkey['akismet_author_email'],
|
512 |
$this->options_by_formkey['akismet_author_url'],
|
513 |
+
$this->Data
|
514 |
);
|
515 |
if ( $akismet_check ) {
|
516 |
$this->Validation->setRule( MWF_Config::AKISMET, 'akismet_check' );
|
610 |
|
611 |
if ( isset( $this->options_by_formkey['automatic_reply_email'] ) ) {
|
612 |
$automatic_reply_email = $this->Data->getValue( $this->options_by_formkey['automatic_reply_email'] );
|
613 |
+
if ( $automatic_reply_email && !$this->validation_rules['mail']->rule( $automatic_reply_email ) ) {
|
614 |
$Mail_raw = $this->set_reply_mail_raw_params( $Mail_raw );
|
615 |
|
616 |
// 自動返信メールからは添付ファイルを削除
|
689 |
* 第2引数でDB保存するか判定
|
690 |
*/
|
691 |
protected function parse_mail_body( $matches, $doUpdate = false ) {
|
692 |
+
$value = $this->Data->get( $matches[1] );
|
693 |
+
if ( $value !== null && $doUpdate ) {
|
694 |
+
update_post_meta( $this->insert_id, $matches[1], $value );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
695 |
}
|
696 |
+
return $value;
|
697 |
}
|
698 |
|
699 |
/**
|
994 |
$admin_mail_sender = get_bloginfo( 'name' );
|
995 |
|
996 |
if ( !$Mail->to ) {
|
997 |
+
$Mail->to = $admin_mail_to;
|
998 |
}
|
999 |
if ( !$Mail->from ) {
|
1000 |
$Mail->from = $admin_mail_from;;
|
1089 |
$Mail->bcc = '';
|
1090 |
if ( $this->options_by_formkey ) {
|
1091 |
$automatic_reply_email = $this->Data->getValue( $this->options_by_formkey['automatic_reply_email'] );
|
1092 |
+
if ( $automatic_reply_email && !$this->validation_rules['mail']->rule( $automatic_reply_email ) ) {
|
1093 |
// 送信先を指定
|
1094 |
$Mail->to = $automatic_reply_email;
|
1095 |
|
readme.txt
CHANGED
@@ -2,10 +2,10 @@
|
|
2 |
Contributors: inc2734, ryu263
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
Tags: plugin, form, confirm, preview, shortcode, mail
|
5 |
-
Requires at least: 3.
|
6 |
Tested up to: 3.9.1
|
7 |
-
Stable tag: 1.
|
8 |
-
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
MW WP Form can create mail form with a confirmation screen using shortcode.
|
@@ -54,6 +54,15 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
|
|
54 |
|
55 |
== Changelog ==
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
= 1.7.2 =
|
58 |
* Bug fix : XSS vulnerability fix.
|
59 |
|
2 |
Contributors: inc2734, ryu263
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
Tags: plugin, form, confirm, preview, shortcode, mail
|
5 |
+
Requires at least: 3.7
|
6 |
Tested up to: 3.9.1
|
7 |
+
Stable tag: 1.8.0
|
8 |
+
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
11 |
MW WP Form can create mail form with a confirmation screen using shortcode.
|
54 |
|
55 |
== Changelog ==
|
56 |
|
57 |
+
= 1.8.0 =
|
58 |
+
* Added : Add mwform_validation_rules filter hook.
|
59 |
+
* Added : Add API to get the data for mail.
|
60 |
+
* Added : Add setting of response status in saved contact data.
|
61 |
+
* Added : Add response status and memo in csv.
|
62 |
+
* Added : Add returning link from detail of database saving data to list page.
|
63 |
+
* Changed : Form field is empty if seted null in value of shortcode.
|
64 |
+
* Changed : WordPress 3.7 higher is required.
|
65 |
+
|
66 |
= 1.7.2 =
|
67 |
* Bug fix : XSS vulnerability fix.
|
68 |
|
system/mw_akismet.php
CHANGED
@@ -1,34 +1,21 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Akismet
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: Akismetクラス
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : April 30, 2014
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_Akismet {
|
29 |
-
public function __construct() {
|
30 |
-
}
|
31 |
|
|
|
|
|
|
|
|
|
32 |
private function is_enable() {
|
33 |
if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) {
|
34 |
return Akismet::get_api_key();
|
@@ -39,7 +26,15 @@ class MW_Akismet {
|
|
39 |
return false;
|
40 |
}
|
41 |
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
global $akismet_api_host, $akismet_api_port;
|
44 |
|
45 |
if ( !$this->is_enable() )
|
@@ -48,32 +43,28 @@ class MW_Akismet {
|
|
48 |
$doAkismet = false;
|
49 |
|
50 |
$author = '';
|
51 |
-
if (
|
52 |
-
$author = $
|
53 |
$doAkismet = true;
|
54 |
}
|
55 |
|
56 |
$author_email = '';
|
57 |
-
if (
|
58 |
-
$author_email = $
|
59 |
$doAkismet = true;
|
60 |
}
|
61 |
|
62 |
$author_url = '';
|
63 |
-
if (
|
64 |
-
$author_url = $
|
65 |
$doAkismet = true;
|
66 |
}
|
67 |
|
68 |
if ( $doAkismet ) {
|
69 |
$content = '';
|
70 |
-
foreach ( $
|
71 |
-
|
72 |
-
|
73 |
-
}
|
74 |
-
if ( !is_array( $value ) ) {
|
75 |
-
$content .= $value . "\n\n";
|
76 |
-
}
|
77 |
}
|
78 |
$permalink = get_permalink();
|
79 |
$akismet = array();
|
@@ -110,4 +101,3 @@ class MW_Akismet {
|
|
110 |
}
|
111 |
}
|
112 |
}
|
113 |
-
?>
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Akismet
|
|
|
4 |
* Description: Akismetクラス
|
5 |
+
* Version: 1.0.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : April 30, 2014
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Akismet {
|
|
|
|
|
14 |
|
15 |
+
/**
|
16 |
+
* is_enable
|
17 |
+
* @return string APIキー
|
18 |
+
*/
|
19 |
private function is_enable() {
|
20 |
if ( is_callable( array( 'Akismet', 'get_api_key' ) ) ) {
|
21 |
return Akismet::get_api_key();
|
26 |
return false;
|
27 |
}
|
28 |
|
29 |
+
/**
|
30 |
+
* check
|
31 |
+
* @param string $akismet_author
|
32 |
+
* @param string $akismet_author_email
|
33 |
+
* @param string $akismet_author_url
|
34 |
+
* @param MW_WP_Form_Data $Data
|
35 |
+
* @return bool
|
36 |
+
*/
|
37 |
+
public function check( $akismet_author, $akismet_author_email, $akismet_author_url, $Data ) {
|
38 |
global $akismet_api_host, $akismet_api_port;
|
39 |
|
40 |
if ( !$this->is_enable() )
|
43 |
$doAkismet = false;
|
44 |
|
45 |
$author = '';
|
46 |
+
if ( $Data->getValue( $akismet_author ) ) {
|
47 |
+
$author = $Data->getValue( $akismet_author );
|
48 |
$doAkismet = true;
|
49 |
}
|
50 |
|
51 |
$author_email = '';
|
52 |
+
if ( $Data->getValue( $akismet_author_email ) ) {
|
53 |
+
$author_email = $Data->getValue( $akismet_author_email );
|
54 |
$doAkismet = true;
|
55 |
}
|
56 |
|
57 |
$author_url = '';
|
58 |
+
if ( $Data->getValue( $akismet_author_url ) ) {
|
59 |
+
$author_url = $Data->getValue( $akismet_author_url );
|
60 |
$doAkismet = true;
|
61 |
}
|
62 |
|
63 |
if ( $doAkismet ) {
|
64 |
$content = '';
|
65 |
+
foreach ( $Data->getValues() as $key => $value ) {
|
66 |
+
$value = $Data->get( $key );
|
67 |
+
$content .= $value . "\n\n";
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
$permalink = get_permalink();
|
70 |
$akismet = array();
|
101 |
}
|
102 |
}
|
103 |
}
|
|
system/mw_error.php
CHANGED
@@ -1,32 +1,20 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Error
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: エラークラス
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : July 17, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
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_Error {
|
29 |
|
|
|
|
|
|
|
30 |
private $errors = array();
|
31 |
|
32 |
/**
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Error
|
|
|
4 |
* Description: エラークラス
|
5 |
+
* Version: 1.0.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : July 17, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Error {
|
14 |
|
15 |
+
/**
|
16 |
+
* エラー格納用の配列 array( 'key' => 'rule' => 'message' )
|
17 |
+
*/
|
18 |
private $errors = array();
|
19 |
|
20 |
/**
|
system/mw_form.php
CHANGED
@@ -1,29 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: フォームクラス
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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 {
|
29 |
|
@@ -47,11 +32,6 @@ class MW_Form {
|
|
47 |
*/
|
48 |
protected $Data;
|
49 |
|
50 |
-
/**
|
51 |
-
* sessionオブジェクト
|
52 |
-
*/
|
53 |
-
protected $Session;
|
54 |
-
|
55 |
/**
|
56 |
* 確認ボタンの名前
|
57 |
*/
|
@@ -62,10 +42,19 @@ class MW_Form {
|
|
62 |
*/
|
63 |
protected $backButton = 'submitBack';
|
64 |
|
|
|
|
|
|
|
65 |
protected $modeCheck = 'input';
|
|
|
|
|
|
|
|
|
66 |
protected $method = 'post';
|
67 |
-
private $ENCODE = 'utf-8';
|
68 |
|
|
|
|
|
|
|
69 |
const COMPLETE_TWICE = '__complete_twice_flg';
|
70 |
|
71 |
/**
|
@@ -78,7 +67,6 @@ class MW_Form {
|
|
78 |
if ( $key ) {
|
79 |
$this->key = $key . '_key';
|
80 |
}
|
81 |
-
$this->Session = MW_Session::start( $this->key );
|
82 |
$this->modeCheck = $this->modeCheck();
|
83 |
}
|
84 |
|
@@ -210,16 +198,7 @@ class MW_Form {
|
|
210 |
* @return string データ
|
211 |
*/
|
212 |
public function getZipValue( $key ) {
|
213 |
-
|
214 |
-
// すべて空のからのときはimplodeしないように(---がいってしまうため)
|
215 |
-
$value = $this->getValue( $key );
|
216 |
-
if ( is_array( $value ) && isset( $value['data'] ) && is_array( $value['data'] ) && !empty( $separator ) ) {
|
217 |
-
foreach ( $value['data'] as $child ) {
|
218 |
-
if ( $child !== '' && $child !== null ) {
|
219 |
-
return implode( $separator, $value['data'] );
|
220 |
-
}
|
221 |
-
}
|
222 |
-
}
|
223 |
}
|
224 |
|
225 |
/**
|
@@ -240,17 +219,7 @@ class MW_Form {
|
|
240 |
* @return string データ
|
241 |
*/
|
242 |
public function getCheckedValue( $key, Array $data ) {
|
243 |
-
|
244 |
-
$value = $this->getValue( $key );
|
245 |
-
if ( is_array( $value ) && isset( $value['data'] ) && is_array( $value['data'] ) && !empty( $separator ) ) {
|
246 |
-
$rightData = array();
|
247 |
-
foreach ( $value['data'] as $child ) {
|
248 |
-
if ( isset( $data[$child] ) && !in_array( $data[$child], $rightData ) ) {
|
249 |
-
$rightData[] = $data[$child];
|
250 |
-
}
|
251 |
-
}
|
252 |
-
return implode( $separator, $rightData );
|
253 |
-
}
|
254 |
}
|
255 |
|
256 |
/**
|
@@ -304,10 +273,7 @@ class MW_Form {
|
|
304 |
* @return string
|
305 |
*/
|
306 |
public function getSeparatorValue( $key ) {
|
307 |
-
|
308 |
-
if ( is_array( $value ) && isset( $value['separator'] ) ) {
|
309 |
-
return $value['separator'];
|
310 |
-
}
|
311 |
}
|
312 |
|
313 |
/**
|
@@ -358,9 +324,12 @@ class MW_Form {
|
|
358 |
'placeholder' => '',
|
359 |
);
|
360 |
$options = array_merge( $defaults, $options );
|
361 |
-
$value = $
|
362 |
-
if ( is_null( $value ) ) {
|
363 |
-
$value = $
|
|
|
|
|
|
|
364 |
}
|
365 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
366 |
$dataConvHalfAlphanumeric = null;
|
@@ -387,10 +356,6 @@ class MW_Form {
|
|
387 |
* @return string HTML
|
388 |
*/
|
389 |
public function hidden( $name, $value ) {
|
390 |
-
$_value = $this->getValue( $name );
|
391 |
-
if ( !is_null( $_value ) ) {
|
392 |
-
$value = $_value;
|
393 |
-
}
|
394 |
if ( is_array( $value ) ) {
|
395 |
$value = $this->getZipValue( $name );
|
396 |
}
|
@@ -413,9 +378,12 @@ class MW_Form {
|
|
413 |
'placeholder' => '',
|
414 |
);
|
415 |
$options = array_merge( $defaults, $options );
|
416 |
-
$value = $
|
417 |
-
if ( is_null( $value ) ) {
|
418 |
-
$value = $
|
|
|
|
|
|
|
419 |
}
|
420 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
421 |
$id = $this->get_attr_id( $options['id'] );
|
@@ -550,9 +518,12 @@ class MW_Form {
|
|
550 |
'placeholder' => '',
|
551 |
);
|
552 |
$options = array_merge( $defaults, $options );
|
553 |
-
$value = $
|
554 |
-
if ( is_null( $value ) ) {
|
555 |
-
$value = $
|
|
|
|
|
|
|
556 |
}
|
557 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
558 |
$id = $this->get_attr_id( $options['id'] );
|
@@ -580,9 +551,12 @@ class MW_Form {
|
|
580 |
'value' => ''
|
581 |
);
|
582 |
$options = array_merge( $defaults, $options );
|
583 |
-
$value = $
|
584 |
-
if ( is_null( $value ) ) {
|
585 |
-
$value = $
|
|
|
|
|
|
|
586 |
}
|
587 |
$id = $this->get_attr_id( $options['id'] );
|
588 |
$_ret = sprintf( '<select name="%s" %s>', esc_attr( $name ), $id );
|
@@ -610,9 +584,12 @@ class MW_Form {
|
|
610 |
'value' => ''
|
611 |
);
|
612 |
$options = array_merge( $defaults, $options );
|
613 |
-
$value = $
|
614 |
-
if ( is_null( $value ) ) {
|
615 |
-
$value = $
|
|
|
|
|
|
|
616 |
}
|
617 |
|
618 |
$i = 0;
|
@@ -649,15 +626,17 @@ class MW_Form {
|
|
649 |
'value' => array()
|
650 |
);
|
651 |
$options = array_merge( $defaults, $options );
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
$value
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
|
|
|
|
661 |
}
|
662 |
|
663 |
$i = 0;
|
@@ -717,9 +696,12 @@ class MW_Form {
|
|
717 |
'value' => '',
|
718 |
);
|
719 |
$options = array_merge( $defaults, $options );
|
720 |
-
$value = $
|
721 |
-
if ( is_null( $value ) ) {
|
722 |
-
$value = $
|
|
|
|
|
|
|
723 |
}
|
724 |
$id = $this->get_attr_id( $options['id'] );
|
725 |
$_ret = sprintf( '<input type="text" name="%s" value="%s" size="%d" %s />',
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form
|
|
|
4 |
* Description: フォームクラス
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : September 25, 2012
|
9 |
+
* Modified: July 23, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Form {
|
14 |
|
32 |
*/
|
33 |
protected $Data;
|
34 |
|
|
|
|
|
|
|
|
|
|
|
35 |
/**
|
36 |
* 確認ボタンの名前
|
37 |
*/
|
42 |
*/
|
43 |
protected $backButton = 'submitBack';
|
44 |
|
45 |
+
/**
|
46 |
+
* 現在のモード
|
47 |
+
*/
|
48 |
protected $modeCheck = 'input';
|
49 |
+
|
50 |
+
/**
|
51 |
+
* フォームの method
|
52 |
+
*/
|
53 |
protected $method = 'post';
|
|
|
54 |
|
55 |
+
/**
|
56 |
+
* 完了画面の判定用
|
57 |
+
*/
|
58 |
const COMPLETE_TWICE = '__complete_twice_flg';
|
59 |
|
60 |
/**
|
67 |
if ( $key ) {
|
68 |
$this->key = $key . '_key';
|
69 |
}
|
|
|
70 |
$this->modeCheck = $this->modeCheck();
|
71 |
}
|
72 |
|
198 |
* @return string データ
|
199 |
*/
|
200 |
public function getZipValue( $key ) {
|
201 |
+
return $this->Data->getSeparatedValue( $key );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
/**
|
219 |
* @return string データ
|
220 |
*/
|
221 |
public function getCheckedValue( $key, Array $data ) {
|
222 |
+
return $this->Data->getSeparatedValue( $key, $data );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
223 |
}
|
224 |
|
225 |
/**
|
273 |
* @return string
|
274 |
*/
|
275 |
public function getSeparatorValue( $key ) {
|
276 |
+
return $this->Data->getSeparatorValue( $key );
|
|
|
|
|
|
|
277 |
}
|
278 |
|
279 |
/**
|
324 |
'placeholder' => '',
|
325 |
);
|
326 |
$options = array_merge( $defaults, $options );
|
327 |
+
$value = $options['value'];
|
328 |
+
if ( !is_null( $value ) ) {
|
329 |
+
$value = $this->getValue( $name );
|
330 |
+
if ( is_null( $value ) ) {
|
331 |
+
$value = $options['value'];
|
332 |
+
}
|
333 |
}
|
334 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
335 |
$dataConvHalfAlphanumeric = null;
|
356 |
* @return string HTML
|
357 |
*/
|
358 |
public function hidden( $name, $value ) {
|
|
|
|
|
|
|
|
|
359 |
if ( is_array( $value ) ) {
|
360 |
$value = $this->getZipValue( $name );
|
361 |
}
|
378 |
'placeholder' => '',
|
379 |
);
|
380 |
$options = array_merge( $defaults, $options );
|
381 |
+
$value = $options['value'];
|
382 |
+
if ( !is_null( $value ) ) {
|
383 |
+
$value = $this->getValue( $name );
|
384 |
+
if ( is_null( $value ) ) {
|
385 |
+
$value = $options['value'];
|
386 |
+
}
|
387 |
}
|
388 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
389 |
$id = $this->get_attr_id( $options['id'] );
|
518 |
'placeholder' => '',
|
519 |
);
|
520 |
$options = array_merge( $defaults, $options );
|
521 |
+
$value = $options['value'];
|
522 |
+
if ( !is_null( $value ) ) {
|
523 |
+
$value = $this->getValue( $name );
|
524 |
+
if ( is_null( $value ) ) {
|
525 |
+
$value = $options['value'];
|
526 |
+
}
|
527 |
}
|
528 |
$placeholder = $this->get_attr_placeholder( $options['placeholder'] );
|
529 |
$id = $this->get_attr_id( $options['id'] );
|
551 |
'value' => ''
|
552 |
);
|
553 |
$options = array_merge( $defaults, $options );
|
554 |
+
$value = $options['value'];
|
555 |
+
if ( !is_null( $value ) ) {
|
556 |
+
$value = $this->getValue( $name );
|
557 |
+
if ( is_null( $value ) ) {
|
558 |
+
$value = $options['value'];
|
559 |
+
}
|
560 |
}
|
561 |
$id = $this->get_attr_id( $options['id'] );
|
562 |
$_ret = sprintf( '<select name="%s" %s>', esc_attr( $name ), $id );
|
584 |
'value' => ''
|
585 |
);
|
586 |
$options = array_merge( $defaults, $options );
|
587 |
+
$value = $options['value'];
|
588 |
+
if ( !is_null( $value ) ) {
|
589 |
+
$value = $this->getValue( $name );
|
590 |
+
if ( is_null( $value ) ) {
|
591 |
+
$value = $options['value'];
|
592 |
+
}
|
593 |
}
|
594 |
|
595 |
$i = 0;
|
626 |
'value' => array()
|
627 |
);
|
628 |
$options = array_merge( $defaults, $options );
|
629 |
+
$value = $options['value'];
|
630 |
+
if ( !is_null( $value ) ) {
|
631 |
+
$value = $this->getValue( $name );
|
632 |
+
if ( is_array( $value ) && isset( $value['data'] ) ) {
|
633 |
+
$value = $value['data'];
|
634 |
+
} else {
|
635 |
+
$value = $options['value'];
|
636 |
+
}
|
637 |
+
if ( !is_array( $value ) ) {
|
638 |
+
$value = explode( $separator, $value );
|
639 |
+
}
|
640 |
}
|
641 |
|
642 |
$i = 0;
|
696 |
'value' => '',
|
697 |
);
|
698 |
$options = array_merge( $defaults, $options );
|
699 |
+
$value = $options['value'];
|
700 |
+
if ( !is_null( $value ) ) {
|
701 |
+
$value = $this->getValue( $name );
|
702 |
+
if ( is_null( $value ) ) {
|
703 |
+
$value = $options['value'];
|
704 |
+
}
|
705 |
}
|
706 |
$id = $this->get_attr_id( $options['id'] );
|
707 |
$_ret = sprintf( '<input type="text" name="%s" value="%s" size="%d" %s />',
|
system/mw_form_field.php
CHANGED
@@ -1,31 +1,16 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: フォームフィールドの抽象クラス
|
6 |
-
* Version: 1.6.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : December 14, 2012
|
10 |
-
* Modified: June
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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 |
-
abstract class
|
29 |
|
30 |
/**
|
31 |
* string $shortcode_name
|
@@ -107,7 +92,7 @@ abstract class mw_form_field {
|
|
107 |
* @param string $arg2 終了タグ(ショートコード)
|
108 |
*/
|
109 |
protected function set_qtags( $id, $display, $arg1, $arg2 = '' ) {
|
110 |
-
MWF_Functions::deprecated_message( '
|
111 |
$this->qtags = array(
|
112 |
'id' => $id,
|
113 |
'display' => $display,
|
@@ -148,15 +133,15 @@ abstract class mw_form_field {
|
|
148 |
/**
|
149 |
* setDefaults
|
150 |
* $this->defaultsを設定し返す
|
151 |
-
* @return
|
152 |
*/
|
153 |
abstract protected function setDefaults();
|
154 |
|
155 |
/**
|
156 |
* inputPage
|
157 |
* 入力ページでのフォーム項目を返す
|
158 |
-
* @param
|
159 |
-
* @return
|
160 |
*/
|
161 |
abstract protected function inputPage();
|
162 |
public function _inputPage( $atts ) {
|
@@ -170,8 +155,8 @@ abstract class mw_form_field {
|
|
170 |
/**
|
171 |
* confirmPage
|
172 |
* 確認ページでのフォーム項目を返す
|
173 |
-
* @param
|
174 |
-
* @return
|
175 |
*/
|
176 |
abstract protected function confirmPage();
|
177 |
public function _confirmPage( $atts ) {
|
@@ -182,12 +167,12 @@ abstract class mw_form_field {
|
|
182 |
/**
|
183 |
* add_short_code
|
184 |
* フォーム項目を返す
|
185 |
-
* @param
|
186 |
-
*
|
187 |
-
*
|
188 |
-
*
|
189 |
*/
|
190 |
-
public function add_shortcode(
|
191 |
if ( !empty( $this->shortcode_name ) ) {
|
192 |
$this->Form = $Form;
|
193 |
$this->Error = $Error;
|
@@ -213,7 +198,7 @@ abstract class mw_form_field {
|
|
213 |
*/
|
214 |
protected function getChildren( $_children ) {
|
215 |
$children = array();
|
216 |
-
if ( !empty( $_children) && !is_array( $_children ) ) {
|
217 |
$_children = explode( ',', $_children );
|
218 |
}
|
219 |
if ( is_array( $_children ) ) {
|
@@ -243,9 +228,9 @@ abstract class mw_form_field {
|
|
243 |
public function add_mwform_tag_generator() {
|
244 |
?>
|
245 |
<div id="dialog-<?php echo esc_attr( $this->shortcode_name ); ?>" class="mwform-dialog" title="<?php echo esc_attr( $this->shortcode_name ); ?>">
|
246 |
-
<form>
|
247 |
<?php $this->mwform_tag_generator_dialog(); ?>
|
248 |
-
</
|
249 |
</div>
|
250 |
<?php
|
251 |
}
|
@@ -269,6 +254,3 @@ abstract class mw_form_field {
|
|
269 |
<?php
|
270 |
}
|
271 |
}
|
272 |
-
|
273 |
-
|
274 |
-
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Form Field
|
|
|
4 |
* Description: フォームフィールドの抽象クラス
|
5 |
+
* Version: 1.6.2
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified: June 23, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
abstract class MW_Form_Field {
|
14 |
|
15 |
/**
|
16 |
* string $shortcode_name
|
92 |
* @param string $arg2 終了タグ(ショートコード)
|
93 |
*/
|
94 |
protected function set_qtags( $id, $display, $arg1, $arg2 = '' ) {
|
95 |
+
MWF_Functions::deprecated_message( 'MW_Form_Field::set_qtags', 'MW_Form_Field::set_names' );
|
96 |
$this->qtags = array(
|
97 |
'id' => $id,
|
98 |
'display' => $display,
|
133 |
/**
|
134 |
* setDefaults
|
135 |
* $this->defaultsを設定し返す
|
136 |
+
* @return array defaults
|
137 |
*/
|
138 |
abstract protected function setDefaults();
|
139 |
|
140 |
/**
|
141 |
* inputPage
|
142 |
* 入力ページでのフォーム項目を返す
|
143 |
+
* @param array $atts
|
144 |
+
* @return string HTML
|
145 |
*/
|
146 |
abstract protected function inputPage();
|
147 |
public function _inputPage( $atts ) {
|
155 |
/**
|
156 |
* confirmPage
|
157 |
* 確認ページでのフォーム項目を返す
|
158 |
+
* @param array $atts
|
159 |
+
* @return string HTML
|
160 |
*/
|
161 |
abstract protected function confirmPage();
|
162 |
public function _confirmPage( $atts ) {
|
167 |
/**
|
168 |
* add_short_code
|
169 |
* フォーム項目を返す
|
170 |
+
* @param MW_Form $Form
|
171 |
+
* @param string $viewFlg
|
172 |
+
* @param MW_Error $Error
|
173 |
+
* @param string $key
|
174 |
*/
|
175 |
+
public function add_shortcode( MW_Form $Form, $viewFlg, MW_Error $Error, $key ) {
|
176 |
if ( !empty( $this->shortcode_name ) ) {
|
177 |
$this->Form = $Form;
|
178 |
$this->Error = $Error;
|
198 |
*/
|
199 |
protected function getChildren( $_children ) {
|
200 |
$children = array();
|
201 |
+
if ( !empty( $_children ) && !is_array( $_children ) ) {
|
202 |
$_children = explode( ',', $_children );
|
203 |
}
|
204 |
if ( is_array( $_children ) ) {
|
228 |
public function add_mwform_tag_generator() {
|
229 |
?>
|
230 |
<div id="dialog-<?php echo esc_attr( $this->shortcode_name ); ?>" class="mwform-dialog" title="<?php echo esc_attr( $this->shortcode_name ); ?>">
|
231 |
+
<div class="form">
|
232 |
<?php $this->mwform_tag_generator_dialog(); ?>
|
233 |
+
</div>
|
234 |
</div>
|
235 |
<?php
|
236 |
}
|
254 |
<?php
|
255 |
}
|
256 |
}
|
|
|
|
|
|
system/mw_mail.php
CHANGED
@@ -1,41 +1,56 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Mail
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: メールクラス
|
6 |
-
* Version: 1.4.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: July 20, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_Mail {
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
public $
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
/**
|
41 |
* send
|
@@ -78,10 +93,11 @@ class MW_Mail {
|
|
78 |
/**
|
79 |
* createBody
|
80 |
* 配列からbodyを生成
|
81 |
-
* @param
|
82 |
-
*
|
|
|
83 |
*/
|
84 |
-
public function createBody(
|
85 |
$_ret = '';
|
86 |
$defaults = array(
|
87 |
'exclude' => array()
|
@@ -110,4 +126,3 @@ class MW_Mail {
|
|
110 |
return $_ret;
|
111 |
}
|
112 |
}
|
113 |
-
?>
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Mail
|
|
|
4 |
* Description: メールクラス
|
5 |
+
* Version: 1.4.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created: July 20, 2012
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Mail {
|
14 |
|
15 |
+
/**
|
16 |
+
* 宛先
|
17 |
+
*/
|
18 |
+
public $to;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* CC
|
22 |
+
*/
|
23 |
+
public $cc;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* BCC
|
27 |
+
*/
|
28 |
+
public $bcc;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* 送信元
|
32 |
+
*/
|
33 |
+
public $from;
|
34 |
+
|
35 |
+
/**
|
36 |
+
* 送信者
|
37 |
+
*/
|
38 |
+
public $sender;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* 件名
|
42 |
+
*/
|
43 |
+
public $subject;
|
44 |
+
|
45 |
+
/**
|
46 |
+
* 本文
|
47 |
+
*/
|
48 |
+
public $body;
|
49 |
+
|
50 |
+
/**
|
51 |
+
* 添付
|
52 |
+
*/
|
53 |
+
public $attachments;
|
54 |
|
55 |
/**
|
56 |
* send
|
93 |
/**
|
94 |
* createBody
|
95 |
* 配列からbodyを生成
|
96 |
+
* @param array ( 見出し => 内容, … )
|
97 |
+
* @param array ( 'exclude' => array( 除外したいキー1, … ) )
|
98 |
+
* @return string メール本文
|
99 |
*/
|
100 |
+
public function createBody( array $array, array $options = array() ) {
|
101 |
$_ret = '';
|
102 |
$defaults = array(
|
103 |
'exclude' => array()
|
126 |
return $_ret;
|
127 |
}
|
128 |
}
|
|
system/mw_session.php
CHANGED
@@ -1,65 +1,45 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Session
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: セッションクラス
|
6 |
-
* Version: 2.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : July 17, 2012
|
10 |
-
* Modified: June
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_Session {
|
29 |
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
|
38 |
/**
|
39 |
-
*
|
40 |
-
* インスタンス化
|
41 |
* @param string $name 識別子
|
42 |
-
* @return Session Sessionオブジェクト
|
43 |
*/
|
44 |
-
public
|
45 |
-
|
46 |
-
if ( isset( $_COOKIE[
|
47 |
-
$session_id = $_COOKIE[
|
48 |
} else {
|
49 |
-
$session_id = sha1( wp_create_nonce(
|
50 |
$secure = apply_filters( 'mwform_secure_cookie', is_ssl() );
|
51 |
-
setcookie(
|
52 |
}
|
53 |
-
$Session = new MW_Session( $session_id );
|
54 |
-
return $Session;
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* setSessionName
|
59 |
-
* セッション名を設定
|
60 |
-
* @param string $session_id
|
61 |
-
*/
|
62 |
-
private function setSessionName( $session_id ) {
|
63 |
$this->session_id = $session_id;
|
64 |
}
|
65 |
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Session
|
|
|
4 |
* Description: セッションクラス
|
5 |
+
* Version: 2.0.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : July 17, 2012
|
9 |
+
* Modified: June 23, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Session {
|
14 |
|
15 |
+
/**
|
16 |
+
* セッション名
|
17 |
+
*/
|
18 |
+
private $name;
|
19 |
|
20 |
+
/**
|
21 |
+
* セッションID
|
22 |
+
*/
|
23 |
+
private $session_id;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Transient の生存時間
|
27 |
+
*/
|
28 |
+
private $expiration = 1440;
|
29 |
|
30 |
/**
|
31 |
+
* __construct
|
|
|
32 |
* @param string $name 識別子
|
|
|
33 |
*/
|
34 |
+
public function __construct( $name ) {
|
35 |
+
$this->name = MWF_Config::NAME . '_session_' . $name;
|
36 |
+
if ( isset( $_COOKIE[$this->name] ) ) {
|
37 |
+
$session_id = $_COOKIE[$this->name];
|
38 |
} else {
|
39 |
+
$session_id = sha1( wp_create_nonce( $this->name ) . ip2long( $_SERVER['REMOTE_ADDR'] ) . uniqid() );
|
40 |
$secure = apply_filters( 'mwform_secure_cookie', is_ssl() );
|
41 |
+
setcookie( $this->name, $session_id, 0, COOKIEPATH, COOKIE_DOMAIN, $secure, true );
|
42 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
$this->session_id = $session_id;
|
44 |
}
|
45 |
|
system/mw_validation.php
CHANGED
@@ -1,548 +1,60 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Validation
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: バリデーションクラス
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : July 20, 2012
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_Validation {
|
29 |
|
30 |
-
protected $Data;
|
31 |
-
protected $Error;
|
32 |
-
public $validate = array();
|
33 |
-
private $ENCODE = 'utf-8';
|
34 |
-
|
35 |
-
/**
|
36 |
-
* __construct
|
37 |
-
* @param string $key 識別子
|
38 |
-
*/
|
39 |
-
public function __construct( $key ) {
|
40 |
-
$this->Data = MW_WP_Form_Data::getInstance( $key );
|
41 |
-
$this->Error = new MW_Error();
|
42 |
-
}
|
43 |
-
|
44 |
-
/**
|
45 |
-
* getValue
|
46 |
-
* フォームの送信値を返す(配列の場合は $data['data'] を、違う場合は $data)。
|
47 |
-
* @param string $key name属性
|
48 |
-
* @return mixed
|
49 |
-
*/
|
50 |
-
private function getValue( $key ) {
|
51 |
-
$data = $this->Data->getValue( $key );
|
52 |
-
if ( !isset( $data ) )
|
53 |
-
return;
|
54 |
-
if ( is_array( $data ) ) {
|
55 |
-
if ( array_key_exists( 'data', $data ) ) {
|
56 |
-
if ( is_array( $data['data'] ) ) {
|
57 |
-
return $this->array_clean( $data['data'] );
|
58 |
-
} else {
|
59 |
-
return $data['data'];
|
60 |
-
}
|
61 |
-
}
|
62 |
-
} else {
|
63 |
-
return $data;
|
64 |
-
}
|
65 |
-
}
|
66 |
-
|
67 |
-
/**
|
68 |
-
* required
|
69 |
-
* 値が存在する
|
70 |
-
* @param string $key name属性
|
71 |
-
* @param array $option
|
72 |
-
* @return string エラーメッセージ
|
73 |
-
*/
|
74 |
-
public function required( $key, $options = array() ) {
|
75 |
-
$value = $this->getValue( $key );
|
76 |
-
// 値が存在するとき、もしくは存在しないけど他のデータもない(=フォーム送信自体されていない)ときはエラーではない
|
77 |
-
if ( !is_null( $value ) || is_null( $value ) && !$this->Data->getValues() ) {
|
78 |
-
return;
|
79 |
-
}
|
80 |
-
$defaults = array(
|
81 |
-
'message' => __( 'This is required.', MWF_Config::DOMAIN )
|
82 |
-
);
|
83 |
-
$options = array_merge( $defaults, $options );
|
84 |
-
return $options['message'];
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* noEmpty
|
89 |
-
* 値が空ではない(0は許可)
|
90 |
-
* @param string $key name属性
|
91 |
-
* @param array $options
|
92 |
-
* @return string エラーメッセージ
|
93 |
-
*/
|
94 |
-
public function noEmpty( $key, $options = array() ) {
|
95 |
-
$value = $this->getValue( $key );
|
96 |
-
if ( !is_null( $value ) && $this->isEmpty( $value ) ) {
|
97 |
-
$defaults = array(
|
98 |
-
'message' => __( 'Please enter.', MWF_Config::DOMAIN )
|
99 |
-
);
|
100 |
-
$options = array_merge( $defaults, $options );
|
101 |
-
return $options['message'];
|
102 |
-
}
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* noFalse
|
107 |
-
* 値が空ではない(0も不可)
|
108 |
-
* @param string $key name属性
|
109 |
-
* @param array $options
|
110 |
-
* @return string エラーメッセージ
|
111 |
-
*/
|
112 |
-
public function noFalse( $key, $options = array() ) {
|
113 |
-
$value = $this->getValue( $key );
|
114 |
-
if ( !is_null( $value ) && empty( $value ) ) {
|
115 |
-
$defaults = array(
|
116 |
-
'message' => __( 'Please enter.', MWF_Config::DOMAIN )
|
117 |
-
);
|
118 |
-
$options = array_merge( $defaults, $options );
|
119 |
-
return $options['message'];
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* alpha
|
125 |
-
* 値がアルファベット
|
126 |
-
* @param string $key name属性
|
127 |
-
* @param array $options
|
128 |
-
* @return string エラーメッセージ
|
129 |
-
*/
|
130 |
-
public function alpha( $key, $options = array() ) {
|
131 |
-
$value = $this->getValue( $key );
|
132 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
133 |
-
if ( is_array( $value ) ) {
|
134 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
135 |
-
}
|
136 |
-
if ( !preg_match( '/^[A-Za-z]+$/', $value ) ) {
|
137 |
-
$defaults = array(
|
138 |
-
'message' => __( 'Please enter with a half-width alphabetic character.', MWF_Config::DOMAIN )
|
139 |
-
);
|
140 |
-
$options = array_merge( $defaults, $options );
|
141 |
-
return $options['message'];
|
142 |
-
}
|
143 |
-
}
|
144 |
-
}
|
145 |
-
|
146 |
-
/**
|
147 |
-
* numeric
|
148 |
-
* 値が数値
|
149 |
-
* @param string $key name属性
|
150 |
-
* @param array $options
|
151 |
-
* @return string エラーメッセージ
|
152 |
-
*/
|
153 |
-
public function numeric( $key, $options = array() ) {
|
154 |
-
$value = $this->getValue( $key );
|
155 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
156 |
-
if ( is_array( $value ) ) {
|
157 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
158 |
-
}
|
159 |
-
if ( !preg_match( '/^[0-9]+$/', $value ) ) {
|
160 |
-
$defaults = array(
|
161 |
-
'message' => __( 'Please enter with a half-width number.', MWF_Config::DOMAIN )
|
162 |
-
);
|
163 |
-
$options = array_merge( $defaults, $options );
|
164 |
-
return $options['message'];
|
165 |
-
}
|
166 |
-
}
|
167 |
-
}
|
168 |
-
|
169 |
-
/**
|
170 |
-
* alphaNumeric
|
171 |
-
* 値が英数値
|
172 |
-
* @param string $key name属性
|
173 |
-
* @param array $options
|
174 |
-
* @return string エラーメッセージ
|
175 |
-
*/
|
176 |
-
public function alphaNumeric( $key, $options = array() ) {
|
177 |
-
$value = $this->getValue( $key );
|
178 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
179 |
-
if ( is_array( $value ) ) {
|
180 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
181 |
-
}
|
182 |
-
if ( !preg_match( '/^[0-9A-Za-z]+$/', $value ) ) {
|
183 |
-
$defaults = array(
|
184 |
-
'message' => __( 'Please enter with a half-width alphanumeric character.', MWF_Config::DOMAIN )
|
185 |
-
);
|
186 |
-
$options = array_merge( $defaults, $options );
|
187 |
-
return $options['message'];
|
188 |
-
}
|
189 |
-
}
|
190 |
-
}
|
191 |
-
|
192 |
-
/**
|
193 |
-
* katakana
|
194 |
-
* 値がカタカナ
|
195 |
-
* @param string $key name属性
|
196 |
-
* @param array $options
|
197 |
-
* @return string エラーメッセージ
|
198 |
-
*/
|
199 |
-
public function katakana( $key, $options = array() ) {
|
200 |
-
$value = $this->getValue( $key );
|
201 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
202 |
-
if ( is_array( $value ) ) {
|
203 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
204 |
-
}
|
205 |
-
if ( !preg_match( '/^[ァ-ヾ ]*?[ァ-ヾ]+?[ァ-ヾ ]*?$/u', $value ) ) {
|
206 |
-
$defaults = array(
|
207 |
-
'message' => __( 'Please enter with a Japanese Katakana.', MWF_Config::DOMAIN )
|
208 |
-
);
|
209 |
-
$options = array_merge( $defaults, $options );
|
210 |
-
return $options['message'];
|
211 |
-
}
|
212 |
-
}
|
213 |
-
}
|
214 |
-
|
215 |
-
/**
|
216 |
-
* hiragana
|
217 |
-
* 値がひらがな
|
218 |
-
* @param string $key name属性
|
219 |
-
* @param array $options
|
220 |
-
* @return string エラーメッセージ
|
221 |
-
*/
|
222 |
-
public function hiragana( $key, $options = array() ) {
|
223 |
-
$value = $this->getValue( $key );
|
224 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
225 |
-
if ( is_array( $value ) ) {
|
226 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
227 |
-
}
|
228 |
-
if ( !preg_match( '/^[ぁ-ゞ ]*?[ぁ-ゞ]+?[ぁ-ゞ ]*?$/u', $value ) ) {
|
229 |
-
$defaults = array(
|
230 |
-
'message' => __( 'Please enter with a Japanese Hiragana.', MWF_Config::DOMAIN )
|
231 |
-
);
|
232 |
-
$options = array_merge( $defaults, $options );
|
233 |
-
return $options['message'];
|
234 |
-
}
|
235 |
-
}
|
236 |
-
}
|
237 |
-
|
238 |
/**
|
239 |
-
*
|
240 |
-
* 値が郵便番号
|
241 |
-
* @param string $key name属性
|
242 |
-
* @param array $options
|
243 |
-
* @return string エラーメッセージ
|
244 |
*/
|
245 |
-
|
246 |
-
$value = $this->getValue( $key );
|
247 |
-
if ( !empty( $value ) ) {
|
248 |
-
$defaults = array(
|
249 |
-
'message' => __( 'This is not the format of a zip code.', MWF_Config::DOMAIN )
|
250 |
-
);
|
251 |
-
$options = array_merge( $defaults, $options );
|
252 |
-
if ( is_array( $value ) ) {
|
253 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
254 |
-
}
|
255 |
-
if ( !preg_match( '/^\d{3}-\d{4}$/', $value ) ) {
|
256 |
-
return $options['message'];
|
257 |
-
}
|
258 |
-
}
|
259 |
-
}
|
260 |
|
261 |
/**
|
262 |
-
*
|
263 |
-
* 値が電話番号
|
264 |
-
* @param string $key name属性
|
265 |
-
* @param array $options
|
266 |
-
* @return string エラーメッセージ
|
267 |
*/
|
268 |
-
|
269 |
-
$value = $this->getValue( $key );
|
270 |
-
if ( !empty( $value ) ) {
|
271 |
-
$defaults = array(
|
272 |
-
'message' => __( 'This is not the format of a tel number.', MWF_Config::DOMAIN )
|
273 |
-
);
|
274 |
-
$options = array_merge( $defaults, $options );
|
275 |
-
if ( is_array( $value ) ) {
|
276 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
277 |
-
}
|
278 |
-
if ( ! (
|
279 |
-
preg_match( '/^\d{2}-\d{4}-\d{4}$/', $value ) ||
|
280 |
-
preg_match( '/^\d{3}-\d{3,4}-\d{4}$/', $value ) ||
|
281 |
-
preg_match( '/^\d{4}-\d{2}-\d{4}$/', $value ) ||
|
282 |
-
preg_match( '/^\d{4}-\d{3}-\d{3}$/', $value ) ||
|
283 |
-
preg_match( '/^\d{5}-\d{1}-\d{4}$/', $value )
|
284 |
-
) ) {
|
285 |
-
return $options['message'];
|
286 |
-
}
|
287 |
-
}
|
288 |
-
}
|
289 |
-
|
290 |
-
/**
|
291 |
-
* mail
|
292 |
-
* 値がメールアドレス
|
293 |
-
* @param string $key name属性
|
294 |
-
* @param array $options
|
295 |
-
* @return string エラーメッセージ
|
296 |
-
*/
|
297 |
-
public function mail( $key, $options = array() ) {
|
298 |
-
$value = $this->getValue( $key );
|
299 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
300 |
-
if ( is_array( $value ) ) {
|
301 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
302 |
-
}
|
303 |
-
if ( !preg_match( '/^[^@]+@([^@^\.]+\.)+[^@^\.]+$/', $value ) ) {
|
304 |
-
$defaults = array(
|
305 |
-
'message' => __( 'This is not the format of a mail address.', MWF_Config::DOMAIN )
|
306 |
-
);
|
307 |
-
$options = array_merge( $defaults, $options );
|
308 |
-
return $options['message'];
|
309 |
-
}
|
310 |
-
}
|
311 |
-
}
|
312 |
-
|
313 |
-
/**
|
314 |
-
* url
|
315 |
-
* 値がURL
|
316 |
-
* @param string $key name属性
|
317 |
-
* @param array $options
|
318 |
-
* @return string エラーメッセージ
|
319 |
-
*/
|
320 |
-
public function url( $key, $options = array() ) {
|
321 |
-
$value = $this->getValue( $key );
|
322 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
323 |
-
if ( is_array( $value ) ) {
|
324 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
325 |
-
}
|
326 |
-
if ( !preg_match( '/^https{0,1}:\/\/[^\/].?/', $value ) ) {
|
327 |
-
$defaults = array(
|
328 |
-
'message' => __( 'This is not the format of a url.', MWF_Config::DOMAIN )
|
329 |
-
);
|
330 |
-
$options = array_merge( $defaults, $options );
|
331 |
-
return $options['message'];
|
332 |
-
}
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
/**
|
337 |
-
* eq
|
338 |
-
* 値が一致している
|
339 |
-
* @param string $name name属性
|
340 |
-
* @param array $options
|
341 |
-
* @return string エラーメッセージ
|
342 |
-
*/
|
343 |
-
public function eq( $key, $options = array() ) {
|
344 |
-
$value = $this->getValue( $key );
|
345 |
-
if ( !is_null( $value ) ) {
|
346 |
-
$defaults = array(
|
347 |
-
'target' => null,
|
348 |
-
'message' => __( 'This is not in agreement.', MWF_Config::DOMAIN )
|
349 |
-
);
|
350 |
-
$options = array_merge( $defaults, $options );
|
351 |
-
$target_value = $this->getValue( $options['target'] );
|
352 |
-
if ( $value !== $target_value ) {
|
353 |
-
return $options['message'];
|
354 |
-
}
|
355 |
-
}
|
356 |
-
}
|
357 |
-
|
358 |
-
/**
|
359 |
-
* between
|
360 |
-
* 値の文字数が範囲内
|
361 |
-
* @param string $name name属性
|
362 |
-
* @param array $options
|
363 |
-
* @return string エラーメッセージ
|
364 |
-
*/
|
365 |
-
public function between( $key, $options = array() ) {
|
366 |
-
$value = $this->getValue( $key );
|
367 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
368 |
-
if ( is_array( $value ) ) {
|
369 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
370 |
-
}
|
371 |
-
$defaults = array(
|
372 |
-
'min' => 0,
|
373 |
-
'max' => 0,
|
374 |
-
'message' => __( 'The number of characters is invalid.', MWF_Config::DOMAIN )
|
375 |
-
);
|
376 |
-
$options = array_merge( $defaults, $options );
|
377 |
-
$length = mb_strlen( $value, $this->ENCODE );
|
378 |
-
if ( MWF_Functions::is_numeric( $options['min'] ) ) {
|
379 |
-
if ( MWF_Functions::is_numeric( $options['max'] ) ) {
|
380 |
-
if ( !( $options['min'] <= $length && $length <= $options['max'] ) ) {
|
381 |
-
return $options['message'];
|
382 |
-
}
|
383 |
-
} else {
|
384 |
-
if ( $options['min'] > $length ) {
|
385 |
-
return $options['message'];
|
386 |
-
}
|
387 |
-
}
|
388 |
-
} elseif ( MWF_Functions::is_numeric( $options['max'] ) ) {
|
389 |
-
if ( $options['max'] < $length ) {
|
390 |
-
return $options['message'];
|
391 |
-
}
|
392 |
-
}
|
393 |
-
}
|
394 |
-
}
|
395 |
-
|
396 |
-
/**
|
397 |
-
* minLength
|
398 |
-
* 値の文字数が範囲内
|
399 |
-
* @param string $name name属性
|
400 |
-
* @param array $options
|
401 |
-
* @return string エラーメッセージ
|
402 |
-
*/
|
403 |
-
public function minLength( $key, $options = array() ) {
|
404 |
-
$value = $this->getValue( $key );
|
405 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
406 |
-
if ( is_array( $value ) ) {
|
407 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
408 |
-
}
|
409 |
-
$defaults = array(
|
410 |
-
'min' => 0,
|
411 |
-
'message' => __( 'The number of characters is a few.', MWF_Config::DOMAIN )
|
412 |
-
);
|
413 |
-
$options = array_merge( $defaults, $options );
|
414 |
-
$length = mb_strlen( $value, $this->ENCODE );
|
415 |
-
if ( MWF_Functions::is_numeric( $options['min'] ) && $options['min'] > $length ) {
|
416 |
-
return $options['message'];
|
417 |
-
}
|
418 |
-
}
|
419 |
-
}
|
420 |
-
|
421 |
-
/**
|
422 |
-
* in
|
423 |
-
* 値が、配列で指定された中に含まれている
|
424 |
-
* @param string $name name属性
|
425 |
-
* @param array $options
|
426 |
-
* @return string エラーメッセージ
|
427 |
-
*/
|
428 |
-
public function in( $key, $options = array() ) {
|
429 |
-
$value = $this->getValue( $key );
|
430 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
431 |
-
if ( is_array( $value ) ) {
|
432 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
433 |
-
}
|
434 |
-
$defaults = array(
|
435 |
-
'options' => array(),
|
436 |
-
'message' => __( 'This value is invalid.', MWF_Config::DOMAIN )
|
437 |
-
);
|
438 |
-
$options = array_merge( $defaults, $options );
|
439 |
-
if ( !( is_array( $options['options'] ) && in_array( $value, $options['options'] ) ) ) {
|
440 |
-
return $options['message'];
|
441 |
-
}
|
442 |
-
}
|
443 |
-
}
|
444 |
|
445 |
/**
|
446 |
-
*
|
447 |
-
* 日付が正しいかどうか
|
448 |
-
* @param string $name name属性
|
449 |
-
* @param array $options
|
450 |
-
* @return string エラーメッセージ
|
451 |
*/
|
452 |
-
public
|
453 |
-
$value = $this->getValue( $key );
|
454 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
455 |
-
if ( is_array( $value ) ) {
|
456 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
457 |
-
}
|
458 |
-
$defaults = array(
|
459 |
-
'message' => __( 'This is not the format of a date.', MWF_Config::DOMAIN )
|
460 |
-
);
|
461 |
-
$options = array_merge( $defaults, $options );
|
462 |
-
$timestamp = strtotime( $value );
|
463 |
-
$year = date( 'Y', $timestamp );
|
464 |
-
$month = date( 'm', $timestamp );
|
465 |
-
$day = date( 'd', $timestamp );
|
466 |
-
$checkdate = checkdate( $month, $day, $year );
|
467 |
-
if ( !$timestamp || !$checkdate || preg_match( '/^[a-zA-Z]$/', $value ) || preg_match( '/^\s+$/', $value ) ) {
|
468 |
-
return $options['message'];
|
469 |
-
}
|
470 |
-
}
|
471 |
-
}
|
472 |
|
473 |
/**
|
474 |
-
*
|
475 |
-
* ファイル名が指定した拡張子を含む。types は , 区切り
|
476 |
-
* @param string $key name属性値
|
477 |
-
* @param array $options
|
478 |
-
* @return string エラーメッセージ
|
479 |
*/
|
480 |
-
|
481 |
-
$value = $this->getValue( $key );
|
482 |
-
if ( !is_null( $value ) && !$this->isEmpty( $value ) ) {
|
483 |
-
if ( is_array( $value ) ) {
|
484 |
-
$value = implode( $this->getSeparatorValue( $key ), $value );
|
485 |
-
}
|
486 |
-
$defaults = array(
|
487 |
-
'types' => '',
|
488 |
-
'message' => __( 'This file is invalid.', MWF_Config::DOMAIN )
|
489 |
-
);
|
490 |
-
$options = array_merge( $defaults, $options );
|
491 |
-
$_types = explode( ',', $options['types'] );
|
492 |
-
foreach ( $_types as $type ) {
|
493 |
-
$types[] = preg_quote( trim( $type ) );
|
494 |
-
}
|
495 |
-
$types = implode( '|', $this->array_clean( $types ) );
|
496 |
-
$pattern = '/\.(' . $types . ')$/';
|
497 |
-
if ( !preg_match( $pattern, $value ) ) {
|
498 |
-
return $options['message'];
|
499 |
-
}
|
500 |
-
}
|
501 |
-
}
|
502 |
|
503 |
/**
|
504 |
-
*
|
505 |
-
*
|
506 |
-
* @param string $key name属性値
|
507 |
-
* @param array $options
|
508 |
-
* @return string エラーメッセージ
|
509 |
*/
|
510 |
-
public function
|
511 |
-
$
|
512 |
-
|
513 |
-
$file = $data[$key];
|
514 |
-
if ( !empty( $file['size'] ) ) {
|
515 |
-
$defaults = array(
|
516 |
-
'bytes' => '0',
|
517 |
-
'message' => __( 'This file size is too big.', MWF_Config::DOMAIN )
|
518 |
-
);
|
519 |
-
$options = array_merge( $defaults, $options );
|
520 |
-
if ( !( preg_match( '/^[\d]+$/', $options['bytes'] ) && $options['bytes'] > $file['size'] ) ) {
|
521 |
-
return $options['message'];
|
522 |
-
}
|
523 |
-
}
|
524 |
-
}
|
525 |
}
|
526 |
|
527 |
/**
|
528 |
-
*
|
529 |
-
*
|
530 |
-
* @param
|
531 |
-
*
|
532 |
-
* @return String エラーメッセージ
|
533 |
*/
|
534 |
-
public function
|
535 |
-
$
|
536 |
-
'message' => __( 'The contents which you input were judged with spam.', MWF_Config::DOMAIN )
|
537 |
-
);
|
538 |
-
$options = array_merge( $defaults, $options );
|
539 |
-
return $options['message'];
|
540 |
}
|
541 |
|
542 |
/**
|
543 |
* Error
|
544 |
* エラーオブジェクトを返す
|
545 |
-
* @return
|
546 |
*/
|
547 |
public function Error() {
|
548 |
return $this->Error;
|
@@ -551,7 +63,7 @@ class MW_Validation {
|
|
551 |
/**
|
552 |
* isValid
|
553 |
* バリデートが通っているかチェック
|
554 |
-
* @return
|
555 |
*/
|
556 |
protected function isValid() {
|
557 |
$errors = $this->Error->getErrors();
|
@@ -565,14 +77,14 @@ class MW_Validation {
|
|
565 |
/**
|
566 |
* setRule
|
567 |
* バリデートが通っているかチェック
|
568 |
-
* @param
|
569 |
-
*
|
570 |
-
*
|
571 |
-
* @return
|
572 |
*/
|
573 |
-
public function setRule( $key, $rule,
|
574 |
$rules = array(
|
575 |
-
'rule' => $rule,
|
576 |
'options' => $options
|
577 |
);
|
578 |
$this->validate[$key][] = $rules;
|
@@ -582,9 +94,10 @@ class MW_Validation {
|
|
582 |
/**
|
583 |
* check
|
584 |
* validate実行
|
585 |
-
* @return
|
586 |
*/
|
587 |
public function check() {
|
|
|
588 |
foreach ( $this->validate as $key => $rules ) {
|
589 |
foreach ( $rules as $ruleSet ) {
|
590 |
if ( isset( $ruleSet['rule'] ) ) {
|
@@ -593,8 +106,8 @@ class MW_Validation {
|
|
593 |
if ( isset( $ruleSet['options'] ) ) {
|
594 |
$options = $ruleSet['options'];
|
595 |
}
|
596 |
-
if (
|
597 |
-
$message = $this
|
598 |
if ( !empty( $message ) ) {
|
599 |
$this->Error->setError( $key, $rule, $message );
|
600 |
}
|
@@ -604,42 +117,4 @@ class MW_Validation {
|
|
604 |
}
|
605 |
return $this->isValid();
|
606 |
}
|
607 |
-
|
608 |
-
/**
|
609 |
-
* array_clean
|
610 |
-
* 配列内の値の重複を消す
|
611 |
-
* @param Array
|
612 |
-
* @return Array
|
613 |
-
*/
|
614 |
-
protected function array_clean( $array ) {
|
615 |
-
return array_merge( array_diff( $array, array( '' ) ) );
|
616 |
-
}
|
617 |
-
|
618 |
-
/**
|
619 |
-
* isEmpty
|
620 |
-
* 値が空(0は許可)
|
621 |
-
* @param Mixed
|
622 |
-
* @return Boolean
|
623 |
-
*/
|
624 |
-
protected function isEmpty( $value ) {
|
625 |
-
if ( $value === array() || $value === '' || $value === null ) {
|
626 |
-
return true;
|
627 |
-
} else {
|
628 |
-
return false;
|
629 |
-
}
|
630 |
-
}
|
631 |
-
|
632 |
-
/**
|
633 |
-
* getSeparatorValue
|
634 |
-
* 送られてきたseparatorを返す
|
635 |
-
* @param string $key name属性
|
636 |
-
* @return string セパレータ
|
637 |
-
*/
|
638 |
-
public function getSeparatorValue( $key ) {
|
639 |
-
$data = $this->Data->getValue( $key );
|
640 |
-
if ( isset( $data ) && is_array( $data ) && array_key_exists( 'separator', $data ) ) {
|
641 |
-
return $data['separator'];
|
642 |
-
}
|
643 |
-
}
|
644 |
}
|
645 |
-
?>
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW Validation
|
|
|
4 |
* Description: バリデーションクラス
|
5 |
+
* Version: 1.7.0
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : July 20, 2012
|
9 |
+
* Modified: July 23, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_Validation {
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
/**
|
16 |
+
* フォーム識別子
|
|
|
|
|
|
|
|
|
17 |
*/
|
18 |
+
private $key;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
|
20 |
/**
|
21 |
+
* MW_Error オブジェクト
|
|
|
|
|
|
|
|
|
22 |
*/
|
23 |
+
protected $Error;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
/**
|
26 |
+
* バリデートをかける項目とかけるバリデーションの種類の一覧
|
|
|
|
|
|
|
|
|
27 |
*/
|
28 |
+
public $validate = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
|
30 |
/**
|
31 |
+
* バリデーションルールの一覧
|
|
|
|
|
|
|
|
|
32 |
*/
|
33 |
+
private $validation_rules = array();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
/**
|
36 |
+
* __construct
|
37 |
+
* @param string $key 識別子
|
|
|
|
|
|
|
38 |
*/
|
39 |
+
public function __construct( $key ) {
|
40 |
+
$this->key = $key;
|
41 |
+
$this->Error = new MW_Error();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
}
|
43 |
|
44 |
/**
|
45 |
+
* add_validation_rule
|
46 |
+
* 各バリデーションルールクラスのインスタンスをセット
|
47 |
+
* @param string $rule_name
|
48 |
+
* @param MW_Validation_Rule $instance
|
|
|
49 |
*/
|
50 |
+
public function add_validation_rule( $rule_name, $instance ) {
|
51 |
+
$this->validation_rules[$rule_name] = $instance;
|
|
|
|
|
|
|
|
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* Error
|
56 |
* エラーオブジェクトを返す
|
57 |
+
* @return MW_Error エラーオブジェクト
|
58 |
*/
|
59 |
public function Error() {
|
60 |
return $this->Error;
|
63 |
/**
|
64 |
* isValid
|
65 |
* バリデートが通っているかチェック
|
66 |
+
* @return bool
|
67 |
*/
|
68 |
protected function isValid() {
|
69 |
$errors = $this->Error->getErrors();
|
77 |
/**
|
78 |
* setRule
|
79 |
* バリデートが通っているかチェック
|
80 |
+
* @param string キー
|
81 |
+
* @param string バリデーションルール名
|
82 |
+
* @param array オプション
|
83 |
+
* @return bool
|
84 |
*/
|
85 |
+
public function setRule( $key, $rule, array $options = array() ) {
|
86 |
$rules = array(
|
87 |
+
'rule' => strtolower( $rule ),
|
88 |
'options' => $options
|
89 |
);
|
90 |
$this->validate[$key][] = $rules;
|
94 |
/**
|
95 |
* check
|
96 |
* validate実行
|
97 |
+
* @return bool
|
98 |
*/
|
99 |
public function check() {
|
100 |
+
$Data = MW_WP_Form_Data::getInstance( $this->key );
|
101 |
foreach ( $this->validate as $key => $rules ) {
|
102 |
foreach ( $rules as $ruleSet ) {
|
103 |
if ( isset( $ruleSet['rule'] ) ) {
|
106 |
if ( isset( $ruleSet['options'] ) ) {
|
107 |
$options = $ruleSet['options'];
|
108 |
}
|
109 |
+
if ( is_callable( array( $this->validation_rules[$rule], 'rule' ) ) ) {
|
110 |
+
$message = $this->validation_rules[$rule]->rule( $key, $options );
|
111 |
if ( !empty( $message ) ) {
|
112 |
$this->Error->setError( $key, $rule, $message );
|
113 |
}
|
117 |
}
|
118 |
return $this->isValid();
|
119 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
120 |
}
|
|
system/mw_validation_rule.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule
|
4 |
+
* Description: バリデーションルールの抽象クラス
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 19, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
abstract class MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name;
|
19 |
+
|
20 |
+
/*
|
21 |
+
* MW_WP_Form_Data オブジェクト
|
22 |
+
*/
|
23 |
+
protected $Data;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* __construct
|
27 |
+
* @param string $key 識別子
|
28 |
+
*/
|
29 |
+
public function __construct( $key ) {
|
30 |
+
if ( !self::getName() )
|
31 |
+
exit( 'MW_Validation_Rule::$name must override.' );
|
32 |
+
$this->Data = MW_WP_Form_Data::getInstance( $key );
|
33 |
+
}
|
34 |
+
|
35 |
+
/**
|
36 |
+
* getName
|
37 |
+
* バリデーションルール名を返す
|
38 |
+
* @return string $this->name バリデーションルール名
|
39 |
+
*/
|
40 |
+
public static function getName() {
|
41 |
+
$class = get_called_class();
|
42 |
+
return $class::$name;
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* rule
|
47 |
+
* @param string $key name属性
|
48 |
+
* @param array $option
|
49 |
+
* @return string エラーメッセージ
|
50 |
+
*/
|
51 |
+
abstract public function rule( $key, array $options = array() );
|
52 |
+
|
53 |
+
/**
|
54 |
+
* admin
|
55 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
56 |
+
* @param array $value バリデーションルールセットの内容
|
57 |
+
*/
|
58 |
+
public static function admin( $key, $value ) {
|
59 |
+
exit( 'MW_Validation_Rule::admin must override.' );
|
60 |
+
}
|
61 |
+
}
|
system/mw_wp_form_admin_page.php
CHANGED
@@ -1,35 +1,31 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Admin Page
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 管理画面クラス
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : February 21, 2013
|
10 |
* Modified: June 14, 2014
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_WP_Form_Admin_Page {
|
29 |
|
|
|
|
|
|
|
30 |
private $styles = array();
|
|
|
|
|
|
|
|
|
31 |
private $postdata;
|
32 |
-
|
|
|
|
|
|
|
|
|
33 |
|
34 |
/**
|
35 |
* __construct
|
@@ -48,6 +44,7 @@ class MW_WP_Form_Admin_Page {
|
|
48 |
/**
|
49 |
* current_screen
|
50 |
* 寄付リンクを表示
|
|
|
51 |
*/
|
52 |
public function current_screen( $screen ) {
|
53 |
if ( $screen->id === 'edit-' . MWF_Config::NAME )
|
@@ -62,6 +59,8 @@ class MW_WP_Form_Admin_Page {
|
|
62 |
/**
|
63 |
* get_post_data
|
64 |
* フォームの設定データを返す
|
|
|
|
|
65 |
*/
|
66 |
protected function get_post_data( $key ) {
|
67 |
global $post;
|
@@ -79,6 +78,8 @@ class MW_WP_Form_Admin_Page {
|
|
79 |
/**
|
80 |
* default_content
|
81 |
* 本文の初期値を設定
|
|
|
|
|
82 |
*/
|
83 |
public function default_content( $content ) {
|
84 |
global $typenow;
|
@@ -137,7 +138,7 @@ class MW_WP_Form_Admin_Page {
|
|
137 |
add_meta_box(
|
138 |
MWF_Config::NAME . '_validation',
|
139 |
__( 'Validation Rule', MWF_Config::DOMAIN ),
|
140 |
-
array( $this, '
|
141 |
MWF_Config::NAME, 'normal'
|
142 |
);
|
143 |
// フォーム識別子
|
@@ -228,7 +229,7 @@ class MW_WP_Form_Admin_Page {
|
|
228 |
|
229 |
/**
|
230 |
* save_post
|
231 |
-
* @param
|
232 |
*/
|
233 |
public function save_post( $post_ID ) {
|
234 |
if ( !( isset( $_POST['post_type'] ) && $_POST['post_type'] === MWF_Config::NAME ) )
|
@@ -480,32 +481,28 @@ class MW_WP_Form_Admin_Page {
|
|
480 |
|
481 |
/**
|
482 |
* add_validation_rule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
483 |
* バリデーションルール設定フォームを表示
|
484 |
*/
|
485 |
-
public function
|
486 |
global $post;
|
487 |
if ( ! $postdata = $this->get_post_data( 'validation' ) )
|
488 |
$postdata = array();
|
489 |
$validation_keys = array(
|
490 |
-
'target'
|
491 |
-
'noempty' => '',
|
492 |
-
'required' => '',
|
493 |
-
'numeric' => '',
|
494 |
-
'alpha' => '',
|
495 |
-
'alphanumeric' => '',
|
496 |
-
'katakana' => '',
|
497 |
-
'hiragana' => '',
|
498 |
-
'zip' => '',
|
499 |
-
'tel' => '',
|
500 |
-
'mail' => '',
|
501 |
-
'url' => '',
|
502 |
-
'date' => '',
|
503 |
-
'eq' => array(),
|
504 |
-
'between' => array(),
|
505 |
-
'minlength' => array(),
|
506 |
-
'fileType' => array(),
|
507 |
-
'fileSize' => array(),
|
508 |
);
|
|
|
|
|
|
|
|
|
509 |
// 空の隠れバリデーションフィールド(コピー元)を挿入
|
510 |
array_unshift( $postdata, $validation_keys );
|
511 |
?>
|
@@ -519,44 +516,11 @@ class MW_WP_Form_Admin_Page {
|
|
519 |
<table border="0" cellpadding="0" cellspacing="0">
|
520 |
<tr>
|
521 |
<td colspan="2">
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
<label><input type="checkbox" <?php checked( $value['alpha'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][alpha]" value="1" /><?php esc_html_e( 'Alphabet', MWF_Config::DOMAIN ); ?></label>
|
526 |
-
<label><input type="checkbox" <?php checked( $value['alphanumeric'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][alphanumeric]" value="1" /><?php esc_html_e( 'Alphabet and Numeric', MWF_Config::DOMAIN ); ?></label>
|
527 |
-
<label><input type="checkbox" <?php checked( $value['katakana'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][katakana]" value="1" /><?php esc_html_e( 'Japanese Katakana', MWF_Config::DOMAIN ); ?></label>
|
528 |
-
<label><input type="checkbox" <?php checked( $value['hiragana'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][hiragana]" value="1" /><?php esc_html_e( 'Japanese Hiragana', MWF_Config::DOMAIN ); ?></label>
|
529 |
-
<label><input type="checkbox" <?php checked( $value['zip'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][zip]" value="1" /><?php esc_html_e( 'Zip Code', MWF_Config::DOMAIN ); ?></label>
|
530 |
-
<label><input type="checkbox" <?php checked( $value['tel'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][tel]" value="1" /><?php esc_html_e( 'Tel', MWF_Config::DOMAIN ); ?></label>
|
531 |
-
<label><input type="checkbox" <?php checked( $value['mail'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][mail]" value="1" /><?php esc_html_e( 'E-mail', MWF_Config::DOMAIN ); ?></label>
|
532 |
-
<label><input type="checkbox" <?php checked( $value['url'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][url]" value="1" /><?php esc_html_e( 'URL', MWF_Config::DOMAIN ); ?></label>
|
533 |
-
<label><input type="checkbox" <?php checked( $value['date'], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][date]" value="1" /><?php esc_html_e( 'Date', MWF_Config::DOMAIN ); ?></label>
|
534 |
-
</td>
|
535 |
-
</tr>
|
536 |
-
<tr>
|
537 |
-
<td style="width:20%"><?php esc_html_e( 'The key at same value', MWF_Config::DOMAIN ); ?></td>
|
538 |
-
<td><input type="text" value="<?php echo esc_attr( @$value['eq']['target'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][eq][target]" /></td>
|
539 |
-
</tr>
|
540 |
-
<tr>
|
541 |
-
<td><?php esc_html_e( 'The range of the number of characters', MWF_Config::DOMAIN ); ?></td>
|
542 |
-
<td>
|
543 |
-
<input type="text" value="<?php echo esc_attr( @$value['between']['min'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][between][min]" />
|
544 |
-
〜
|
545 |
-
<input type="text" value="<?php echo esc_attr( @$value['between']['max'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][between][max]" />
|
546 |
</td>
|
547 |
</tr>
|
548 |
-
<tr>
|
549 |
-
<td><?php esc_html_e( 'The number of the minimum characters', MWF_Config::DOMAIN ); ?></td>
|
550 |
-
<td><input type="text" value="<?php echo esc_attr( @$value['minlength']['min'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][minlength][min]" /></td>
|
551 |
-
</tr>
|
552 |
-
<tr>
|
553 |
-
<td><?php esc_html_e( 'Permitted Extension', MWF_Config::DOMAIN ); ?></td>
|
554 |
-
<td><input type="text" value="<?php echo esc_attr( @$value['fileType']['types'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][fileType][types]" /> <span class="mwf_note"><?php esc_html_e( 'Example:jpg or jpg,txt,…', MWF_Config::DOMAIN ); ?></span></td>
|
555 |
-
</tr>
|
556 |
-
<tr>
|
557 |
-
<td><?php esc_html_e( 'Permitted file size', MWF_Config::DOMAIN ); ?></td>
|
558 |
-
<td><input type="text" value="<?php echo esc_attr( @$value['fileSize']['bytes'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][fileSize][bytes]" /> <span class="mwf_note"><?php esc_html_e( 'bytes', MWF_Config::DOMAIN ); ?></span></td>
|
559 |
-
</tr>
|
560 |
</table>
|
561 |
<!-- end .validation-content --></div>
|
562 |
<!-- end .validatioin-box --></div>
|
@@ -585,6 +549,7 @@ class MW_WP_Form_Admin_Page {
|
|
585 |
/**
|
586 |
* disable_visual_editor
|
587 |
* ビジュアルエディタを無効に
|
|
|
588 |
*/
|
589 |
public function disable_visual_editor() {
|
590 |
if ( MWF_Config::NAME == get_post_type() ) {
|
@@ -612,4 +577,3 @@ class MW_WP_Form_Admin_Page {
|
|
612 |
<?php
|
613 |
}
|
614 |
}
|
615 |
-
?>
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Admin Page
|
|
|
4 |
* Description: 管理画面クラス
|
5 |
+
* Version: 1.10.0
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : February 21, 2013
|
9 |
* Modified: June 14, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_WP_Form_Admin_Page {
|
14 |
|
15 |
+
/**
|
16 |
+
* 登録済みのフォームスタイルの一覧
|
17 |
+
*/
|
18 |
private $styles = array();
|
19 |
+
|
20 |
+
/**
|
21 |
+
* フォームの設定データ
|
22 |
+
*/
|
23 |
private $postdata;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* バリデーションルールの一覧
|
27 |
+
*/
|
28 |
+
private $validation_rules = array();
|
29 |
|
30 |
/**
|
31 |
* __construct
|
44 |
/**
|
45 |
* current_screen
|
46 |
* 寄付リンクを表示
|
47 |
+
* @param WP_Screen $screen
|
48 |
*/
|
49 |
public function current_screen( $screen ) {
|
50 |
if ( $screen->id === 'edit-' . MWF_Config::NAME )
|
59 |
/**
|
60 |
* get_post_data
|
61 |
* フォームの設定データを返す
|
62 |
+
* @param string $key 設定データのキー
|
63 |
+
* @return mixed 設定データ
|
64 |
*/
|
65 |
protected function get_post_data( $key ) {
|
66 |
global $post;
|
78 |
/**
|
79 |
* default_content
|
80 |
* 本文の初期値を設定
|
81 |
+
* @param string $content
|
82 |
+
* @return string
|
83 |
*/
|
84 |
public function default_content( $content ) {
|
85 |
global $typenow;
|
138 |
add_meta_box(
|
139 |
MWF_Config::NAME . '_validation',
|
140 |
__( 'Validation Rule', MWF_Config::DOMAIN ),
|
141 |
+
array( $this, 'display_validation_rule' ),
|
142 |
MWF_Config::NAME, 'normal'
|
143 |
);
|
144 |
// フォーム識別子
|
229 |
|
230 |
/**
|
231 |
* save_post
|
232 |
+
* @param int $post_ID
|
233 |
*/
|
234 |
public function save_post( $post_ID ) {
|
235 |
if ( !( isset( $_POST['post_type'] ) && $_POST['post_type'] === MWF_Config::NAME ) )
|
481 |
|
482 |
/**
|
483 |
* add_validation_rule
|
484 |
+
* 各バリデーションルールクラスのクラス名をセット
|
485 |
+
* @param string $rule_name バリデーションルールのクラス名
|
486 |
+
*/
|
487 |
+
public function add_validation_rule( $rule_name ) {
|
488 |
+
$this->validation_rules[] = $rule_name;
|
489 |
+
}
|
490 |
+
|
491 |
+
/**
|
492 |
+
* display_validation_rule
|
493 |
* バリデーションルール設定フォームを表示
|
494 |
*/
|
495 |
+
public function display_validation_rule() {
|
496 |
global $post;
|
497 |
if ( ! $postdata = $this->get_post_data( 'validation' ) )
|
498 |
$postdata = array();
|
499 |
$validation_keys = array(
|
500 |
+
'target' => '',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
501 |
);
|
502 |
+
foreach ( $this->validation_rules as $validation_rule ) {
|
503 |
+
$validation_keys[$validation_rule::getName()] = '';
|
504 |
+
}
|
505 |
+
|
506 |
// 空の隠れバリデーションフィールド(コピー元)を挿入
|
507 |
array_unshift( $postdata, $validation_keys );
|
508 |
?>
|
516 |
<table border="0" cellpadding="0" cellspacing="0">
|
517 |
<tr>
|
518 |
<td colspan="2">
|
519 |
+
<?php foreach ( $this->validation_rules as $validation_rule ) : ?>
|
520 |
+
<?php $validation_rule::admin( $key, $value ); ?>
|
521 |
+
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
522 |
</td>
|
523 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
524 |
</table>
|
525 |
<!-- end .validation-content --></div>
|
526 |
<!-- end .validatioin-box --></div>
|
549 |
/**
|
550 |
* disable_visual_editor
|
551 |
* ビジュアルエディタを無効に
|
552 |
+
* @return bool;
|
553 |
*/
|
554 |
public function disable_visual_editor() {
|
555 |
if ( MWF_Config::NAME == get_post_type() ) {
|
577 |
<?php
|
578 |
}
|
579 |
}
|
|
system/mw_wp_form_contact_data_page.php
CHANGED
@@ -1,35 +1,36 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Contact Data Page
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: DB保存データを扱うクラス
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : October 10, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_WP_Form_Contact_Data_Page {
|
29 |
|
|
|
|
|
|
|
30 |
private $POST_DATA_NAME;
|
|
|
|
|
|
|
|
|
31 |
private $postdata;
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
/**
|
35 |
* __construct
|
@@ -38,18 +39,27 @@ class MW_WP_Form_Contact_Data_Page {
|
|
38 |
$this->POST_DATA_NAME = '_' . MWF_Config::NAME . '_data';
|
39 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
40 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_style' ) );
|
41 |
-
add_action( 'admin_head', array( $this, '
|
42 |
add_action( 'admin_head', array( $this, 'add_forms_columns' ) );
|
43 |
add_action( 'admin_head', array( $this, 'add_meta_box' ) );
|
44 |
add_action( 'save_post', array( $this, 'save_post' ) );
|
45 |
add_action( 'in_admin_footer', array( $this, 'add_csv_download_button' ) );
|
46 |
add_action( 'wp_loaded', array( $this, 'csv_download' ) );
|
47 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
49 |
|
50 |
/**
|
51 |
* get_post_data
|
52 |
* フォームの設定データを返す
|
|
|
|
|
53 |
*/
|
54 |
protected function get_post_data( $key ) {
|
55 |
if ( isset( $this->postdata[$key] ) ) {
|
@@ -107,15 +117,19 @@ class MW_WP_Form_Contact_Data_Page {
|
|
107 |
}
|
108 |
|
109 |
/**
|
110 |
-
*
|
111 |
* DB登録データの一覧、詳細画面で新規追加のリンクを消す
|
|
|
112 |
*/
|
113 |
-
public function
|
114 |
if ( in_array( get_post_type(), $this->form_post_type ) ) : ?>
|
115 |
<style type="text/css">
|
116 |
h2 a.add-new-h2 {
|
117 |
display: none;
|
118 |
}
|
|
|
|
|
|
|
119 |
</style>
|
120 |
<?php
|
121 |
endif;
|
@@ -146,68 +160,97 @@ class MW_WP_Form_Contact_Data_Page {
|
|
146 |
* CSVを生成、出力
|
147 |
*/
|
148 |
public function csv_download() {
|
149 |
-
if ( isset( $_GET['post_type'] ) )
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
163 |
foreach ( $posts_mwf as $post ) {
|
164 |
-
|
165 |
-
$
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
if ( preg_match( '/^_/', $key ) )
|
171 |
-
continue;
|
172 |
-
$columns[$key] = $key;
|
173 |
-
}
|
174 |
}
|
175 |
}
|
176 |
-
$rows[0] = array_merge( $rows[0], $columns );
|
177 |
}
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
179 |
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
|
|
|
|
|
|
193 |
}
|
194 |
}
|
195 |
-
$
|
196 |
}
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
-
$csv
|
204 |
-
|
205 |
-
$file_name = 'mw_wp_form_' . date( 'YmdHis' ) . '.csv';
|
206 |
-
header( 'Content-Type: application/octet-stream' );
|
207 |
-
header( 'Content-Disposition: attachment; filename=' . $file_name );
|
208 |
-
echo $csv;
|
209 |
-
exit;
|
210 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
211 |
}
|
212 |
}
|
213 |
private function escape_double_quote( $value ) {
|
@@ -250,6 +293,7 @@ class MW_WP_Form_Contact_Data_Page {
|
|
250 |
global $posts;
|
251 |
unset( $columns['date'] );
|
252 |
$columns['post_date'] = __( 'Registed Date', MWF_Config::DOMAIN );
|
|
|
253 |
foreach ( $posts as $post ) {
|
254 |
$post_custom_keys = get_post_custom_keys( $post->ID );
|
255 |
if ( ! empty( $post_custom_keys ) && is_array( $post_custom_keys ) ) {
|
@@ -270,6 +314,9 @@ class MW_WP_Form_Contact_Data_Page {
|
|
270 |
$post = get_post( $post_id );
|
271 |
echo esc_html( $post->post_date );
|
272 |
}
|
|
|
|
|
|
|
273 |
elseif ( !empty( $post_custom_keys ) && is_array( $post_custom_keys ) && in_array( $column, $post_custom_keys ) ) {
|
274 |
$post_meta = get_post_meta( $post_id, $column, true );
|
275 |
if ( $this->is_upload_file_key( $post, $column ) ) {
|
@@ -342,6 +389,18 @@ class MW_WP_Form_Contact_Data_Page {
|
|
342 |
</td>
|
343 |
</tr>
|
344 |
<?php endforeach; ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
<tr>
|
346 |
<th><?php esc_html_e( 'Memo', MWF_Config::DOMAIN ); ?></th>
|
347 |
<td><textarea name="<?php echo $this->POST_DATA_NAME; ?>[memo]" cols="50" rows="5"><?php echo $this->get_post_data( 'memo' ); ?></textarea></td>
|
@@ -353,7 +412,7 @@ class MW_WP_Form_Contact_Data_Page {
|
|
353 |
|
354 |
/**
|
355 |
* save_post
|
356 |
-
* @param
|
357 |
*/
|
358 |
public function save_post( $post_ID ) {
|
359 |
if ( !( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->form_post_type ) ) )
|
@@ -364,13 +423,19 @@ class MW_WP_Form_Contact_Data_Page {
|
|
364 |
return $post_ID;
|
365 |
|
366 |
// 保存可能なキー
|
367 |
-
$permit_keys = array( 'memo' );
|
368 |
$data = array();
|
369 |
foreach ( $permit_keys as $key ) {
|
370 |
-
if ( isset( $_POST[$this->POST_DATA_NAME][$key] ) )
|
371 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
372 |
}
|
373 |
-
update_post_meta( $post_ID, $this->POST_DATA_NAME, $data
|
374 |
}
|
375 |
|
376 |
/**
|
@@ -425,6 +490,23 @@ class MW_WP_Form_Contact_Data_Page {
|
|
425 |
<?php
|
426 |
}
|
427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
428 |
/**
|
429 |
* get_count
|
430 |
* @param string $post_type 投稿タイプ名
|
@@ -509,4 +591,27 @@ class MW_WP_Form_Contact_Data_Page {
|
|
509 |
}
|
510 |
return false;
|
511 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
512 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Contact Data Page
|
|
|
4 |
* Description: DB保存データを扱うクラス
|
5 |
+
* Version: 1.2.0
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : October 10, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_WP_Form_Contact_Data_Page {
|
14 |
|
15 |
+
/**
|
16 |
+
* DB保存データ独自の項目(メモとか)の配列のキー
|
17 |
+
*/
|
18 |
private $POST_DATA_NAME;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* DB保存データ独自の項目(メモとか)
|
22 |
+
*/
|
23 |
private $postdata;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* 対応状況種別の一覧
|
27 |
+
*/
|
28 |
+
private $response_statuses = array();
|
29 |
+
|
30 |
+
/**
|
31 |
+
* DB登録使用時のカスタム投稿タイプ名
|
32 |
+
*/
|
33 |
+
private $form_post_type = array();
|
34 |
|
35 |
/**
|
36 |
* __construct
|
39 |
$this->POST_DATA_NAME = '_' . MWF_Config::NAME . '_data';
|
40 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
41 |
add_action( 'admin_enqueue_scripts', array( $this, 'admin_style' ) );
|
42 |
+
add_action( 'admin_head', array( $this, 'add_style' ) );
|
43 |
add_action( 'admin_head', array( $this, 'add_forms_columns' ) );
|
44 |
add_action( 'admin_head', array( $this, 'add_meta_box' ) );
|
45 |
add_action( 'save_post', array( $this, 'save_post' ) );
|
46 |
add_action( 'in_admin_footer', array( $this, 'add_csv_download_button' ) );
|
47 |
add_action( 'wp_loaded', array( $this, 'csv_download' ) );
|
48 |
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
49 |
+
add_action( 'edit_form_top', array( $this, 'display_returning_link' ) );
|
50 |
+
|
51 |
+
$this->response_statuses = array(
|
52 |
+
'not-supported' => esc_html__( 'Not supported', MWF_Config::DOMAIN ),
|
53 |
+
'reservation' => esc_html__( 'Reservation', MWF_Config::DOMAIN ),
|
54 |
+
'supported' => esc_html__( 'Supported', MWF_Config::DOMAIN ),
|
55 |
+
);
|
56 |
}
|
57 |
|
58 |
/**
|
59 |
* get_post_data
|
60 |
* フォームの設定データを返す
|
61 |
+
* @param string $key 項目名
|
62 |
+
* @return string
|
63 |
*/
|
64 |
protected function get_post_data( $key ) {
|
65 |
if ( isset( $this->postdata[$key] ) ) {
|
117 |
}
|
118 |
|
119 |
/**
|
120 |
+
* add_style
|
121 |
* DB登録データの一覧、詳細画面で新規追加のリンクを消す
|
122 |
+
* 詳細画面でタイトル下の空白を消す
|
123 |
*/
|
124 |
+
public function add_style() {
|
125 |
if ( in_array( get_post_type(), $this->form_post_type ) ) : ?>
|
126 |
<style type="text/css">
|
127 |
h2 a.add-new-h2 {
|
128 |
display: none;
|
129 |
}
|
130 |
+
#normal-sortables {
|
131 |
+
display: none;
|
132 |
+
}
|
133 |
</style>
|
134 |
<?php
|
135 |
endif;
|
160 |
* CSVを生成、出力
|
161 |
*/
|
162 |
public function csv_download() {
|
163 |
+
if ( !isset( $_GET['post_type'] ) )
|
164 |
+
return ;
|
165 |
+
|
166 |
+
$post_type = $_GET['post_type'];
|
167 |
+
|
168 |
+
if ( in_array( $post_type, $this->form_post_type ) && !empty( $_POST ) ) {
|
169 |
+
check_admin_referer( MWF_Config::NAME );
|
170 |
+
|
171 |
+
$posts_mwf = get_posts( array(
|
172 |
+
'post_type' => $post_type,
|
173 |
+
'posts_per_page' => -1,
|
174 |
+
'post_status' => 'any',
|
175 |
+
) );
|
176 |
+
$csv = '';
|
177 |
+
|
178 |
+
// 見出しを追加
|
179 |
+
$default_headings = array(
|
180 |
+
'ID',
|
181 |
+
__( 'Response Status', MWF_Config::DOMAIN ),
|
182 |
+
'post_date',
|
183 |
+
'post_modified',
|
184 |
+
'post_title'
|
185 |
+
);
|
186 |
+
$rows[] = $default_headings;
|
187 |
+
foreach ( $posts_mwf as $post ) {
|
188 |
+
setup_postdata( $post );
|
189 |
+
$columns = array();
|
190 |
foreach ( $posts_mwf as $post ) {
|
191 |
+
$post_custom_keys = get_post_custom_keys( $post->ID );
|
192 |
+
if ( ! empty( $post_custom_keys ) && is_array( $post_custom_keys ) ) {
|
193 |
+
foreach ( $post_custom_keys as $key ) {
|
194 |
+
if ( preg_match( '/^_/', $key ) )
|
195 |
+
continue;
|
196 |
+
$columns[$key] = $key;
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
}
|
|
|
199 |
}
|
200 |
+
$rows[0] = array_merge( $rows[0], $columns );
|
201 |
+
}
|
202 |
+
wp_reset_postdata();
|
203 |
+
$rows[0] = array_merge( $rows[0], array(
|
204 |
+
__( 'Memo', MWF_Config::DOMAIN )
|
205 |
+
) );
|
206 |
|
207 |
+
// 各データを追加
|
208 |
+
foreach ( $posts_mwf as $post ) {
|
209 |
+
setup_postdata( $post );
|
210 |
+
$column = array();
|
211 |
+
foreach ( $rows[0] as $key => $value ) {
|
212 |
+
$_column = '';
|
213 |
+
if ( $value === __( 'Response Status', MWF_Config::DOMAIN ) ) {
|
214 |
+
$_column = $this->get_post_data_value( 'response_status', $post->ID );
|
215 |
+
} elseif ( $value === __( 'Memo', MWF_Config::DOMAIN ) ) {
|
216 |
+
$_column = $this->get_post_data_value( 'memo', $post->ID );
|
217 |
+
} elseif ( isset( $post->$value ) ) {
|
218 |
+
$post_meta = $post->$value;
|
219 |
+
if ( $this->is_upload_file_key( $post, $value ) ) {
|
220 |
+
$_column = wp_get_attachment_url( $post_meta );
|
221 |
+
} else {
|
222 |
+
$_column = ( $post_meta ) ? $post_meta : '';
|
223 |
}
|
224 |
}
|
225 |
+
$column[$key] = $this->escape_double_quote( $_column );
|
226 |
}
|
227 |
+
$rows[] = $column;
|
228 |
+
}
|
229 |
+
// 見出し行をエスケープ
|
230 |
+
foreach ( $rows[0] as $key => $value ) {
|
231 |
+
$rows[0][$key] = $this->escape_double_quote( $value );
|
232 |
+
}
|
233 |
+
wp_reset_postdata();
|
234 |
+
|
235 |
+
// エンコード
|
236 |
+
foreach ( $rows as $key => $row ) {
|
237 |
+
if ( $key === 0 ) {
|
238 |
+
foreach ( $row as $row_key => $column_name ) {
|
239 |
+
if ( in_array( $column_name, array( 'Response Status', 'Memo' ) ) ) {
|
240 |
+
$column_name = esc_html__( $column_name, MWF_Config::DOMAIN );
|
241 |
+
}
|
242 |
+
$row[$row_key] = $column_name;
|
243 |
+
}
|
244 |
}
|
245 |
+
$csv .= implode( ',', $row ) . "\r\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
}
|
247 |
+
$csv = mb_convert_encoding( $csv, 'sjis-win', get_option( 'blog_charset' ) );
|
248 |
+
|
249 |
+
$file_name = 'mw_wp_form_' . date( 'YmdHis' ) . '.csv';
|
250 |
+
header( 'Content-Type: application/octet-stream' );
|
251 |
+
header( 'Content-Disposition: attachment; filename=' . $file_name );
|
252 |
+
echo $csv;
|
253 |
+
exit;
|
254 |
}
|
255 |
}
|
256 |
private function escape_double_quote( $value ) {
|
293 |
global $posts;
|
294 |
unset( $columns['date'] );
|
295 |
$columns['post_date'] = __( 'Registed Date', MWF_Config::DOMAIN );
|
296 |
+
$columns['response_status'] = __( 'Response Status', MWF_Config::DOMAIN );
|
297 |
foreach ( $posts as $post ) {
|
298 |
$post_custom_keys = get_post_custom_keys( $post->ID );
|
299 |
if ( ! empty( $post_custom_keys ) && is_array( $post_custom_keys ) ) {
|
314 |
$post = get_post( $post_id );
|
315 |
echo esc_html( $post->post_date );
|
316 |
}
|
317 |
+
elseif ( $column == 'response_status' ) {
|
318 |
+
echo $this->get_post_data_value( 'response_status', $post_id );
|
319 |
+
}
|
320 |
elseif ( !empty( $post_custom_keys ) && is_array( $post_custom_keys ) && in_array( $column, $post_custom_keys ) ) {
|
321 |
$post_meta = get_post_meta( $post_id, $column, true );
|
322 |
if ( $this->is_upload_file_key( $post, $column ) ) {
|
389 |
</td>
|
390 |
</tr>
|
391 |
<?php endforeach; ?>
|
392 |
+
<tr>
|
393 |
+
<th><?php esc_html_e( 'Response Status', MWF_Config::DOMAIN ); ?></th>
|
394 |
+
<td>
|
395 |
+
<select name="<?php echo $this->POST_DATA_NAME; ?>[response_status]">
|
396 |
+
<?php foreach ( $this->response_statuses as $key => $value ) : ?>
|
397 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $key, $this->get_post_data( 'response_status' ) ); ?>>
|
398 |
+
<?php echo esc_html( $value ); ?>
|
399 |
+
</option>
|
400 |
+
<?php endforeach; ?>
|
401 |
+
</select>
|
402 |
+
</td>
|
403 |
+
</tr>
|
404 |
<tr>
|
405 |
<th><?php esc_html_e( 'Memo', MWF_Config::DOMAIN ); ?></th>
|
406 |
<td><textarea name="<?php echo $this->POST_DATA_NAME; ?>[memo]" cols="50" rows="5"><?php echo $this->get_post_data( 'memo' ); ?></textarea></td>
|
412 |
|
413 |
/**
|
414 |
* save_post
|
415 |
+
* @param int $post_ID
|
416 |
*/
|
417 |
public function save_post( $post_ID ) {
|
418 |
if ( !( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->form_post_type ) ) )
|
423 |
return $post_ID;
|
424 |
|
425 |
// 保存可能なキー
|
426 |
+
$permit_keys = array( 'memo', 'response_status' );
|
427 |
$data = array();
|
428 |
foreach ( $permit_keys as $key ) {
|
429 |
+
if ( isset( $_POST[$this->POST_DATA_NAME][$key] ) ) {
|
430 |
+
$value = $_POST[$this->POST_DATA_NAME][$key];
|
431 |
+
if ( $key === 'response_status' ) {
|
432 |
+
if ( !array_key_exists( $value, $this->response_statuses ) )
|
433 |
+
continue;
|
434 |
+
}
|
435 |
+
$data[$key] = $value;
|
436 |
+
}
|
437 |
}
|
438 |
+
update_post_meta( $post_ID, $this->POST_DATA_NAME, $data );
|
439 |
}
|
440 |
|
441 |
/**
|
490 |
<?php
|
491 |
}
|
492 |
|
493 |
+
/**
|
494 |
+
* display_returning_link
|
495 |
+
* 問い合わせデータ詳細画面で一覧に戻るリンクを表示
|
496 |
+
* @param object $post
|
497 |
+
*/
|
498 |
+
public function display_returning_link( $post ) {
|
499 |
+
$post_type = get_post_type();
|
500 |
+
if ( in_array( $post_type, $this->form_post_type ) ) {
|
501 |
+
$link = admin_url( '/edit.php?post_type=' . $post_type );
|
502 |
+
?>
|
503 |
+
<p>
|
504 |
+
<a href="<?php echo $link; ?>"><?php esc_html_e( '« Back to the list', MWF_Config::DOMAIN ); ?></a>
|
505 |
+
</p>
|
506 |
+
<?php
|
507 |
+
}
|
508 |
+
}
|
509 |
+
|
510 |
/**
|
511 |
* get_count
|
512 |
* @param string $post_type 投稿タイプ名
|
591 |
}
|
592 |
return false;
|
593 |
}
|
594 |
+
|
595 |
+
/**
|
596 |
+
* get_post_data_value
|
597 |
+
* DB保存データの編集画面で付け足した項目の値を取得(翻訳済み)
|
598 |
+
* @param string $key 項目名
|
599 |
+
* @param numeric $post_id
|
600 |
+
* @return string
|
601 |
+
*/
|
602 |
+
private function get_post_data_value( $key, $post_id ) {
|
603 |
+
$post_data = get_post_meta( $post_id, $this->POST_DATA_NAME, true );
|
604 |
+
|
605 |
+
if ( $key === 'response_status' ) {
|
606 |
+
if ( is_array( $post_data ) && isset( $post_data[$key] ) && array_key_exists( $post_data[$key], $this->response_statuses ) ) {
|
607 |
+
return esc_html__( $this->response_statuses[$post_data[$key]], MWF_Config::DOMAIN );
|
608 |
+
} else {
|
609 |
+
return esc_html__( $this->response_statuses['not-supported'], MWF_Config::DOMAIN );
|
610 |
+
}
|
611 |
+
}
|
612 |
+
|
613 |
+
if ( is_array( $post_data ) && isset( $post_data[$key] ) ) {
|
614 |
+
return $post_data[$key];
|
615 |
+
}
|
616 |
+
}
|
617 |
}
|
system/mw_wp_form_data.php
CHANGED
@@ -1,33 +1,30 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Data
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: mw_wp_form のデータ操作用
|
6 |
-
* Version: 1.0
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : October 10, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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
|
|
|
|
|
|
|
|
|
29 |
private static $Instance;
|
|
|
|
|
|
|
|
|
30 |
private $data = array();
|
|
|
|
|
|
|
|
|
31 |
private $Session;
|
32 |
|
33 |
/**
|
@@ -35,7 +32,8 @@ class mw_wp_form_data {
|
|
35 |
* @param string $key データのキー
|
36 |
*/
|
37 |
private function __construct( $key ) {
|
38 |
-
$this->Session = MW_Session
|
|
|
39 |
}
|
40 |
|
41 |
public static function getInstance( $key ) {
|
@@ -120,4 +118,69 @@ class mw_wp_form_data {
|
|
120 |
$this->data[$key][] = $value;
|
121 |
$this->Session->pushValue( $key, $value );
|
122 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form Data
|
|
|
4 |
* Description: mw_wp_form のデータ操作用
|
5 |
+
* Version: 1.2.0
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : October 10, 2013
|
9 |
+
* Modified: July 23, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
+
class MW_WP_Form_Data {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* MW_WP_Form_Data オブジェクト
|
17 |
+
*/
|
18 |
private static $Instance;
|
19 |
+
|
20 |
+
/**
|
21 |
+
* フォームから送信された内容を保存した配列
|
22 |
+
*/
|
23 |
private $data = array();
|
24 |
+
|
25 |
+
/**
|
26 |
+
* MW_Sesion オブジェクト
|
27 |
+
*/
|
28 |
private $Session;
|
29 |
|
30 |
/**
|
32 |
* @param string $key データのキー
|
33 |
*/
|
34 |
private function __construct( $key ) {
|
35 |
+
$this->Session = new MW_Session( $key );
|
36 |
+
$this->data = $this->Session->getValues();
|
37 |
}
|
38 |
|
39 |
public static function getInstance( $key ) {
|
118 |
$this->data[$key][] = $value;
|
119 |
$this->Session->pushValue( $key, $value );
|
120 |
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* get
|
124 |
+
* 整形済み(メール送信可能な)データを取得
|
125 |
+
* @param string $key データのキー
|
126 |
+
* @return string データ
|
127 |
+
*/
|
128 |
+
public function get( $key ) {
|
129 |
+
if ( isset( $this->data[$key] ) ) {
|
130 |
+
if ( is_array( $this->data[$key] ) ) {
|
131 |
+
if ( !array_key_exists( 'data', $this->data[$key] ) )
|
132 |
+
return;
|
133 |
+
if ( is_array( $this->data[$key]['data'] ) ) {
|
134 |
+
return $this->getSeparatedValue( $key );
|
135 |
+
} else {
|
136 |
+
return $this->data[$key]['data'];
|
137 |
+
}
|
138 |
+
} else {
|
139 |
+
return $this->data[$key];
|
140 |
+
}
|
141 |
+
}
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* getSeparatorValue
|
146 |
+
* 送られてきたseparatorを返す
|
147 |
+
* @param string $key name属性
|
148 |
+
* @return string
|
149 |
+
*/
|
150 |
+
public function getSeparatorValue( $key ) {
|
151 |
+
$value = $this->getValue( $key );
|
152 |
+
if ( is_array( $value ) && isset( $value['separator'] ) ) {
|
153 |
+
return $value['separator'];
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
/**
|
158 |
+
* getSeparatedValue
|
159 |
+
* 配列データを整形して返す ( 郵便番号等用 )
|
160 |
+
* @param string $key name属性
|
161 |
+
* @param array $children 選択肢
|
162 |
+
* @return string データ
|
163 |
+
*/
|
164 |
+
public function getSeparatedValue( $key, array $children = array() ) {
|
165 |
+
$separator = $this->getSeparatorValue( $key );
|
166 |
+
$value = $this->getValue( $key );
|
167 |
+
if ( is_array( $value ) && isset( $value['data'] ) && is_array( $value['data'] ) && !empty( $separator ) ) {
|
168 |
+
if ( $children ) {
|
169 |
+
$rightData = array();
|
170 |
+
foreach ( $value['data'] as $child ) {
|
171 |
+
if ( isset( $children[$child] ) && !in_array( $children[$child], $rightData ) ) {
|
172 |
+
$rightData[] = $children[$child];
|
173 |
+
}
|
174 |
+
}
|
175 |
+
return implode( $separator, $rightData );
|
176 |
+
} else {
|
177 |
+
// すべて空のからのときはimplodeしないように(---がいってしまうため)
|
178 |
+
foreach ( $value['data'] as $child ) {
|
179 |
+
if ( $child !== '' && $child !== null ) {
|
180 |
+
return implode( $separator, $value['data'] );
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
+
}
|
185 |
+
}
|
186 |
}
|
system/mw_wp_form_file.php
CHANGED
@@ -1,29 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form File
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: Tempディレクトリ、ファイルアップロードの処理を行うクラス
|
6 |
-
* Version: 1.0.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : October 10, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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_WP_Form_File {
|
29 |
|
@@ -36,6 +21,7 @@ class MW_WP_Form_File {
|
|
36 |
|
37 |
/**
|
38 |
* upload_mimes
|
|
|
39 |
*/
|
40 |
public function upload_mimes( $t ) {
|
41 |
$t['psd'] = 'image/vnd.adobe.photoshop';
|
@@ -112,7 +98,7 @@ class MW_WP_Form_File {
|
|
112 |
/**
|
113 |
* fileUpload
|
114 |
* ファイルアップロード処理。$this->data[$key] にファイルの URL を入れる
|
115 |
-
* @return
|
116 |
*/
|
117 |
public function fileUpload() {
|
118 |
$this->createTempDir();
|
@@ -142,9 +128,9 @@ class MW_WP_Form_File {
|
|
142 |
* saveAttachmentsInMedia
|
143 |
* 添付ファイルをメディアに保存、投稿データに添付ファイルのキー(配列)を保存
|
144 |
* $this->options_by_formkey が確定した後でのみ利用可能
|
145 |
-
* @param
|
146 |
-
* @param
|
147 |
-
* @param
|
148 |
*/
|
149 |
public function saveAttachmentsInMedia( $post_id, $attachments, $form_key_post_id ) {
|
150 |
require_once( ABSPATH . 'wp-admin' . '/includes/media.php' );
|
@@ -194,13 +180,13 @@ class MW_WP_Form_File {
|
|
194 |
$upload_dir = realpath( $wp_upload_dir['path'] );
|
195 |
$upload_url = $wp_upload_dir['url'];
|
196 |
}
|
197 |
-
$uploadfile['file'] = $upload_dir
|
198 |
-
$uploadfile['url'] = $upload_url
|
199 |
while ( file_exists( $uploadfile['file'] ) ) {
|
200 |
$count ++;
|
201 |
$filename = $basename . '-' . $count . '.' . $extension;
|
202 |
-
$uploadfile['file'] = $upload_dir
|
203 |
-
$uploadfile['url'] = $upload_url
|
204 |
}
|
205 |
return $uploadfile;
|
206 |
}
|
@@ -243,7 +229,7 @@ class MW_WP_Form_File {
|
|
243 |
$temp_dir = $this->getTempDir();
|
244 |
$temp_dir = $temp_dir['dir'];
|
245 |
if ( $sub_dir )
|
246 |
-
$temp_dir = $temp_dir
|
247 |
|
248 |
if ( !file_exists( $temp_dir ) )
|
249 |
return;
|
@@ -253,10 +239,10 @@ class MW_WP_Form_File {
|
|
253 |
|
254 |
while ( false !== ( $file = readdir( $handle ) ) ) {
|
255 |
if ( $file !== '.' && $file !== '..' ) {
|
256 |
-
if ( is_dir( $temp_dir
|
257 |
$this->removeTempDir( $file );
|
258 |
} else {
|
259 |
-
unlink( $temp_dir
|
260 |
}
|
261 |
}
|
262 |
}
|
@@ -277,10 +263,10 @@ class MW_WP_Form_File {
|
|
277 |
if ( $handle === false )
|
278 |
return;
|
279 |
while ( false !== ( $filename = readdir( $handle ) ) ) {
|
280 |
-
if ( $filename !== '.' && $filename !== '..' && !is_dir( $temp_dir
|
281 |
-
$stat = stat( $temp_dir
|
282 |
if ( $stat['mtime'] + 3600 < time() )
|
283 |
-
unlink( $temp_dir
|
284 |
}
|
285 |
}
|
286 |
closedir( $handle );
|
@@ -289,8 +275,8 @@ class MW_WP_Form_File {
|
|
289 |
/**
|
290 |
* moveTempFileToUploadDir
|
291 |
* Tempディレクトリからuploadディレクトリにファイルを移動。
|
292 |
-
* @param
|
293 |
-
* @return
|
294 |
*/
|
295 |
public function moveTempFileToUploadDir( $filepath ) {
|
296 |
$tempdir = dirname( $filepath );
|
@@ -302,8 +288,8 @@ class MW_WP_Form_File {
|
|
302 |
if ( $tempdir == $uploaddir ) {
|
303 |
return $filepath;
|
304 |
}
|
305 |
-
if ( rename( $filepath, $uploaddir
|
306 |
-
return $uploaddir
|
307 |
}
|
308 |
return $filepath;
|
309 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MW WP Form File
|
|
|
4 |
* Description: Tempディレクトリ、ファイルアップロードの処理を行うクラス
|
5 |
+
* Version: 1.0.6
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : October 10, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MW_WP_Form_File {
|
14 |
|
21 |
|
22 |
/**
|
23 |
* upload_mimes
|
24 |
+
* @param array $t MIMEタイプの配列
|
25 |
*/
|
26 |
public function upload_mimes( $t ) {
|
27 |
$t['psd'] = 'image/vnd.adobe.photoshop';
|
98 |
/**
|
99 |
* fileUpload
|
100 |
* ファイルアップロード処理。$this->data[$key] にファイルの URL を入れる
|
101 |
+
* @return array ( name属性値 => アップロードできたファイルのURL, … )
|
102 |
*/
|
103 |
public function fileUpload() {
|
104 |
$this->createTempDir();
|
128 |
* saveAttachmentsInMedia
|
129 |
* 添付ファイルをメディアに保存、投稿データに添付ファイルのキー(配列)を保存
|
130 |
* $this->options_by_formkey が確定した後でのみ利用可能
|
131 |
+
* @param int post_id
|
132 |
+
* @param array ( ファイルのname属性値 => ファイルパス, … )
|
133 |
+
* @param int 生成フォーム(usedb)の post_id
|
134 |
*/
|
135 |
public function saveAttachmentsInMedia( $post_id, $attachments, $form_key_post_id ) {
|
136 |
require_once( ABSPATH . 'wp-admin' . '/includes/media.php' );
|
180 |
$upload_dir = realpath( $wp_upload_dir['path'] );
|
181 |
$upload_url = $wp_upload_dir['url'];
|
182 |
}
|
183 |
+
$uploadfile['file'] = trailingslashit( $upload_dir ) . $filename;
|
184 |
+
$uploadfile['url'] = trailingslashit( $upload_url ) . $filename;
|
185 |
while ( file_exists( $uploadfile['file'] ) ) {
|
186 |
$count ++;
|
187 |
$filename = $basename . '-' . $count . '.' . $extension;
|
188 |
+
$uploadfile['file'] = trailingslashit( $upload_dir ) . $filename;
|
189 |
+
$uploadfile['url'] = trailingslashit( $upload_url ) . $filename;
|
190 |
}
|
191 |
return $uploadfile;
|
192 |
}
|
229 |
$temp_dir = $this->getTempDir();
|
230 |
$temp_dir = $temp_dir['dir'];
|
231 |
if ( $sub_dir )
|
232 |
+
$temp_dir = trailingslashit( $temp_dir ) . $sub_dir;
|
233 |
|
234 |
if ( !file_exists( $temp_dir ) )
|
235 |
return;
|
239 |
|
240 |
while ( false !== ( $file = readdir( $handle ) ) ) {
|
241 |
if ( $file !== '.' && $file !== '..' ) {
|
242 |
+
if ( is_dir( trailingslashit( $temp_dir ) . $file ) ) {
|
243 |
$this->removeTempDir( $file );
|
244 |
} else {
|
245 |
+
unlink( trailingslashit( $temp_dir ) . $file );
|
246 |
}
|
247 |
}
|
248 |
}
|
263 |
if ( $handle === false )
|
264 |
return;
|
265 |
while ( false !== ( $filename = readdir( $handle ) ) ) {
|
266 |
+
if ( $filename !== '.' && $filename !== '..' && !is_dir( trailingslashit( $temp_dir ) . $filename ) ) {
|
267 |
+
$stat = stat( trailingslashit( $temp_dir ) . $filename );
|
268 |
if ( $stat['mtime'] + 3600 < time() )
|
269 |
+
unlink( trailingslashit( $temp_dir ) . $filename );
|
270 |
}
|
271 |
}
|
272 |
closedir( $handle );
|
275 |
/**
|
276 |
* moveTempFileToUploadDir
|
277 |
* Tempディレクトリからuploadディレクトリにファイルを移動。
|
278 |
+
* @param string ファイルパス
|
279 |
+
* @return bool
|
280 |
*/
|
281 |
public function moveTempFileToUploadDir( $filepath ) {
|
282 |
$tempdir = dirname( $filepath );
|
288 |
if ( $tempdir == $uploaddir ) {
|
289 |
return $filepath;
|
290 |
}
|
291 |
+
if ( rename( $filepath, trailingslashit( $uploaddir ) . $new_filename ) ) {
|
292 |
+
return trailingslashit( $uploaddir ) . $new_filename;
|
293 |
}
|
294 |
return $filepath;
|
295 |
}
|
system/mwf_config.php
CHANGED
@@ -1,29 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MWF_Config
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 設定ファイル
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : May 29, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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 MWF_Config {
|
29 |
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MWF_Config
|
|
|
4 |
* Description: 設定ファイル
|
5 |
+
* Version: 1.2.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : May 29, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MWF_Config {
|
14 |
|
system/mwf_functions.php
CHANGED
@@ -1,29 +1,14 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MWF Functions
|
4 |
-
* URI: http://2inc.org
|
5 |
* Description: 関数
|
6 |
-
* Version: 1.2.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : May 29, 2013
|
10 |
-
* Modified:
|
11 |
-
* License:
|
12 |
-
*
|
13 |
-
* Copyright 2014 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 MWF_Functions {
|
29 |
|
@@ -40,6 +25,30 @@ class MWF_Functions {
|
|
40 |
return false;
|
41 |
}
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
/**
|
44 |
* fileurl_to_path
|
45 |
* ファイルURLをファイルパスに変換
|
1 |
<?php
|
2 |
/**
|
3 |
* Name: MWF Functions
|
|
|
4 |
* Description: 関数
|
5 |
+
* Version: 1.2.1
|
6 |
* Author: Takashi Kitajima
|
7 |
* Author URI: http://2inc.org
|
8 |
* Created : May 29, 2013
|
9 |
+
* Modified: July 24, 2014
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
*/
|
13 |
class MWF_Functions {
|
14 |
|
25 |
return false;
|
26 |
}
|
27 |
|
28 |
+
/**
|
29 |
+
* array_clean
|
30 |
+
* 配列の空要素を削除
|
31 |
+
* @param array $array
|
32 |
+
* @return array
|
33 |
+
*/
|
34 |
+
public static function array_clean( $array ) {
|
35 |
+
return array_merge( array_diff( $array, array( '' ) ) );
|
36 |
+
}
|
37 |
+
|
38 |
+
/**
|
39 |
+
* is_empty
|
40 |
+
* 値が空(0は許可)
|
41 |
+
* @param mixed
|
42 |
+
* @return bool
|
43 |
+
*/
|
44 |
+
public static function is_empty( $value ) {
|
45 |
+
if ( $value === array() || $value === '' || $value === null ) {
|
46 |
+
return true;
|
47 |
+
} else {
|
48 |
+
return false;
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
/**
|
53 |
* fileurl_to_path
|
54 |
* ファイルURLをファイルパスに変換
|
validation_rules/mw_validation_rule_akismet.php
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Akismet
|
4 |
+
* Description: Akismetのエラー。常にtrue。
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Akismet extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'akismet_check';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$defaults = array(
|
28 |
+
'message' => __( 'The contents which you input were judged with spam.', MWF_Config::DOMAIN )
|
29 |
+
);
|
30 |
+
$options = array_merge( $defaults, $options );
|
31 |
+
return $options['message'];
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* admin
|
36 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
37 |
+
* @param array $value バリデーションルールセットの内容
|
38 |
+
*/
|
39 |
+
public static function admin( $key, $value ) {
|
40 |
+
}
|
41 |
+
}
|
validation_rules/mw_validation_rule_alpha.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Alpha
|
4 |
+
* Description: 値がアルファベット
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Alpha extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'alpha';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[A-Za-z]+$/', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'Please enter with a half-width alphabetic character.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Alphabet', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_alphanumeric.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule AlphaNumeric
|
4 |
+
* Description: 値が英数値
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_AlphaNumeric extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'alphanumeric';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[0-9A-Za-z]+$/', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'Please enter with a half-width alphanumeric character.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Alphabet and Numeric', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_between.php
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Between
|
4 |
+
* Description: 値の文字数が範囲内
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Between extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'between';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'min' => 0,
|
31 |
+
'max' => 0,
|
32 |
+
'message' => __( 'The number of characters is invalid.', MWF_Config::DOMAIN )
|
33 |
+
);
|
34 |
+
$options = array_merge( $defaults, $options );
|
35 |
+
$length = mb_strlen( $value, get_bloginfo( 'charset' ) );
|
36 |
+
if ( MWF_Functions::is_numeric( $options['min'] ) ) {
|
37 |
+
if ( MWF_Functions::is_numeric( $options['max'] ) ) {
|
38 |
+
if ( !( $options['min'] <= $length && $length <= $options['max'] ) ) {
|
39 |
+
return $options['message'];
|
40 |
+
}
|
41 |
+
} else {
|
42 |
+
if ( $options['min'] > $length ) {
|
43 |
+
return $options['message'];
|
44 |
+
}
|
45 |
+
}
|
46 |
+
} elseif ( MWF_Functions::is_numeric( $options['max'] ) ) {
|
47 |
+
if ( $options['max'] < $length ) {
|
48 |
+
return $options['message'];
|
49 |
+
}
|
50 |
+
}
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* admin
|
56 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
57 |
+
* @param array $value バリデーションルールセットの内容
|
58 |
+
*/
|
59 |
+
public static function admin( $key, $value ) {
|
60 |
+
?>
|
61 |
+
<table>
|
62 |
+
<tr>
|
63 |
+
<td><?php esc_html_e( 'The range of the number of characters', MWF_Config::DOMAIN ); ?></td>
|
64 |
+
<td>
|
65 |
+
<input type="text" value="<?php echo esc_attr( @$value[self::getName()]['min'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][min]" />
|
66 |
+
〜
|
67 |
+
<input type="text" value="<?php echo esc_attr( @$value[self::getName()]['max'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][max]" />
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
</table>
|
71 |
+
<?php
|
72 |
+
}
|
73 |
+
}
|
validation_rules/mw_validation_rule_date.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Date
|
4 |
+
* Description: 日付が正しいかどうか
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Date extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'date';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'message' => __( 'This is not the format of a date.', MWF_Config::DOMAIN )
|
31 |
+
);
|
32 |
+
$options = array_merge( $defaults, $options );
|
33 |
+
$timestamp = strtotime( $value );
|
34 |
+
$year = date( 'Y', $timestamp );
|
35 |
+
$month = date( 'm', $timestamp );
|
36 |
+
$day = date( 'd', $timestamp );
|
37 |
+
$checkdate = checkdate( $month, $day, $year );
|
38 |
+
if ( !$timestamp || !$checkdate || preg_match( '/^[a-zA-Z]$/', $value ) || preg_match( '/^\s+$/', $value ) ) {
|
39 |
+
return $options['message'];
|
40 |
+
}
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
/**
|
45 |
+
* admin
|
46 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
47 |
+
* @param array $value バリデーションルールセットの内容
|
48 |
+
*/
|
49 |
+
public static function admin( $key, $value ) {
|
50 |
+
?>
|
51 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Date', MWF_Config::DOMAIN ); ?></label>
|
52 |
+
<?php
|
53 |
+
}
|
54 |
+
}
|
validation_rules/mw_validation_rule_eq.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Eq
|
4 |
+
* Description: 値が一致している
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Eq extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'eq';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'target' => null,
|
31 |
+
'message' => __( 'This is not in agreement.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
$target_value = $this->Data->get( $options['target'] );
|
35 |
+
if ( $value !== $target_value ) {
|
36 |
+
return $options['message'];
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* admin
|
43 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
44 |
+
* @param array $value バリデーションルールセットの内容
|
45 |
+
*/
|
46 |
+
public static function admin( $key, $value ) {
|
47 |
+
?>
|
48 |
+
<table>
|
49 |
+
<tr>
|
50 |
+
<td><?php esc_html_e( 'The key at same value', MWF_Config::DOMAIN ); ?></td>
|
51 |
+
<td><input type="text" value="<?php echo esc_attr( @$value[self::getName()]['target'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][target]" /></td>
|
52 |
+
</tr>
|
53 |
+
</table>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
}
|
validation_rules/mw_validation_rule_filesize.php
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule FileType
|
4 |
+
* Description: ファイル名が指定した拡張子を含む。types は , 区切り
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_FileSize extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'filesize';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$data = $this->Data->getValue( MWF_Config::UPLOAD_FILES );
|
28 |
+
if ( !is_null( $data ) && is_array( $data ) && array_key_exists( $key, $data ) ) {
|
29 |
+
$file = $data[$key];
|
30 |
+
if ( !empty( $file['size'] ) ) {
|
31 |
+
$defaults = array(
|
32 |
+
'bytes' => '0',
|
33 |
+
'message' => __( 'This file size is too big.', MWF_Config::DOMAIN )
|
34 |
+
);
|
35 |
+
$options = array_merge( $defaults, $options );
|
36 |
+
if ( !( preg_match( '/^[\d]+$/', $options['bytes'] ) && $options['bytes'] > $file['size'] ) ) {
|
37 |
+
return $options['message'];
|
38 |
+
}
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
/**
|
44 |
+
* admin
|
45 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
46 |
+
* @param array $value バリデーションルールセットの内容
|
47 |
+
*/
|
48 |
+
public static function admin( $key, $value ) {
|
49 |
+
?>
|
50 |
+
<table>
|
51 |
+
<tr>
|
52 |
+
<td><?php esc_html_e( 'Permitted file size', MWF_Config::DOMAIN ); ?></td>
|
53 |
+
<td><input type="text" value="<?php echo esc_attr( @$value[self::getName()]['bytes'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][bytes]" /> <span class="mwf_note"><?php esc_html_e( 'bytes', MWF_Config::DOMAIN ); ?></span></td>
|
54 |
+
</tr>
|
55 |
+
</table>
|
56 |
+
<?php
|
57 |
+
}
|
58 |
+
}
|
validation_rules/mw_validation_rule_filetype.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule FileType
|
4 |
+
* Description: ファイル名が指定した拡張子を含む。types は , 区切り
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_FileType extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'filetype';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'types' => '',
|
31 |
+
'message' => __( 'This file is invalid.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
$_types = explode( ',', $options['types'] );
|
35 |
+
foreach ( $_types as $type ) {
|
36 |
+
$types[] = preg_quote( trim( $type ) );
|
37 |
+
}
|
38 |
+
$types = implode( '|', MWF_Functions::array_clean( $types ) );
|
39 |
+
$pattern = '/\.(' . $types . ')$/';
|
40 |
+
if ( !preg_match( $pattern, $value ) ) {
|
41 |
+
return $options['message'];
|
42 |
+
}
|
43 |
+
}
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* admin
|
48 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
49 |
+
* @param array $value バリデーションルールセットの内容
|
50 |
+
*/
|
51 |
+
public static function admin( $key, $value ) {
|
52 |
+
?>
|
53 |
+
<table>
|
54 |
+
<tr>
|
55 |
+
<td><?php esc_html_e( 'Permitted Extension', MWF_Config::DOMAIN ); ?></td>
|
56 |
+
<td><input type="text" value="<?php echo esc_attr( @$value[self::getName()]['types'] ); ?>" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][types]" /> <span class="mwf_note"><?php esc_html_e( 'Example:jpg or jpg,txt,…', MWF_Config::DOMAIN ); ?></span></td>
|
57 |
+
</tr>
|
58 |
+
</table>
|
59 |
+
<?php
|
60 |
+
}
|
61 |
+
}
|
validation_rules/mw_validation_rule_hiragana.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Hiragana
|
4 |
+
* Description: 値がひらがな
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Hiragana extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'hiragana';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[ぁ-ゞ ]*?[ぁ-ゞ]+?[ぁ-ゞ ]*?$/u', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'Please enter with a Japanese Hiragana.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Japanese Hiragana', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_in.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule In
|
4 |
+
* Description: 値が、配列で指定された中に含まれている
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_In extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'in';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'options' => array(),
|
31 |
+
'message' => __( 'This value is invalid.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
if ( !( is_array( $options['options'] ) && in_array( $value, $options['options'] ) ) ) {
|
35 |
+
return $options['message'];
|
36 |
+
}
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* admin
|
42 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
43 |
+
* @param array $value バリデーションルールセットの内容
|
44 |
+
*/
|
45 |
+
public static function admin( $key, $value ) {
|
46 |
+
}
|
47 |
+
}
|
validation_rules/mw_validation_rule_katakana.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Katakana
|
4 |
+
* Description: 値がカタカナ
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Katakana extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'katakana';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[ァ-ヾ ]*?[ァ-ヾ]+?[ァ-ヾ ]*?$/u', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'Please enter with a Japanese Katakana.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Japanese Katakana', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_mail.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Mail
|
4 |
+
* Description: 値がメールアドレス
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Mail extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'mail';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[^@]+@([^@^\.]+\.)+[^@^\.]+$/', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'This is not the format of a mail address.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'E-mail', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_minlength.php
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule MinLength
|
4 |
+
* Description: 値の文字数が範囲内
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_MinLength extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'minlength';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'min' => 0,
|
31 |
+
'message' => __( 'The number of characters is a few.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
$length = mb_strlen( $value, get_bloginfo( 'charset' ) );
|
35 |
+
if ( MWF_Functions::is_numeric( $options['min'] ) && $options['min'] > $length ) {
|
36 |
+
return $options['message'];
|
37 |
+
}
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* admin
|
43 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
44 |
+
* @param array $value バリデーションルールセットの内容
|
45 |
+
*/
|
46 |
+
public static function admin( $key, $value ) {
|
47 |
+
?>
|
48 |
+
<table>
|
49 |
+
<tr>
|
50 |
+
<td><?php esc_html_e( 'The number of the minimum characters', MWF_Config::DOMAIN ); ?></td>
|
51 |
+
<td><input type="text" value="<?php echo esc_attr( @$value[self::getName()]['min'] ); ?>" size="3" name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>][min]" /></td>
|
52 |
+
</tr>
|
53 |
+
</table>
|
54 |
+
<?php
|
55 |
+
}
|
56 |
+
}
|
validation_rules/mw_validation_rule_noempty.php
ADDED
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule noEmpty
|
4 |
+
* Description: 値が空ではない(0は許可)
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_noEmpty extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'noempty';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && MWF_Functions::is_empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'message' => __( 'Please enter.', MWF_Config::DOMAIN )
|
31 |
+
);
|
32 |
+
$options = array_merge( $defaults, $options );
|
33 |
+
return $options['message'];
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* admin
|
39 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
40 |
+
* @param array $value バリデーションルールセットの内容
|
41 |
+
*/
|
42 |
+
public static function admin( $key, $value ) {
|
43 |
+
?>
|
44 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'No empty', MWF_Config::DOMAIN ); ?></label>
|
45 |
+
<?php
|
46 |
+
}
|
47 |
+
}
|
validation_rules/mw_validation_rule_nofalse.php
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule noFalse
|
4 |
+
* Description: 値が空ではない(0も不可)
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_noFalse extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'nofalse';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'message' => __( 'Please enter.', MWF_Config::DOMAIN )
|
31 |
+
);
|
32 |
+
$options = array_merge( $defaults, $options );
|
33 |
+
return $options['message'];
|
34 |
+
}
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* admin
|
39 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
40 |
+
* @param array $value バリデーションルールセットの内容
|
41 |
+
*/
|
42 |
+
public static function admin( $key, $value ) {
|
43 |
+
}
|
44 |
+
}
|
validation_rules/mw_validation_rule_numeric.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Numeric
|
4 |
+
* Description: 値が数値
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Numeric extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'numeric';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^[0-9]+$/', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'Please enter with a half-width number.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Numeric', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_required.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Required
|
4 |
+
* Description: 値が存在する
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Required extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'required';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
// 値が存在するとき、もしくは存在しないけど他のデータもない(=フォーム送信自体されていない)ときはエラーではない
|
29 |
+
if ( !is_null( $value ) || is_null( $value ) && !$this->Data->getValues() ) {
|
30 |
+
return;
|
31 |
+
}
|
32 |
+
$defaults = array(
|
33 |
+
'message' => __( 'This is required.', MWF_Config::DOMAIN )
|
34 |
+
);
|
35 |
+
$options = array_merge( $defaults, $options );
|
36 |
+
return $options['message'];
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'No empty( with checkbox )', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_tel.php
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Tel
|
4 |
+
* Description: 値が電話番号
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Tel extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'tel';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'message' => __( 'This is not the format of a tel number.', MWF_Config::DOMAIN )
|
31 |
+
);
|
32 |
+
$options = array_merge( $defaults, $options );
|
33 |
+
if ( ! (
|
34 |
+
preg_match( '/^\d{2}-\d{4}-\d{4}$/', $value ) ||
|
35 |
+
preg_match( '/^\d{3}-\d{3,4}-\d{4}$/', $value ) ||
|
36 |
+
preg_match( '/^\d{4}-\d{2}-\d{4}$/', $value ) ||
|
37 |
+
preg_match( '/^\d{4}-\d{3}-\d{3}$/', $value ) ||
|
38 |
+
preg_match( '/^\d{5}-\d{1}-\d{4}$/', $value )
|
39 |
+
) ) {
|
40 |
+
return $options['message'];
|
41 |
+
}
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
/**
|
46 |
+
* admin
|
47 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
48 |
+
* @param array $value バリデーションルールセットの内容
|
49 |
+
*/
|
50 |
+
public static function admin( $key, $value ) {
|
51 |
+
?>
|
52 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Tel', MWF_Config::DOMAIN ); ?></label>
|
53 |
+
<?php
|
54 |
+
}
|
55 |
+
}
|
validation_rules/mw_validation_rule_url.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Url
|
4 |
+
* Description: 値がURL
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Url extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'url';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !is_null( $value ) && !MWF_Functions::is_empty( $value ) ) {
|
29 |
+
if ( !preg_match( '/^https{0,1}:\/\/[^\/].?/', $value ) ) {
|
30 |
+
$defaults = array(
|
31 |
+
'message' => __( 'This is not the format of a url.', MWF_Config::DOMAIN )
|
32 |
+
);
|
33 |
+
$options = array_merge( $defaults, $options );
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'URL', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|
validation_rules/mw_validation_rule_zip.php
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Name: MW Validation Rule Zip
|
4 |
+
* Description: 値が郵便番号
|
5 |
+
* Version: 1.0.0
|
6 |
+
* Author: Takashi Kitajima
|
7 |
+
* Author URI: http://2inc.org
|
8 |
+
* Created : July 21, 2014
|
9 |
+
* Modified:
|
10 |
+
* License: GPLv2
|
11 |
+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
+
*/
|
13 |
+
class MW_Validation_Rule_Zip extends MW_Validation_Rule {
|
14 |
+
|
15 |
+
/**
|
16 |
+
* バリデーションルール名を指定
|
17 |
+
*/
|
18 |
+
protected static $name = 'zip';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* rule
|
22 |
+
* @param string $key name属性
|
23 |
+
* @param array $option
|
24 |
+
* @return string エラーメッセージ
|
25 |
+
*/
|
26 |
+
public function rule( $key, array $options = array() ) {
|
27 |
+
$value = $this->Data->get( $key );
|
28 |
+
if ( !empty( $value ) ) {
|
29 |
+
$defaults = array(
|
30 |
+
'message' => __( 'This is not the format of a zip code.', MWF_Config::DOMAIN )
|
31 |
+
);
|
32 |
+
$options = array_merge( $defaults, $options );
|
33 |
+
if ( !preg_match( '/^\d{3}-\d{4}$/', $value ) ) {
|
34 |
+
return $options['message'];
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* admin
|
41 |
+
* @param numeric $key バリデーションルールセットの識別番号
|
42 |
+
* @param array $value バリデーションルールセットの内容
|
43 |
+
*/
|
44 |
+
public static function admin( $key, $value ) {
|
45 |
+
?>
|
46 |
+
<label><input type="checkbox" <?php checked( $value[self::getName()], 1 ); ?> name="<?php echo MWF_Config::NAME; ?>[validation][<?php echo $key; ?>][<?php echo esc_attr( self::getName() ); ?>]" value="1" /><?php esc_html_e( 'Zip Code', MWF_Config::DOMAIN ); ?></label>
|
47 |
+
<?php
|
48 |
+
}
|
49 |
+
}
|