Version Description
- Bug fix: DB
- Cahged :
- Cahged : mw_form_field::inputPagemw_form_field::previewPage
Download this release
Release Info
Developer | inc2734 |
Plugin | MW WP Form |
Version | 0.9.11 |
Comparing to | |
See all releases |
Code changes from version 0.9.10 to 0.9.11
- form_fields/mw_form_field_akismet_error.php +4 -6
- form_fields/mw_form_field_back_button.php +5 -7
- form_fields/mw_form_field_button.php +6 -8
- form_fields/mw_form_field_checkbox.php +14 -17
- form_fields/mw_form_field_datepicker.php +17 -19
- form_fields/mw_form_field_error.php +5 -7
- form_fields/mw_form_field_file.php +13 -15
- form_fields/mw_form_field_hidden.php +7 -9
- form_fields/mw_form_field_image.php +13 -15
- form_fields/mw_form_field_password.php +12 -14
- form_fields/mw_form_field_preview_button.php +5 -7
- form_fields/mw_form_field_radio.php +12 -15
- form_fields/mw_form_field_select.php +12 -14
- form_fields/mw_form_field_submit.php +6 -8
- form_fields/mw_form_field_submit_button.php +8 -10
- form_fields/mw_form_field_tel.php +10 -12
- form_fields/mw_form_field_text.php +12 -14
- form_fields/mw_form_field_textarea.php +12 -14
- form_fields/mw_form_field_zip.php +10 -12
- mw-wp-form.php +8 -4
- readme.txt +6 -1
- system/mw_form_field.php +25 -11
- system/mw_wp_form_admin_page.php +10 -4
form_fields/mw_form_field_akismet_error.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Akismet Error
|
4 |
* URI: http://2inc.org
|
5 |
* Description: Akismetのエラーを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: June 21, 2013
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -44,20 +44,18 @@ class mw_form_field_akismet_error extends mw_form_field {
|
|
44 |
/**
|
45 |
* inputPage
|
46 |
* 入力ページでのフォーム項目を返す
|
47 |
-
* @param Array $atts
|
48 |
* @return String HTML
|
49 |
*/
|
50 |
-
protected function inputPage(
|
51 |
return '<div class="akismet_error">' . $this->getError( MWF_Config::AKISMET ) . '</div>';
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* previewPage
|
56 |
* 確認ページでのフォーム項目を返す
|
57 |
-
* @param Array $atts
|
58 |
* @return String HTML
|
59 |
*/
|
60 |
-
protected function previewPage(
|
61 |
}
|
62 |
|
63 |
/**
|
3 |
* Name: MW Form Field Akismet Error
|
4 |
* URI: http://2inc.org
|
5 |
* Description: Akismetのエラーを出力。
|
6 |
+
* Version: 1.1
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: June 21, 2013
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
44 |
/**
|
45 |
* inputPage
|
46 |
* 入力ページでのフォーム項目を返す
|
|
|
47 |
* @return String HTML
|
48 |
*/
|
49 |
+
protected function inputPage() {
|
50 |
return '<div class="akismet_error">' . $this->getError( MWF_Config::AKISMET ) . '</div>';
|
51 |
}
|
52 |
|
53 |
/**
|
54 |
* previewPage
|
55 |
* 確認ページでのフォーム項目を返す
|
|
|
56 |
* @return String HTML
|
57 |
*/
|
58 |
+
protected function previewPage() {
|
59 |
}
|
60 |
|
61 |
/**
|
form_fields/mw_form_field_back_button.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Back Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 戻るボタンを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -46,20 +46,18 @@ class mw_form_field_back_button extends mw_form_field {
|
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
49 |
-
* @param Array $atts
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
-
protected function inputPage(
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
* previewPage
|
57 |
* 確認ページでのフォーム項目を返す
|
58 |
-
* @param Array $atts
|
59 |
* @return String HTML
|
60 |
*/
|
61 |
-
protected function previewPage(
|
62 |
-
return $this->Form->submit( $this->Form->getBackButtonName(), $atts['value'] );
|
63 |
}
|
64 |
|
65 |
/**
|
3 |
* Name: MW Form Field Back Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 戻るボタンを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
|
|
49 |
* @return String HTML
|
50 |
*/
|
51 |
+
protected function inputPage() {
|
52 |
}
|
53 |
|
54 |
/**
|
55 |
* previewPage
|
56 |
* 確認ページでのフォーム項目を返す
|
|
|
57 |
* @return String HTML
|
58 |
*/
|
59 |
+
protected function previewPage() {
|
60 |
+
return $this->Form->submit( $this->Form->getBackButtonName(), $this->atts['value'] );
|
61 |
}
|
62 |
|
63 |
/**
|
form_fields/mw_form_field_button.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: ボタンを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -47,21 +47,19 @@ class mw_form_field_button extends mw_form_field {
|
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
50 |
-
* @param Array $atts
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
-
protected function inputPage(
|
54 |
-
return $this->Form->button( $atts['name'], $atts['value'] );
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
* previewPage
|
59 |
* 確認ページでのフォーム項目を返す
|
60 |
-
* @param Array $atts
|
61 |
* @return String HTML
|
62 |
*/
|
63 |
-
protected function previewPage(
|
64 |
-
return $this->inputPage(
|
65 |
}
|
66 |
|
67 |
/**
|
3 |
* Name: MW Form Field Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: ボタンを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
|
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
+
protected function inputPage() {
|
53 |
+
return $this->Form->button( $this->atts['name'], $this->atts['value'] );
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* previewPage
|
58 |
* 確認ページでのフォーム項目を返す
|
|
|
59 |
* @return String HTML
|
60 |
*/
|
61 |
+
protected function previewPage() {
|
62 |
+
return $this->inputPage();
|
63 |
}
|
64 |
|
65 |
/**
|
form_fields/mw_form_field_checkbox.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Checkbox
|
4 |
* URI: http://2inc.org
|
5 |
* Description: チェックボックスを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -50,32 +50,29 @@ class mw_form_field_checkbox extends mw_form_field {
|
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
53 |
-
* @param Array $atts
|
54 |
* @return String HTML
|
55 |
*/
|
56 |
-
protected function inputPage(
|
57 |
-
$children = $this->getChildren( $atts['children'] );
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
$_ret .= $this->getError( $atts['name'] );
|
64 |
return $_ret;
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* previewPage
|
69 |
* 確認ページでのフォーム項目を返す
|
70 |
-
* @param Array $atts
|
71 |
* @return String HTML
|
72 |
*/
|
73 |
-
protected function previewPage(
|
74 |
-
$children = $this->getChildren( $atts['children'] );
|
75 |
-
$value = $this->Form->getCheckedValue( $atts['name'], $children );
|
76 |
$_ret = $value;
|
77 |
-
$_ret .= $this->Form->hidden( $atts['name'] . '[data]', $value );
|
78 |
-
$_ret .= $this->Form->separator( $atts['name'] );
|
79 |
return $_ret;
|
80 |
}
|
81 |
|
3 |
* Name: MW Form Field Checkbox
|
4 |
* URI: http://2inc.org
|
5 |
* Description: チェックボックスを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
|
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
+
protected function inputPage() {
|
56 |
+
$children = $this->getChildren( $this->atts['children'] );
|
57 |
+
$_ret = $this->Form->checkbox( $this->atts['name'], $children, array(
|
58 |
+
'value' => $this->atts['value'],
|
59 |
+
), $this->atts['separator'] );
|
60 |
+
if ( $this->atts['show_error'] !== 'false' )
|
61 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
|
|
62 |
return $_ret;
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
* previewPage
|
67 |
* 確認ページでのフォーム項目を返す
|
|
|
68 |
* @return String HTML
|
69 |
*/
|
70 |
+
protected function previewPage() {
|
71 |
+
$children = $this->getChildren( $this->atts['children'] );
|
72 |
+
$value = $this->Form->getCheckedValue( $this->atts['name'], $children );
|
73 |
$_ret = $value;
|
74 |
+
$_ret .= $this->Form->hidden( $this->atts['name'] . '[data]', $value );
|
75 |
+
$_ret .= $this->Form->separator( $this->atts['name'] );
|
76 |
return $_ret;
|
77 |
}
|
78 |
|
form_fields/mw_form_field_datepicker.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Datepicker
|
4 |
* URI: http://2inc.org
|
5 |
* Description: datepickerを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -50,21 +50,20 @@ class mw_form_field_datepicker extends mw_form_field {
|
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
53 |
-
* @param Array $atts
|
54 |
* @return String HTML
|
55 |
*/
|
56 |
-
protected function inputPage(
|
57 |
wp_enqueue_style( 'jquery.ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/base/jquery-ui.css', array(), '1.9.2' );
|
58 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
59 |
// jsの指定がないときはデフォルトで年付き変更機能追加
|
60 |
-
if ( empty( $atts['js'] ) ) {
|
61 |
-
$atts['js'] = 'showMonthAfterYear: true, changeYear: true, changeMonth: true';
|
62 |
}
|
63 |
// 日本語の場合は日本語表記に変更
|
64 |
if ( get_locale() == 'ja' ) {
|
65 |
-
if ( !empty( $atts['js'] ) )
|
66 |
-
$atts['js'] = $atts['js'] . ',';
|
67 |
-
$atts['js'] .= '
|
68 |
yearSuffix: "年",
|
69 |
dateFormat: "yy-mm-dd",
|
70 |
dayNames: ["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],
|
@@ -75,26 +74,25 @@ class mw_form_field_datepicker extends mw_form_field {
|
|
75 |
';
|
76 |
}
|
77 |
$_ret = '';
|
78 |
-
$_ret .= $this->Form->datepicker( $atts['name'], array(
|
79 |
-
'size' => $atts['size'],
|
80 |
-
'js' => $atts['js'],
|
81 |
-
'value' => $atts['value'],
|
82 |
) );
|
83 |
-
if ( $atts['show_error'] !== 'false' )
|
84 |
-
$_ret .= $this->getError( $atts['name'] );
|
85 |
return $_ret;
|
86 |
}
|
87 |
|
88 |
/**
|
89 |
* previewPage
|
90 |
* 確認ページでのフォーム項目を返す
|
91 |
-
* @param Array $atts
|
92 |
* @return String HTML
|
93 |
*/
|
94 |
-
protected function previewPage(
|
95 |
-
$value = $this->Form->getValue( $atts['name'] );
|
96 |
$_ret = $value;
|
97 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
98 |
return $_ret;
|
99 |
}
|
100 |
|
3 |
* Name: MW Form Field Datepicker
|
4 |
* URI: http://2inc.org
|
5 |
* Description: datepickerを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
|
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
+
protected function inputPage() {
|
56 |
wp_enqueue_style( 'jquery.ui', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/base/jquery-ui.css', array(), '1.9.2' );
|
57 |
wp_enqueue_script( 'jquery-ui-datepicker' );
|
58 |
// jsの指定がないときはデフォルトで年付き変更機能追加
|
59 |
+
if ( empty( $this->atts['js'] ) ) {
|
60 |
+
$this->atts['js'] = 'showMonthAfterYear: true, changeYear: true, changeMonth: true';
|
61 |
}
|
62 |
// 日本語の場合は日本語表記に変更
|
63 |
if ( get_locale() == 'ja' ) {
|
64 |
+
if ( !empty( $this->atts['js'] ) )
|
65 |
+
$this->atts['js'] = $this->atts['js'] . ',';
|
66 |
+
$this->atts['js'] .= '
|
67 |
yearSuffix: "年",
|
68 |
dateFormat: "yy-mm-dd",
|
69 |
dayNames: ["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],
|
74 |
';
|
75 |
}
|
76 |
$_ret = '';
|
77 |
+
$_ret .= $this->Form->datepicker( $this->atts['name'], array(
|
78 |
+
'size' => $this->atts['size'],
|
79 |
+
'js' => $this->atts['js'],
|
80 |
+
'value' => $this->atts['value'],
|
81 |
) );
|
82 |
+
if ( $this->atts['show_error'] !== 'false' )
|
83 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
84 |
return $_ret;
|
85 |
}
|
86 |
|
87 |
/**
|
88 |
* previewPage
|
89 |
* 確認ページでのフォーム項目を返す
|
|
|
90 |
* @return String HTML
|
91 |
*/
|
92 |
+
protected function previewPage() {
|
93 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
94 |
$_ret = $value;
|
95 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
96 |
return $_ret;
|
97 |
}
|
98 |
|
form_fields/mw_form_field_error.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Error
|
4 |
* URI: http://2inc.org
|
5 |
* Description: エラーを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -46,11 +46,10 @@ class mw_form_field_error extends mw_form_field {
|
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
49 |
-
* @param Array $atts
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
-
protected function inputPage(
|
53 |
-
$keys = explode( ',', $atts['keys'] );
|
54 |
$_ret = '';
|
55 |
foreach ( $keys as $key ) {
|
56 |
$_ret .= $this->getError( trim( $key ) );
|
@@ -61,10 +60,9 @@ class mw_form_field_error extends mw_form_field {
|
|
61 |
/**
|
62 |
* previewPage
|
63 |
* 確認ページでのフォーム項目を返す
|
64 |
-
* @param Array $atts
|
65 |
* @return String HTML
|
66 |
*/
|
67 |
-
protected function previewPage(
|
68 |
}
|
69 |
|
70 |
/**
|
3 |
* Name: MW Form Field Error
|
4 |
* URI: http://2inc.org
|
5 |
* Description: エラーを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
|
|
49 |
* @return String HTML
|
50 |
*/
|
51 |
+
protected function inputPage() {
|
52 |
+
$keys = explode( ',', $this->atts['keys'] );
|
53 |
$_ret = '';
|
54 |
foreach ( $keys as $key ) {
|
55 |
$_ret .= $this->getError( trim( $key ) );
|
60 |
/**
|
61 |
* previewPage
|
62 |
* 確認ページでのフォーム項目を返す
|
|
|
63 |
* @return String HTML
|
64 |
*/
|
65 |
+
protected function previewPage() {
|
66 |
}
|
67 |
|
68 |
/**
|
form_fields/mw_form_field_file.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field File
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: May 17, 2013
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -48,39 +48,37 @@ class mw_form_field_file extends mw_form_field {
|
|
48 |
/**
|
49 |
* inputPage
|
50 |
* 入力ページでのフォーム項目を返す
|
51 |
-
* @param Array $atts
|
52 |
* @return String HTML
|
53 |
*/
|
54 |
-
protected function inputPage(
|
55 |
-
$_ret = $this->Form->file( $atts['name'], array(
|
56 |
-
'size' => $atts['size'],
|
57 |
) );
|
58 |
-
$value = $this->Form->getValue( $atts['name'] );
|
59 |
$upload_file_keys = $this->Form->getValue( MWF_Config::UPLOAD_FILE_KEYS );
|
60 |
-
if ( !empty( $value ) && is_array( $upload_file_keys ) && in_array( $atts['name'], $upload_file_keys ) ) {
|
61 |
$_ret .= '<div class="' . MWF_Config::NAME . '_file">';
|
62 |
$_ret .= '<a href="' . esc_attr( $value ) . '" target="_blank">' . __( 'Uploaded.', MWF_Config::DOMAIN ) . '</a>';
|
63 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
64 |
$_ret .= '</div>';
|
65 |
}
|
66 |
-
if ( $atts['show_error'] !== 'false' )
|
67 |
-
$_ret .= $this->getError( $atts['name'] );
|
68 |
return $_ret;
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
* previewPage
|
73 |
* 確認ページでのフォーム項目を返す
|
74 |
-
* @param Array $atts
|
75 |
* @return String HTML
|
76 |
*/
|
77 |
-
protected function previewPage(
|
78 |
-
$value = $this->Form->getValue( $atts['name'] );
|
79 |
if ( $value ) {
|
80 |
$_ret = '<div class="' . MWF_Config::NAME . '_file">';
|
81 |
$_ret .= '<a href="' . esc_attr( $value ) . '" target="_blank">' . __( 'Uploaded.', MWF_Config::DOMAIN ) . '</a>';
|
82 |
$_ret .= '</div>';
|
83 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
84 |
return $_ret;
|
85 |
}
|
86 |
}
|
3 |
* Name: MW Form Field File
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: May 17, 2013
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
48 |
/**
|
49 |
* inputPage
|
50 |
* 入力ページでのフォーム項目を返す
|
|
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
+
protected function inputPage() {
|
54 |
+
$_ret = $this->Form->file( $this->atts['name'], array(
|
55 |
+
'size' => $this->atts['size'],
|
56 |
) );
|
57 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
58 |
$upload_file_keys = $this->Form->getValue( MWF_Config::UPLOAD_FILE_KEYS );
|
59 |
+
if ( !empty( $value ) && is_array( $upload_file_keys ) && in_array( $this->atts['name'], $upload_file_keys ) ) {
|
60 |
$_ret .= '<div class="' . MWF_Config::NAME . '_file">';
|
61 |
$_ret .= '<a href="' . esc_attr( $value ) . '" target="_blank">' . __( 'Uploaded.', MWF_Config::DOMAIN ) . '</a>';
|
62 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
63 |
$_ret .= '</div>';
|
64 |
}
|
65 |
+
if ( $this->atts['show_error'] !== 'false' )
|
66 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
67 |
return $_ret;
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
* previewPage
|
72 |
* 確認ページでのフォーム項目を返す
|
|
|
73 |
* @return String HTML
|
74 |
*/
|
75 |
+
protected function previewPage() {
|
76 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
77 |
if ( $value ) {
|
78 |
$_ret = '<div class="' . MWF_Config::NAME . '_file">';
|
79 |
$_ret .= '<a href="' . esc_attr( $value ) . '" target="_blank">' . __( 'Uploaded.', MWF_Config::DOMAIN ) . '</a>';
|
80 |
$_ret .= '</div>';
|
81 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
82 |
return $_ret;
|
83 |
}
|
84 |
}
|
form_fields/mw_form_field_hidden.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Hidden
|
4 |
* URI: http://2inc.org
|
5 |
* Description: hiddenフィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -47,22 +47,20 @@ class mw_form_field_hidden extends mw_form_field {
|
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
50 |
-
* @param Array $atts
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
-
protected function inputPage(
|
54 |
-
return $this->Form->hidden( $atts['name'], $atts['value'] );
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
* previewPage
|
59 |
* 確認ページでのフォーム項目を返す
|
60 |
-
* @param Array $atts
|
61 |
* @return String HTML
|
62 |
*/
|
63 |
-
protected function previewPage(
|
64 |
-
$value = $this->Form->getValue( $atts['name'] );
|
65 |
-
return $this->Form->hidden( $atts['name'], $value );
|
66 |
}
|
67 |
|
68 |
/**
|
3 |
* Name: MW Form Field Hidden
|
4 |
* URI: http://2inc.org
|
5 |
* Description: hiddenフィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
|
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
+
protected function inputPage() {
|
53 |
+
return $this->Form->hidden( $this->atts['name'], $this->atts['value'] );
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* previewPage
|
58 |
* 確認ページでのフォーム項目を返す
|
|
|
59 |
* @return String HTML
|
60 |
*/
|
61 |
+
protected function previewPage() {
|
62 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
63 |
+
return $this->Form->hidden( $this->atts['name'], $value );
|
64 |
}
|
65 |
|
66 |
/**
|
form_fields/mw_form_field_image.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Image
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: May 17, 2013
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -48,38 +48,36 @@ class mw_form_field_image extends mw_form_field {
|
|
48 |
/**
|
49 |
* inputPage
|
50 |
* 入力ページでのフォーム項目を返す
|
51 |
-
* @param Array $atts
|
52 |
* @return String HTML
|
53 |
*/
|
54 |
-
protected function inputPage(
|
55 |
-
$_ret = $this->Form->file( $atts['name'], array(
|
56 |
-
'size' => $atts['size'],
|
57 |
) );
|
58 |
-
$value = $this->Form->getValue( $atts['name'] );
|
59 |
$upload_file_keys = $this->Form->getValue( MWF_Config::UPLOAD_FILE_KEYS );
|
60 |
-
if ( !empty( $value ) && is_array( $upload_file_keys ) && in_array( $atts['name'], $upload_file_keys ) ) {
|
61 |
$_ret .= '<div class="' . MWF_Config::NAME . '_image">';
|
62 |
$_ret .= '<img src="' . esc_attr( $value ) . '" alt="" />';
|
63 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
64 |
$_ret .= '</div>';
|
65 |
}
|
66 |
-
if ( $atts['show_error'] !== 'false' )
|
67 |
-
$_ret .= $this->getError( $atts['name'] );
|
68 |
return $_ret;
|
69 |
}
|
70 |
|
71 |
/**
|
72 |
* previewPage
|
73 |
* 確認ページでのフォーム項目を返す
|
74 |
-
* @param Array $atts
|
75 |
* @return String HTML
|
76 |
*/
|
77 |
-
protected function previewPage(
|
78 |
-
$value = $this->Form->getValue( $atts['name'] );
|
79 |
if ( $value ) {
|
80 |
$_ret = '<div class="' . MWF_Config::NAME . '_image">';
|
81 |
$_ret .= '<img src="' . esc_attr( $value ) . '" alt="" />';
|
82 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
83 |
$_ret .= '</div>';
|
84 |
return $_ret;
|
85 |
}
|
3 |
* Name: MW Form Field Image
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 画像アップロードフィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: May 17, 2013
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
48 |
/**
|
49 |
* inputPage
|
50 |
* 入力ページでのフォーム項目を返す
|
|
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
+
protected function inputPage() {
|
54 |
+
$_ret = $this->Form->file( $this->atts['name'], array(
|
55 |
+
'size' => $this->atts['size'],
|
56 |
) );
|
57 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
58 |
$upload_file_keys = $this->Form->getValue( MWF_Config::UPLOAD_FILE_KEYS );
|
59 |
+
if ( !empty( $value ) && is_array( $upload_file_keys ) && in_array( $this->atts['name'], $upload_file_keys ) ) {
|
60 |
$_ret .= '<div class="' . MWF_Config::NAME . '_image">';
|
61 |
$_ret .= '<img src="' . esc_attr( $value ) . '" alt="" />';
|
62 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
63 |
$_ret .= '</div>';
|
64 |
}
|
65 |
+
if ( $this->atts['show_error'] !== 'false' )
|
66 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
67 |
return $_ret;
|
68 |
}
|
69 |
|
70 |
/**
|
71 |
* previewPage
|
72 |
* 確認ページでのフォーム項目を返す
|
|
|
73 |
* @return String HTML
|
74 |
*/
|
75 |
+
protected function previewPage() {
|
76 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
77 |
if ( $value ) {
|
78 |
$_ret = '<div class="' . MWF_Config::NAME . '_image">';
|
79 |
$_ret .= '<img src="' . esc_attr( $value ) . '" alt="" />';
|
80 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
81 |
$_ret .= '</div>';
|
82 |
return $_ret;
|
83 |
}
|
form_fields/mw_form_field_password.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Password
|
4 |
* URI: http://2inc.org
|
5 |
* Description: パスワードフィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -50,29 +50,27 @@ class mw_form_field_password extends mw_form_field {
|
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
53 |
-
* @param Array $atts
|
54 |
* @return String HTML
|
55 |
*/
|
56 |
-
protected function inputPage(
|
57 |
-
$_ret = $this->Form->password( $atts['name'], array(
|
58 |
-
'size' => $atts['size'],
|
59 |
-
'maxlength' => $atts['maxlength'],
|
60 |
-
'value' => $atts['value'],
|
61 |
) );
|
62 |
-
if ( $atts['show_error'] !== 'false' )
|
63 |
-
$_ret .= $this->getError( $atts['name'] );
|
64 |
return $_ret;
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* previewPage
|
69 |
* 確認ページでのフォーム項目を返す
|
70 |
-
* @param Array $atts
|
71 |
* @return String HTML
|
72 |
*/
|
73 |
-
protected function previewPage(
|
74 |
-
$value = $this->Form->getValue( $atts['name'] );
|
75 |
-
return '*****' . $this->Form->hidden( $atts['name'], $
|
76 |
}
|
77 |
|
78 |
/**
|
3 |
* Name: MW Form Field Password
|
4 |
* URI: http://2inc.org
|
5 |
* Description: パスワードフィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
|
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
+
protected function inputPage() {
|
56 |
+
$_ret = $this->Form->password( $this->atts['name'], array(
|
57 |
+
'size' => $this->atts['size'],
|
58 |
+
'maxlength' => $this->atts['maxlength'],
|
59 |
+
'value' => $this->atts['value'],
|
60 |
) );
|
61 |
+
if ( $this->atts['show_error'] !== 'false' )
|
62 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
63 |
return $_ret;
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* previewPage
|
68 |
* 確認ページでのフォーム項目を返す
|
|
|
69 |
* @return String HTML
|
70 |
*/
|
71 |
+
protected function previewPage() {
|
72 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
73 |
+
return '*****' . $this->Form->hidden( $this->atts['name'], $value );
|
74 |
}
|
75 |
|
76 |
/**
|
form_fields/mw_form_field_preview_button.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Preview Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 確認ボタンを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -46,20 +46,18 @@ class mw_form_field_preview_button extends mw_form_field {
|
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
49 |
-
* @param Array $atts
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
-
protected function inputPage(
|
53 |
-
return $this->Form->submit( $this->Form->getPreviewButtonName(), $atts['value'] );
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* previewPage
|
58 |
* 確認ページでのフォーム項目を返す
|
59 |
-
* @param Array $atts
|
60 |
* @return String HTML
|
61 |
*/
|
62 |
-
protected function previewPage(
|
63 |
}
|
64 |
|
65 |
/**
|
3 |
* Name: MW Form Field Preview Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 確認ボタンを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
46 |
/**
|
47 |
* inputPage
|
48 |
* 入力ページでのフォーム項目を返す
|
|
|
49 |
* @return String HTML
|
50 |
*/
|
51 |
+
protected function inputPage() {
|
52 |
+
return $this->Form->submit( $this->Form->getPreviewButtonName(), $this->atts['value'] );
|
53 |
}
|
54 |
|
55 |
/**
|
56 |
* previewPage
|
57 |
* 確認ページでのフォーム項目を返す
|
|
|
58 |
* @return String HTML
|
59 |
*/
|
60 |
+
protected function previewPage() {
|
61 |
}
|
62 |
|
63 |
/**
|
form_fields/mw_form_field_radio.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Radio
|
4 |
* URI: http://2inc.org
|
5 |
* Description: ラジオボタンを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -49,31 +49,28 @@ class mw_form_field_radio extends mw_form_field {
|
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
52 |
-
* @param Array $atts
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
-
protected function inputPage(
|
56 |
-
$children = $this->getChildren( $atts['children'] );
|
57 |
-
|
58 |
-
|
59 |
-
'value' => $atts['value'],
|
60 |
) );
|
61 |
-
if ( $atts['show_error'] !== 'false' )
|
62 |
-
$_ret .= $this->getError( $atts['name'] );
|
63 |
return $_ret;
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* previewPage
|
68 |
* 確認ページでのフォーム項目を返す
|
69 |
-
* @param Array $atts
|
70 |
* @return String HTML
|
71 |
*/
|
72 |
-
protected function previewPage(
|
73 |
-
$children = $this->getChildren( $atts['children'] );
|
74 |
-
$value = $this->Form->getRadioValue( $atts['name'], $children );
|
75 |
$_ret = $value;
|
76 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
77 |
return $_ret;
|
78 |
}
|
79 |
|
3 |
* Name: MW Form Field Radio
|
4 |
* URI: http://2inc.org
|
5 |
* Description: ラジオボタンを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
|
|
52 |
* @return String HTML
|
53 |
*/
|
54 |
+
protected function inputPage() {
|
55 |
+
$children = $this->getChildren( $this->atts['children'] );
|
56 |
+
$_ret = $this->Form->radio( $this->atts['name'], $children, array(
|
57 |
+
'value' => $this->atts['value'],
|
|
|
58 |
) );
|
59 |
+
if ( $this->atts['show_error'] !== 'false' )
|
60 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
61 |
return $_ret;
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* previewPage
|
66 |
* 確認ページでのフォーム項目を返す
|
|
|
67 |
* @return String HTML
|
68 |
*/
|
69 |
+
protected function previewPage() {
|
70 |
+
$children = $this->getChildren( $this->atts['children'] );
|
71 |
+
$value = $this->Form->getRadioValue( $this->atts['name'], $children );
|
72 |
$_ret = $value;
|
73 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
74 |
return $_ret;
|
75 |
}
|
76 |
|
form_fields/mw_form_field_select.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Select
|
4 |
* URI: http://2inc.org
|
5 |
* Description: セレクトボックスを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -49,30 +49,28 @@ class mw_form_field_select extends mw_form_field {
|
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
52 |
-
* @param Array $atts
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
-
protected function inputPage(
|
56 |
-
$children = $this->getChildren( $atts['children'] );
|
57 |
-
$_ret = $this->Form->select( $atts['name'], $children, array(
|
58 |
-
'value' => $atts['value'],
|
59 |
) );
|
60 |
-
if ( $atts['show_error'] !== 'false' )
|
61 |
-
$_ret .= $this->getError( $atts['name'] );
|
62 |
return $_ret;
|
63 |
}
|
64 |
|
65 |
/**
|
66 |
* previewPage
|
67 |
* 確認ページでのフォーム項目を返す
|
68 |
-
* @param Array $atts
|
69 |
* @return String HTML
|
70 |
*/
|
71 |
-
protected function previewPage(
|
72 |
-
$children = $this->getChildren( $atts['children'] );
|
73 |
-
$value = $this->Form->getSelectedValue( $atts['name'], $children );
|
74 |
$_ret = $value;
|
75 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
76 |
return $_ret;
|
77 |
}
|
78 |
|
3 |
* Name: MW Form Field Select
|
4 |
* URI: http://2inc.org
|
5 |
* Description: セレクトボックスを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
|
|
52 |
* @return String HTML
|
53 |
*/
|
54 |
+
protected function inputPage() {
|
55 |
+
$children = $this->getChildren( $this->atts['children'] );
|
56 |
+
$_ret = $this->Form->select( $this->atts['name'], $children, array(
|
57 |
+
'value' => $this->atts['value'],
|
58 |
) );
|
59 |
+
if ( $this->atts['show_error'] !== 'false' )
|
60 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
61 |
return $_ret;
|
62 |
}
|
63 |
|
64 |
/**
|
65 |
* previewPage
|
66 |
* 確認ページでのフォーム項目を返す
|
|
|
67 |
* @return String HTML
|
68 |
*/
|
69 |
+
protected function previewPage() {
|
70 |
+
$children = $this->getChildren( $this->atts['children'] );
|
71 |
+
$value = $this->Form->getSelectedValue( $this->atts['name'], $children );
|
72 |
$_ret = $value;
|
73 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
74 |
return $_ret;
|
75 |
}
|
76 |
|
form_fields/mw_form_field_submit.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Submit Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 送信ボタンを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -47,21 +47,19 @@ class mw_form_field_submit extends mw_form_field {
|
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
50 |
-
* @param Array $atts
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
-
protected function inputPage(
|
54 |
-
return $this->Form->submit( $atts['name'], $atts['value'] );
|
55 |
}
|
56 |
|
57 |
/**
|
58 |
* previewPage
|
59 |
* 確認ページでのフォーム項目を返す
|
60 |
-
* @param Array $atts
|
61 |
* @return String HTML
|
62 |
*/
|
63 |
-
protected function previewPage(
|
64 |
-
return $this->inputPage( $atts );
|
65 |
}
|
66 |
|
67 |
/**
|
3 |
* Name: MW Form Field Submit Button
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 送信ボタンを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
|
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
+
protected function inputPage() {
|
53 |
+
return $this->Form->submit( $this->atts['name'], $this->atts['value'] );
|
54 |
}
|
55 |
|
56 |
/**
|
57 |
* previewPage
|
58 |
* 確認ページでのフォーム項目を返す
|
|
|
59 |
* @return String HTML
|
60 |
*/
|
61 |
+
protected function previewPage() {
|
62 |
+
return $this->inputPage( $this->atts );
|
63 |
}
|
64 |
|
65 |
/**
|
form_fields/mw_form_field_submit_button.php
CHANGED
@@ -4,11 +4,11 @@
|
|
4 |
* URI: http://2inc.org
|
5 |
* Description: サブミットボタンを出力。
|
6 |
* Description: 確認ボタンと送信ボタンを自動出力。
|
7 |
-
* Version: 1.
|
8 |
* Author: Takashi Kitajima
|
9 |
* Author URI: http://2inc.org
|
10 |
* Created: December 14, 2012
|
11 |
-
* Modified:
|
12 |
* License: GPL2
|
13 |
*
|
14 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -49,24 +49,22 @@ class mw_form_field_submit_button extends mw_form_field {
|
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
52 |
-
* @param Array $atts
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
-
protected function inputPage(
|
56 |
-
if ( !empty( $atts['preview_value'] ) ) {
|
57 |
-
return $this->Form->submit( $this->Form->getPreviewButtonName(), $atts['preview_value'] );
|
58 |
}
|
59 |
-
return $this->Form->submit( $atts['name'], $atts['submit_value'] );
|
60 |
}
|
61 |
|
62 |
/**
|
63 |
* previewPage
|
64 |
* 確認ページでのフォーム項目を返す
|
65 |
-
* @param Array $atts
|
66 |
* @return String HTML
|
67 |
*/
|
68 |
-
protected function previewPage(
|
69 |
-
return $this->Form->submit( $atts['name'], $atts['submit_value'] );
|
70 |
}
|
71 |
|
72 |
/**
|
4 |
* URI: http://2inc.org
|
5 |
* Description: サブミットボタンを出力。
|
6 |
* Description: 確認ボタンと送信ボタンを自動出力。
|
7 |
+
* Version: 1.2
|
8 |
* Author: Takashi Kitajima
|
9 |
* Author URI: http://2inc.org
|
10 |
* Created: December 14, 2012
|
11 |
+
* Modified: Septermber 19, 2013
|
12 |
* License: GPL2
|
13 |
*
|
14 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
49 |
/**
|
50 |
* inputPage
|
51 |
* 入力ページでのフォーム項目を返す
|
|
|
52 |
* @return String HTML
|
53 |
*/
|
54 |
+
protected function inputPage() {
|
55 |
+
if ( !empty( $this->atts['preview_value'] ) ) {
|
56 |
+
return $this->Form->submit( $this->Form->getPreviewButtonName(), $this->atts['preview_value'] );
|
57 |
}
|
58 |
+
return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
|
59 |
}
|
60 |
|
61 |
/**
|
62 |
* previewPage
|
63 |
* 確認ページでのフォーム項目を返す
|
|
|
64 |
* @return String HTML
|
65 |
*/
|
66 |
+
protected function previewPage() {
|
67 |
+
return $this->Form->submit( $this->atts['name'], $this->atts['submit_value'] );
|
68 |
}
|
69 |
|
70 |
/**
|
form_fields/mw_form_field_tel.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Tel
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 電話番号フィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -47,27 +47,25 @@ class mw_form_field_tel extends mw_form_field {
|
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
50 |
-
* @param Array $atts
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
-
protected function inputPage(
|
54 |
-
$_ret = $this->Form->tel( $atts['name'] );
|
55 |
-
if ( $atts['show_error'] !== 'false' )
|
56 |
-
$_ret .= $this->getError( $atts['name'] );
|
57 |
return $_ret;
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
* previewPage
|
62 |
* 確認ページでのフォーム項目を返す
|
63 |
-
* @param Array $atts
|
64 |
* @return String HTML
|
65 |
*/
|
66 |
-
protected function previewPage(
|
67 |
-
$value = $this->Form->getTelValue( $atts['name'] );
|
68 |
$_ret = $value;
|
69 |
-
$_ret .= $this->Form->hidden( $atts['name'].'[data]', $value );
|
70 |
-
$_ret .= $this->Form->separator( $atts['name'] );
|
71 |
return $_ret;
|
72 |
}
|
73 |
|
3 |
* Name: MW Form Field Tel
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 電話番号フィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
|
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
+
protected function inputPage() {
|
53 |
+
$_ret = $this->Form->tel( $this->atts['name'] );
|
54 |
+
if ( $this->atts['show_error'] !== 'false' )
|
55 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
56 |
return $_ret;
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* previewPage
|
61 |
* 確認ページでのフォーム項目を返す
|
|
|
62 |
* @return String HTML
|
63 |
*/
|
64 |
+
protected function previewPage() {
|
65 |
+
$value = $this->Form->getTelValue( $this->atts['name'] );
|
66 |
$_ret = $value;
|
67 |
+
$_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
|
68 |
+
$_ret .= $this->Form->separator( $this->atts['name'] );
|
69 |
return $_ret;
|
70 |
}
|
71 |
|
form_fields/mw_form_field_text.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Text
|
4 |
* URI: http://2inc.org
|
5 |
* Description: テキストフィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -50,30 +50,28 @@ class mw_form_field_text extends mw_form_field {
|
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
53 |
-
* @param Array $atts
|
54 |
* @return String HTML
|
55 |
*/
|
56 |
-
protected function inputPage(
|
57 |
-
$_ret = $this->Form->text( $atts['name'], array(
|
58 |
-
'size' => $atts['size'],
|
59 |
-
'maxlength' => $atts['maxlength'],
|
60 |
-
'value' => $atts['value'],
|
61 |
) );
|
62 |
-
if ( $atts['show_error'] !== 'false' )
|
63 |
-
$_ret .= $this->getError( $atts['name'] );
|
64 |
return $_ret;
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* previewPage
|
69 |
* 確認ページでのフォーム項目を返す
|
70 |
-
* @param Array $atts
|
71 |
* @return String HTML
|
72 |
*/
|
73 |
-
protected function previewPage(
|
74 |
-
$value = $this->Form->getValue( $atts['name'] );
|
75 |
$_ret = $value;
|
76 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
77 |
return $_ret;
|
78 |
}
|
79 |
|
3 |
* Name: MW Form Field Text
|
4 |
* URI: http://2inc.org
|
5 |
* Description: テキストフィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
|
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
+
protected function inputPage() {
|
56 |
+
$_ret = $this->Form->text( $this->atts['name'], array(
|
57 |
+
'size' => $this->atts['size'],
|
58 |
+
'maxlength' => $this->atts['maxlength'],
|
59 |
+
'value' => $this->atts['value'],
|
60 |
) );
|
61 |
+
if ( $this->atts['show_error'] !== 'false' )
|
62 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
63 |
return $_ret;
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* previewPage
|
68 |
* 確認ページでのフォーム項目を返す
|
|
|
69 |
* @return String HTML
|
70 |
*/
|
71 |
+
protected function previewPage() {
|
72 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
73 |
$_ret = $value;
|
74 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
75 |
return $_ret;
|
76 |
}
|
77 |
|
form_fields/mw_form_field_textarea.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field TextArea
|
4 |
* URI: http://2inc.org
|
5 |
* Description: テキストエリアを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -50,30 +50,28 @@ class mw_form_field_textarea extends mw_form_field {
|
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
53 |
-
* @param Array $atts
|
54 |
* @return String HTML
|
55 |
*/
|
56 |
-
protected function inputPage(
|
57 |
-
$_ret = $this->Form->textarea( $atts['name'], array(
|
58 |
-
'cols' => $atts['cols'],
|
59 |
-
'rows' => $atts['rows'],
|
60 |
-
'value' => $atts['value'],
|
61 |
) );
|
62 |
-
if ( $atts['show_error'] !== 'false' )
|
63 |
-
$_ret .= $this->getError( $atts['name'] );
|
64 |
return $_ret;
|
65 |
}
|
66 |
|
67 |
/**
|
68 |
* previewPage
|
69 |
* 確認ページでのフォーム項目を返す
|
70 |
-
* @param Array $atts
|
71 |
* @return String HTML
|
72 |
*/
|
73 |
-
protected function previewPage(
|
74 |
-
$value = $this->Form->getValue( $atts['name'] );
|
75 |
$_ret = nl2br( $value );
|
76 |
-
$_ret .= $this->Form->hidden( $atts['name'], $value );
|
77 |
return $_ret;
|
78 |
}
|
79 |
|
3 |
* Name: MW Form Field TextArea
|
4 |
* URI: http://2inc.org
|
5 |
* Description: テキストエリアを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
50 |
/**
|
51 |
* inputPage
|
52 |
* 入力ページでのフォーム項目を返す
|
|
|
53 |
* @return String HTML
|
54 |
*/
|
55 |
+
protected function inputPage() {
|
56 |
+
$_ret = $this->Form->textarea( $this->atts['name'], array(
|
57 |
+
'cols' => $this->atts['cols'],
|
58 |
+
'rows' => $this->atts['rows'],
|
59 |
+
'value' => $this->atts['value'],
|
60 |
) );
|
61 |
+
if ( $this->atts['show_error'] !== 'false' )
|
62 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
63 |
return $_ret;
|
64 |
}
|
65 |
|
66 |
/**
|
67 |
* previewPage
|
68 |
* 確認ページでのフォーム項目を返す
|
|
|
69 |
* @return String HTML
|
70 |
*/
|
71 |
+
protected function previewPage() {
|
72 |
+
$value = $this->Form->getValue( $this->atts['name'] );
|
73 |
$_ret = nl2br( $value );
|
74 |
+
$_ret .= $this->Form->hidden( $this->atts['name'], $value );
|
75 |
return $_ret;
|
76 |
}
|
77 |
|
form_fields/mw_form_field_zip.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field Zip
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 郵便番号フィールドを出力。
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -47,27 +47,25 @@ class mw_form_field_zip extends mw_form_field {
|
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
50 |
-
* @param Array $atts
|
51 |
* @return String HTML
|
52 |
*/
|
53 |
-
protected function inputPage(
|
54 |
-
$_ret = $this->Form->zip( $atts['name'] );
|
55 |
-
if ( $atts['show_error'] !== 'false' )
|
56 |
-
$_ret .= $this->getError( $atts['name'] );
|
57 |
return $_ret;
|
58 |
}
|
59 |
|
60 |
/**
|
61 |
* previewPage
|
62 |
* 確認ページでのフォーム項目を返す
|
63 |
-
* @param Array $atts
|
64 |
* @return String HTML
|
65 |
*/
|
66 |
-
protected function previewPage(
|
67 |
-
$value = $this->Form->getZipValue( $atts['name'] );
|
68 |
$_ret = $value;
|
69 |
-
$_ret .= $this->Form->hidden( $atts['name'].'[data]', $value );
|
70 |
-
$_ret .= $this->Form->separator( $atts['name'] );
|
71 |
return $_ret;
|
72 |
}
|
73 |
|
3 |
* Name: MW Form Field Zip
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 郵便番号フィールドを出力。
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: Septermber 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
47 |
/**
|
48 |
* inputPage
|
49 |
* 入力ページでのフォーム項目を返す
|
|
|
50 |
* @return String HTML
|
51 |
*/
|
52 |
+
protected function inputPage() {
|
53 |
+
$_ret = $this->Form->zip( $this->atts['name'] );
|
54 |
+
if ( $this->atts['show_error'] !== 'false' )
|
55 |
+
$_ret .= $this->getError( $this->atts['name'] );
|
56 |
return $_ret;
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* previewPage
|
61 |
* 確認ページでのフォーム項目を返す
|
|
|
62 |
* @return String HTML
|
63 |
*/
|
64 |
+
protected function previewPage() {
|
65 |
+
$value = $this->Form->getZipValue( $this->atts['name'] );
|
66 |
$_ret = $value;
|
67 |
+
$_ret .= $this->Form->hidden( $this->atts['name'].'[data]', $value );
|
68 |
+
$_ret .= $this->Form->separator( $this->atts['name'] );
|
69 |
return $_ret;
|
70 |
}
|
71 |
|
mw-wp-form.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
-
* Version: 0.9.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: September 25, 2012
|
10 |
-
* Modified: September
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPL2
|
@@ -570,6 +570,7 @@ class mw_wp_form {
|
|
570 |
|
571 |
// 添付ファイルをメディアに保存
|
572 |
if ( !empty( $this->insert_id ) ) {
|
|
|
573 |
foreach ( $attachments as $key => $filepath ) {
|
574 |
// WordPress( get_allowed_mime_types ) で許可されたファイルタイプ限定
|
575 |
$wp_check_filetype = wp_check_filetype( $filepath );
|
@@ -589,10 +590,13 @@ class mw_wp_form {
|
|
589 |
// 代わりにここで attachment_id を保存
|
590 |
update_post_meta( $this->insert_id, $key, $attach_id );
|
591 |
// $key が 添付ファイルのキーであるとわかるように隠し設定を保存
|
592 |
-
|
|
|
593 |
}
|
594 |
}
|
595 |
}
|
|
|
|
|
596 |
}
|
597 |
}
|
598 |
// DB非保存時
|
@@ -740,7 +744,7 @@ class mw_wp_form {
|
|
740 |
public function _mwform( $atts, $content = '' ) {
|
741 |
if ( $this->viewFlg == 'input' || $this->viewFlg == 'preview' ) {
|
742 |
$this->Error = $this->Validation->Error();
|
743 |
-
do_action( 'mwform_add_shortcode', $this->Form, $this->viewFlg, $this->Error );
|
744 |
|
745 |
// ユーザー情報取得
|
746 |
$content = $this->replace_user_property( $content );
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
5 |
* Description: MW WP Form can create mail form with a confirmation screen.
|
6 |
+
* Version: 0.9.11
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: September 25, 2012
|
10 |
+
* Modified: September 19, 2013
|
11 |
* Text Domain: mw-wp-form
|
12 |
* Domain Path: /languages/
|
13 |
* License: GPL2
|
570 |
|
571 |
// 添付ファイルをメディアに保存
|
572 |
if ( !empty( $this->insert_id ) ) {
|
573 |
+
$save_attached_key = array();
|
574 |
foreach ( $attachments as $key => $filepath ) {
|
575 |
// WordPress( get_allowed_mime_types ) で許可されたファイルタイプ限定
|
576 |
$wp_check_filetype = wp_check_filetype( $filepath );
|
590 |
// 代わりにここで attachment_id を保存
|
591 |
update_post_meta( $this->insert_id, $key, $attach_id );
|
592 |
// $key が 添付ファイルのキーであるとわかるように隠し設定を保存
|
593 |
+
//add_post_meta( $this->insert_id, '_' . MWF_Config::UPLOAD_FILE_KEYS, $key );
|
594 |
+
$save_attached_key[] = $key;
|
595 |
}
|
596 |
}
|
597 |
}
|
598 |
+
if ( $save_attached_key )
|
599 |
+
update_post_meta( $this->insert_id, '_' . MWF_Config::UPLOAD_FILE_KEYS, $save_attached_key );
|
600 |
}
|
601 |
}
|
602 |
// DB非保存時
|
744 |
public function _mwform( $atts, $content = '' ) {
|
745 |
if ( $this->viewFlg == 'input' || $this->viewFlg == 'preview' ) {
|
746 |
$this->Error = $this->Validation->Error();
|
747 |
+
do_action( 'mwform_add_shortcode', $this->Form, $this->viewFlg, $this->Error, $this->key );
|
748 |
|
749 |
// ユーザー情報取得
|
750 |
$content = $this->replace_user_property( $content );
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: plugin, form, confirm, preview
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 3.5
|
7 |
-
Stable tag: 0.9.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -37,6 +37,11 @@ http://2inc.org/blog/category/products/wordpress_plugins/mw-wp-form/
|
|
37 |
|
38 |
== Changelog ==
|
39 |
|
|
|
|
|
|
|
|
|
|
|
40 |
= 0.9.10 =
|
41 |
* Bug fix: mwform_admin_mail_識別子、mwform_auto_mail_識別子フィルターフックの定義位置が逆だったのを修正
|
42 |
* Bug fix: 添付ファイルが添付されないバグを修正(From Ver0.9.4)
|
4 |
Tags: plugin, form, confirm, preview
|
5 |
Requires at least: 3.4
|
6 |
Tested up to: 3.5
|
7 |
+
Stable tag: 0.9.11
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
37 |
|
38 |
== Changelog ==
|
39 |
|
40 |
+
= 0.9.11 =
|
41 |
+
* Bug fix: 添付ファイルが複数あり、かつDB保存の場合、管理画面で最後の画像しか表示されないバグを修正
|
42 |
+
* Cahged : どのフィールドが画像かを示すメタデータの保存形式を配列に変更
|
43 |
+
* Cahged : mw_form_field::inputPage、mw_form_field::previewPage の引数削除
|
44 |
+
|
45 |
= 0.9.10 =
|
46 |
* Bug fix: mwform_admin_mail_識別子、mwform_auto_mail_識別子フィルターフックの定義位置が逆だったのを修正
|
47 |
* Bug fix: 添付ファイルが添付されないバグを修正(From Ver0.9.4)
|
system/mw_form_field.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW Form Field
|
4 |
* URI: http://2inc.org
|
5 |
* Description: フォームフィールドの抽象クラス
|
6 |
-
* Version: 1.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
-
* Modified:
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -40,19 +40,29 @@ abstract class mw_form_field {
|
|
40 |
/**
|
41 |
* Array $defaults 属性値等初期値
|
42 |
*/
|
43 |
-
protected $defaults;
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
/**
|
46 |
* Error $Error エラーオブジェクト
|
47 |
*/
|
48 |
protected $Error;
|
49 |
|
|
|
|
|
|
|
|
|
|
|
50 |
/**
|
51 |
* __construct
|
52 |
*/
|
53 |
public function __construct() {
|
54 |
$this->defaults = $this->setDefaults();
|
55 |
-
add_action( 'mwform_add_shortcode', array( $this, 'add_shortcode' ), 10,
|
56 |
add_action( 'mwform_add_qtags', array( $this, '_add_qtags' ) );
|
57 |
}
|
58 |
|
@@ -84,10 +94,10 @@ abstract class mw_form_field {
|
|
84 |
* @param Array $atts
|
85 |
* @return String HTML
|
86 |
*/
|
87 |
-
abstract protected function inputPage(
|
88 |
public function _inputPage( $atts ) {
|
89 |
-
$atts = shortcode_atts( $this->defaults, $atts );
|
90 |
-
return $this->inputPage(
|
91 |
}
|
92 |
|
93 |
/**
|
@@ -96,10 +106,10 @@ abstract class mw_form_field {
|
|
96 |
* @param Array $atts
|
97 |
* @return String HTML
|
98 |
*/
|
99 |
-
abstract protected function previewPage(
|
100 |
public function _previewPage( $atts ) {
|
101 |
-
$atts = shortcode_atts( $this->defaults, $atts );
|
102 |
-
return $this->previewPage(
|
103 |
}
|
104 |
|
105 |
/**
|
@@ -108,11 +118,13 @@ abstract class mw_form_field {
|
|
108 |
* @param MW_Form $Form
|
109 |
* String $viewFlg
|
110 |
* MW_Error $Error
|
|
|
111 |
*/
|
112 |
-
public function add_shortcode( mw_form $Form, $viewFlg, mw_error $Error ) {
|
113 |
if ( !empty( $this->short_code_name ) ) {
|
114 |
$this->Form = $Form;
|
115 |
$this->Error = $Error;
|
|
|
116 |
switch( $viewFlg ) {
|
117 |
case 'input' :
|
118 |
add_shortcode( $this->short_code_name, array( $this, '_inputPage' ) );
|
@@ -139,6 +151,8 @@ abstract class mw_form_field {
|
|
139 |
foreach ( $_children as $child ) {
|
140 |
$children[$child] = $child;
|
141 |
}
|
|
|
|
|
142 |
return $children;
|
143 |
}
|
144 |
|
3 |
* Name: MW Form Field
|
4 |
* URI: http://2inc.org
|
5 |
* Description: フォームフィールドの抽象クラス
|
6 |
+
* Version: 1.2
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: December 14, 2012
|
10 |
+
* Modified: September 19, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
40 |
/**
|
41 |
* Array $defaults 属性値等初期値
|
42 |
*/
|
43 |
+
protected $defaults = array();
|
44 |
+
|
45 |
+
/**
|
46 |
+
* Array $atts 属性値
|
47 |
+
*/
|
48 |
+
protected $atts = array();
|
49 |
|
50 |
/**
|
51 |
* Error $Error エラーオブジェクト
|
52 |
*/
|
53 |
protected $Error;
|
54 |
|
55 |
+
/**
|
56 |
+
* key $key フォーム識別子
|
57 |
+
*/
|
58 |
+
protected $key;
|
59 |
+
|
60 |
/**
|
61 |
* __construct
|
62 |
*/
|
63 |
public function __construct() {
|
64 |
$this->defaults = $this->setDefaults();
|
65 |
+
add_action( 'mwform_add_shortcode', array( $this, 'add_shortcode' ), 10, 4 );
|
66 |
add_action( 'mwform_add_qtags', array( $this, '_add_qtags' ) );
|
67 |
}
|
68 |
|
94 |
* @param Array $atts
|
95 |
* @return String HTML
|
96 |
*/
|
97 |
+
abstract protected function inputPage();
|
98 |
public function _inputPage( $atts ) {
|
99 |
+
$this->atts = shortcode_atts( $this->defaults, $atts );
|
100 |
+
return $this->inputPage();
|
101 |
}
|
102 |
|
103 |
/**
|
106 |
* @param Array $atts
|
107 |
* @return String HTML
|
108 |
*/
|
109 |
+
abstract protected function previewPage();
|
110 |
public function _previewPage( $atts ) {
|
111 |
+
$this->atts = shortcode_atts( $this->defaults, $atts );
|
112 |
+
return $this->previewPage();
|
113 |
}
|
114 |
|
115 |
/**
|
118 |
* @param MW_Form $Form
|
119 |
* String $viewFlg
|
120 |
* MW_Error $Error
|
121 |
+
* String $key
|
122 |
*/
|
123 |
+
public function add_shortcode( mw_form $Form, $viewFlg, mw_error $Error, $key ) {
|
124 |
if ( !empty( $this->short_code_name ) ) {
|
125 |
$this->Form = $Form;
|
126 |
$this->Error = $Error;
|
127 |
+
$this->key = $key;
|
128 |
switch( $viewFlg ) {
|
129 |
case 'input' :
|
130 |
add_shortcode( $this->short_code_name, array( $this, '_inputPage' ) );
|
151 |
foreach ( $_children as $child ) {
|
152 |
$children[$child] = $child;
|
153 |
}
|
154 |
+
if ( $this->key )
|
155 |
+
$children = apply_filters( 'mwform_choices_' . $this->key, $children, $this->atts );
|
156 |
return $children;
|
157 |
}
|
158 |
|
system/mw_wp_form_admin_page.php
CHANGED
@@ -3,11 +3,11 @@
|
|
3 |
* Name: MW WP Form Admin Page
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 管理画面クラス
|
6 |
-
* Version: 1.5.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: February 21, 2013
|
10 |
-
* Modified: September
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
@@ -290,7 +290,13 @@ class MW_WP_Form_Admin_Page {
|
|
290 |
public function custom_fields() {
|
291 |
global $post;
|
292 |
$post_custom = get_post_custom( $post->ID );
|
293 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
if ( ! empty( $post_custom ) && is_array( $post_custom ) ) {
|
295 |
?>
|
296 |
<table border="0" cellpadding="0" cellspacing="0">
|
@@ -307,7 +313,7 @@ class MW_WP_Form_Admin_Page {
|
|
307 |
if ( $mimetype ) {
|
308 |
// 画像だったら
|
309 |
if ( preg_match( '/^image\/.+?$/', $mimetype ) ) {
|
310 |
-
$src = wp_get_attachment_image_src( $value[0], '
|
311 |
echo '<img src="' . esc_url( $src[0] ) .'" alt="" />';
|
312 |
}
|
313 |
// 画像以外
|
3 |
* Name: MW WP Form Admin Page
|
4 |
* URI: http://2inc.org
|
5 |
* Description: 管理画面クラス
|
6 |
+
* Version: 1.5.4
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created: February 21, 2013
|
10 |
+
* Modified: September 17, 2013
|
11 |
* License: GPL2
|
12 |
*
|
13 |
* Copyright 2013 Takashi Kitajima (email : inc@2inc.org)
|
290 |
public function custom_fields() {
|
291 |
global $post;
|
292 |
$post_custom = get_post_custom( $post->ID );
|
293 |
+
// 前のバージョンでは MWF_Config::UPLOAD_FILE_KEYS を配列で保持していなかったので分岐させる
|
294 |
+
$_upload_file_keys = get_post_meta( $post->ID, '_' . MWF_Config::UPLOAD_FILE_KEYS, true );
|
295 |
+
if ( is_array( $_upload_file_keys ) ) {
|
296 |
+
$upload_file_keys = $_upload_file_keys;
|
297 |
+
} else {
|
298 |
+
$upload_file_keys = get_post_custom_values( '_' . MWF_Config::UPLOAD_FILE_KEYS, $post->ID );
|
299 |
+
}
|
300 |
if ( ! empty( $post_custom ) && is_array( $post_custom ) ) {
|
301 |
?>
|
302 |
<table border="0" cellpadding="0" cellspacing="0">
|
313 |
if ( $mimetype ) {
|
314 |
// 画像だったら
|
315 |
if ( preg_match( '/^image\/.+?$/', $mimetype ) ) {
|
316 |
+
$src = wp_get_attachment_image_src( $value[0], 'medium' );
|
317 |
echo '<img src="' . esc_url( $src[0] ) .'" alt="" />';
|
318 |
}
|
319 |
// 画像以外
|