Version Description
- Refactoring mail sending part.
- Added : Add "Send value by e-mail" option for checkbox, select, radio.
- Added : Add filter hook mwform_custom_mail_tag_mw-wp-form-xxx.
- Added : Add filter hook mwform_contact_data_post_type.
- Added : Add filter hook mwform_get_inquiry_data_args-mwf_xxx
- Added : Add debug mode. no send mail and logging when set "define( 'MWFORM_DEBUG', true );".
- Added : Add filter hook mwform_log_directory.
- Changed : Refactoring admin pages.
- Changed : Changed generating method of file name that uploaded.
- Bugfix : Fixed ai, psd, eps file upload bug.
- Bugfix : Fix typo.
Download this release
Release Info
Developer | inc2734 |
Plugin | MW WP Form |
Version | 2.3.0 |
Comparing to | |
See all releases |
Code changes from version 2.2.7 to 2.3.0
- classes/controllers/class.admin-list.php +24 -7
- classes/controllers/class.admin.php +37 -52
- classes/controllers/class.chart.php +29 -45
- classes/controllers/class.contact-data-list.php +76 -17
- classes/controllers/class.contact-data.php +48 -36
- classes/controllers/class.main.php +2 -22
- classes/form-fields/class.checkbox.php +15 -4
- classes/form-fields/class.radio.php +15 -4
- classes/form-fields/class.select.php +15 -4
- classes/models/class.admin.php +19 -2
- classes/models/class.contact-data-setting.php +16 -8
- classes/models/class.file.php +16 -14
- classes/models/class.mail.php +21 -1
- classes/models/class.validation.php +6 -3
- classes/services/class.mail.php +132 -143
- classes/views/class.admin-list.php +13 -2
- classes/views/class.admin.php +2 -13
- classes/views/class.chart.php +15 -23
- classes/views/class.contact-data-list.php +6 -2
- classes/views/class.contact-data.php +14 -5
- css/admin-common.css +5 -0
- css/admin-data-list.css +43 -0
- css/admin-data.css +46 -0
- css/admin-list.css +65 -0
- css/admin-repeatable.css +134 -0
- css/admin.css +3 -248
- js/{admin-data.js → admin-data-list.js} +0 -0
- js/admin.js +1 -1
- languages/mw-wp-form-ja.mo +0 -0
- languages/mw-wp-form-ja.po +46 -32
- languages/mw-wp-form.pot +43 -31
- mw-wp-form.php +16 -7
- readme.txt +15 -2
classes/controllers/class.admin-list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin List Controller
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -15,17 +15,34 @@ class MW_WP_Form_Admin_List_Controller {
|
|
15 |
* initialize
|
16 |
*/
|
17 |
public function initialize() {
|
18 |
-
add_action( '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
22 |
* add_columns
|
23 |
*/
|
24 |
public function add_columns() {
|
25 |
-
$post_type = get_post_type();
|
26 |
-
if ( $post_type !== MWF_Config::NAME ) {
|
27 |
-
return;
|
28 |
-
}
|
29 |
add_filter( 'manage_posts_columns' , array( $this, 'manage_posts_columns' ) );
|
30 |
add_action( 'manage_posts_custom_column', array( $this, 'manage_posts_custom_column' ), 10, 2 );
|
31 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin List Controller
|
4 |
+
* Version : 1.0.1
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
+
* Modified : February 8, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
15 |
* initialize
|
16 |
*/
|
17 |
public function initialize() {
|
18 |
+
add_action( 'current_screen', array( $this , 'current_screen' ) );
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* current_screen
|
23 |
+
* @param WP_Screen $screen
|
24 |
+
*/
|
25 |
+
public function current_screen( $screen ) {
|
26 |
+
if ( $screen->id === 'edit-' . MWF_Config::NAME ) {
|
27 |
+
$View = new MW_WP_Form_Admin_List_View();
|
28 |
+
add_filter( 'views_' . $screen->id , array( $View, 'donate_link' ) );
|
29 |
+
add_action( 'admin_head' , array( $this, 'add_columns' ) );
|
30 |
+
add_action( 'admin_enqueue_scripts', array( $this , 'admin_enqueue_scripts' ) );
|
31 |
+
}
|
32 |
+
}
|
33 |
+
|
34 |
+
/**
|
35 |
+
* admin_enqueue_scripts
|
36 |
+
*/
|
37 |
+
public function admin_enqueue_scripts() {
|
38 |
+
$url = plugins_url( MWF_Config::NAME );
|
39 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-list', $url . '/css/admin-list.css' );
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
* add_columns
|
44 |
*/
|
45 |
public function add_columns() {
|
|
|
|
|
|
|
|
|
46 |
add_filter( 'manage_posts_columns' , array( $this, 'manage_posts_columns' ) );
|
47 |
add_action( 'manage_posts_custom_column', array( $this, 'manage_posts_custom_column' ), 10, 2 );
|
48 |
}
|
classes/controllers/class.admin.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin Controller
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : December 31, 2014
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -34,26 +34,30 @@ class MW_WP_Form_Admin_Controller {
|
|
34 |
* initialize
|
35 |
*/
|
36 |
public function initialize() {
|
37 |
-
$
|
38 |
-
$Admin = new MW_WP_Form_Admin();
|
39 |
-
add_action( 'add_meta_boxes' , array( $this , 'add_meta_boxes' ) );
|
40 |
-
add_action( 'current_screen' , array( $this , 'current_screen' ) );
|
41 |
-
add_filter( 'default_content' , array( $this , 'default_content' ) );
|
42 |
-
add_action( 'media_buttons' , array( $View , 'tag_generator' ) );
|
43 |
-
add_action( 'admin_enqueue_scripts' , array( $this , 'admin_enqueue_scripts' ) );
|
44 |
-
add_action( 'admin_print_footer_scripts', array( $View , 'quicktag' ) );
|
45 |
-
add_action( 'save_post' , array( $Admin, 'save_post' ) );
|
46 |
}
|
47 |
|
48 |
/**
|
49 |
-
*
|
|
|
50 |
*/
|
51 |
-
public function
|
52 |
-
$
|
53 |
-
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
}
|
|
|
56 |
|
|
|
|
|
|
|
|
|
57 |
$View = new MW_WP_Form_Admin_View();
|
58 |
|
59 |
// 完了画面内容
|
@@ -160,18 +164,6 @@ class MW_WP_Form_Admin_Controller {
|
|
160 |
}
|
161 |
}
|
162 |
|
163 |
-
/**
|
164 |
-
* current_screen
|
165 |
-
* 寄付リンクを表示
|
166 |
-
* @param WP_Screen $screen
|
167 |
-
*/
|
168 |
-
public function current_screen( $screen ) {
|
169 |
-
$View = new MW_WP_Form_Admin_View();
|
170 |
-
if ( $screen->id === 'edit-' . MWF_Config::NAME ) {
|
171 |
-
add_filter( 'views_' . $screen->id, array( $View, 'donate_link' ) );
|
172 |
-
}
|
173 |
-
}
|
174 |
-
|
175 |
/**
|
176 |
* default_content
|
177 |
* 本文の初期値を設定
|
@@ -179,10 +171,7 @@ class MW_WP_Form_Admin_Controller {
|
|
179 |
* @return string
|
180 |
*/
|
181 |
public function default_content( $content ) {
|
182 |
-
|
183 |
-
if ( $typenow === MWF_Config::NAME ) {
|
184 |
-
return apply_filters( 'mwform_default_content', '' );
|
185 |
-
}
|
186 |
}
|
187 |
|
188 |
/**
|
@@ -211,25 +200,21 @@ class MW_WP_Form_Admin_Controller {
|
|
211 |
*/
|
212 |
public function admin_enqueue_scripts() {
|
213 |
$post_type = get_post_type();
|
214 |
-
$url =
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
array(),
|
231 |
-
$ui->ver
|
232 |
-
);
|
233 |
-
}
|
234 |
}
|
235 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin Controller
|
4 |
+
* Version : 1.0.2
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : December 31, 2014
|
8 |
+
* Modified : February 8, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
34 |
* initialize
|
35 |
*/
|
36 |
public function initialize() {
|
37 |
+
add_action( 'current_screen', array( $this , 'current_screen' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
|
40 |
/**
|
41 |
+
* current_screen
|
42 |
+
* @param WP_Screen $screen
|
43 |
*/
|
44 |
+
public function current_screen( $screen ) {
|
45 |
+
if ( $screen->id === MWF_Config::NAME ) {
|
46 |
+
$View = new MW_WP_Form_Admin_View();
|
47 |
+
$Admin = new MW_WP_Form_Admin();
|
48 |
+
add_action( 'add_meta_boxes' , array( $this , 'add_meta_boxes' ) );
|
49 |
+
add_filter( 'default_content' , array( $this , 'default_content' ) );
|
50 |
+
add_action( 'media_buttons' , array( $View , 'tag_generator' ) );
|
51 |
+
add_action( 'admin_enqueue_scripts' , array( $this , 'admin_enqueue_scripts' ) );
|
52 |
+
add_action( 'admin_print_footer_scripts', array( $View , 'quicktag' ) );
|
53 |
+
add_action( 'save_post' , array( $Admin, 'save_post' ) );
|
54 |
}
|
55 |
+
}
|
56 |
|
57 |
+
/**
|
58 |
+
* add_meta_boxes
|
59 |
+
*/
|
60 |
+
public function add_meta_boxes() {
|
61 |
$View = new MW_WP_Form_Admin_View();
|
62 |
|
63 |
// 完了画面内容
|
164 |
}
|
165 |
}
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
/**
|
168 |
* default_content
|
169 |
* 本文の初期値を設定
|
171 |
* @return string
|
172 |
*/
|
173 |
public function default_content( $content ) {
|
174 |
+
return apply_filters( 'mwform_default_content', '' );
|
|
|
|
|
|
|
175 |
}
|
176 |
|
177 |
/**
|
200 |
*/
|
201 |
public function admin_enqueue_scripts() {
|
202 |
$post_type = get_post_type();
|
203 |
+
$url = plugins_url( MWF_Config::NAME );
|
204 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin', $url . '/css/admin.css' );
|
205 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-repeatable', $url . '/css/admin-repeatable.css' );
|
206 |
+
wp_enqueue_script( MWF_Config::NAME . '-repeatable', $url . '/js/mw-wp-form-repeatable.js' );
|
207 |
+
wp_enqueue_script( MWF_Config::NAME . '-admin', $url . '/js/admin.js' );
|
208 |
+
wp_enqueue_script( 'jquery-ui-dialog' );
|
209 |
+
wp_enqueue_script( 'jquery-ui-sortable' );
|
210 |
+
|
211 |
+
global $wp_scripts;
|
212 |
+
$ui = $wp_scripts->query( 'jquery-ui-core' );
|
213 |
+
wp_enqueue_style(
|
214 |
+
'jquery.ui',
|
215 |
+
'//ajax.googleapis.com/ajax/libs/jqueryui/' . $ui->ver . '/themes/smoothness/jquery-ui.min.css',
|
216 |
+
array(),
|
217 |
+
$ui->ver
|
218 |
+
);
|
|
|
|
|
|
|
|
|
219 |
}
|
220 |
}
|
classes/controllers/class.chart.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Chart Controller
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -46,10 +46,24 @@ class MW_WP_Form_Chart_Controller {
|
|
46 |
* initialize
|
47 |
*/
|
48 |
public function initialize() {
|
49 |
-
add_action( 'admin_menu'
|
50 |
-
add_action( 'admin_init'
|
51 |
-
add_action( '
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
@@ -57,7 +71,6 @@ class MW_WP_Form_Chart_Controller {
|
|
57 |
*/
|
58 |
public function admin_menu() {
|
59 |
$View = new MW_WP_Form_Chart_View();
|
60 |
-
$View->set( 'is_chart' , $this->is_chart() );
|
61 |
$View->set( 'post_type', $this->formkey );
|
62 |
$View->set( 'option_group', $this->option_group );
|
63 |
add_submenu_page(
|
@@ -70,21 +83,10 @@ class MW_WP_Form_Chart_Controller {
|
|
70 |
);
|
71 |
}
|
72 |
|
73 |
-
/**
|
74 |
-
* admin_print_styles
|
75 |
-
*/
|
76 |
-
public function admin_print_styles() {
|
77 |
-
$View = new MW_WP_Form_Chart_View();
|
78 |
-
$View->admin_print_styles();
|
79 |
-
}
|
80 |
-
|
81 |
/**
|
82 |
* admin_enqueue_scripts
|
83 |
*/
|
84 |
public function admin_enqueue_scripts() {
|
85 |
-
if ( !$this->is_chart() ) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
global $wp_scripts;
|
89 |
$ui = $wp_scripts->query( 'jquery-ui-core' );
|
90 |
wp_enqueue_style(
|
@@ -95,37 +97,30 @@ class MW_WP_Form_Chart_Controller {
|
|
95 |
);
|
96 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
97 |
|
98 |
-
$url =
|
99 |
-
|
100 |
-
|
101 |
-
wp_enqueue_script(
|
102 |
-
|
103 |
-
wp_register_script(
|
104 |
MWF_Config::NAME . '-repeatable',
|
105 |
-
$url . '
|
106 |
array( 'jquery' ),
|
107 |
null,
|
108 |
true
|
109 |
);
|
110 |
-
wp_enqueue_script(
|
111 |
-
|
112 |
-
wp_register_script(
|
113 |
MWF_Config::NAME . '-google-chart',
|
114 |
-
$url . '
|
115 |
array( 'jquery' ),
|
116 |
null,
|
117 |
true
|
118 |
);
|
119 |
-
wp_enqueue_script(
|
120 |
-
|
121 |
-
wp_register_script(
|
122 |
MWF_Config::NAME . '-admin-chart',
|
123 |
-
$url . '
|
124 |
array( 'jquery', 'jquery-ui-sortable' ),
|
125 |
null,
|
126 |
true
|
127 |
);
|
128 |
-
wp_enqueue_script( MWF_Config::NAME . '-admin-chart' );
|
129 |
}
|
130 |
|
131 |
/**
|
@@ -162,15 +157,4 @@ class MW_WP_Form_Chart_Controller {
|
|
162 |
}
|
163 |
return $new_input;
|
164 |
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* is_chart
|
168 |
-
* @return bool
|
169 |
-
*/
|
170 |
-
protected function is_chart() {
|
171 |
-
if ( isset( $_GET['page'] ) && $_GET['page'] === 'mw-wp-form-chart' && $this->formkey ) {
|
172 |
-
return true;
|
173 |
-
}
|
174 |
-
return false;
|
175 |
-
}
|
176 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Chart Controller
|
4 |
+
* Version : 1.0.1
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
+
* Modified : February 7, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
46 |
* initialize
|
47 |
*/
|
48 |
public function initialize() {
|
49 |
+
add_action( 'admin_menu' , array( $this, 'admin_menu' ) );
|
50 |
+
add_action( 'admin_init' , array( $this, 'register_setting' ) );
|
51 |
+
add_action( 'current_screen', array( $this, 'current_screen' ) );
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* current_screen
|
56 |
+
* @param WP_Screen $screen
|
57 |
+
*/
|
58 |
+
public function current_screen( $screen ) {
|
59 |
+
if ( $screen->id === MWF_Config::NAME . '_page_' . MWF_Config::NAME . '-chart' ) {
|
60 |
+
$contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts();
|
61 |
+
if ( !in_array( $this->formkey, $contact_data_post_types ) ) {
|
62 |
+
exit;
|
63 |
+
}
|
64 |
+
|
65 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts') );
|
66 |
+
}
|
67 |
}
|
68 |
|
69 |
/**
|
71 |
*/
|
72 |
public function admin_menu() {
|
73 |
$View = new MW_WP_Form_Chart_View();
|
|
|
74 |
$View->set( 'post_type', $this->formkey );
|
75 |
$View->set( 'option_group', $this->option_group );
|
76 |
add_submenu_page(
|
83 |
);
|
84 |
}
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
/**
|
87 |
* admin_enqueue_scripts
|
88 |
*/
|
89 |
public function admin_enqueue_scripts() {
|
|
|
|
|
|
|
90 |
global $wp_scripts;
|
91 |
$ui = $wp_scripts->query( 'jquery-ui-core' );
|
92 |
wp_enqueue_style(
|
97 |
);
|
98 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
99 |
|
100 |
+
$url = plugins_url( MWF_Config::NAME );
|
101 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-repeatable', $url . '/css/admin-repeatable.css' );
|
102 |
+
wp_enqueue_script( 'jsapi', 'https://www.google.com/jsapi' );
|
103 |
+
wp_enqueue_script(
|
|
|
|
|
104 |
MWF_Config::NAME . '-repeatable',
|
105 |
+
$url . '/js/mw-wp-form-repeatable.js',
|
106 |
array( 'jquery' ),
|
107 |
null,
|
108 |
true
|
109 |
);
|
110 |
+
wp_enqueue_script(
|
|
|
|
|
111 |
MWF_Config::NAME . '-google-chart',
|
112 |
+
$url . '/js/mw-wp-form-google-chart.js',
|
113 |
array( 'jquery' ),
|
114 |
null,
|
115 |
true
|
116 |
);
|
117 |
+
wp_enqueue_script(
|
|
|
|
|
118 |
MWF_Config::NAME . '-admin-chart',
|
119 |
+
$url . '/js/admin-chart.js',
|
120 |
array( 'jquery', 'jquery-ui-sortable' ),
|
121 |
null,
|
122 |
true
|
123 |
);
|
|
|
124 |
}
|
125 |
|
126 |
/**
|
157 |
}
|
158 |
return $new_input;
|
159 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
}
|
classes/controllers/class.contact-data-list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data List Controller
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -15,10 +15,51 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
15 |
* initialize
|
16 |
*/
|
17 |
public function initialize() {
|
18 |
-
add_action( '
|
19 |
-
|
20 |
-
|
21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
}
|
23 |
|
24 |
/**
|
@@ -26,9 +67,6 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
26 |
* DB登録データの一覧で新規追加のリンクを消す
|
27 |
*/
|
28 |
public function admin_print_styles() {
|
29 |
-
if ( !$this->is_contact_data_list() ) {
|
30 |
-
return;
|
31 |
-
}
|
32 |
$View = new MW_WP_Form_Contact_Data_List_View();
|
33 |
$View->admin_print_styles_for_list();
|
34 |
}
|
@@ -38,9 +76,6 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
38 |
* CSVダウンロードボタンを表示
|
39 |
*/
|
40 |
public function add_csv_download_button() {
|
41 |
-
if ( !$this->is_contact_data_list() ) {
|
42 |
-
return;
|
43 |
-
}
|
44 |
$post_type = get_post_type();
|
45 |
if ( true !== apply_filters( 'mwform_csv_button_' . $post_type, true ) ) {
|
46 |
return;
|
@@ -77,12 +112,17 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
77 |
$posts_per_page = $this->get_posts_per_page();
|
78 |
$paged = $this->get_paged();
|
79 |
|
80 |
-
$
|
|
|
81 |
'post_type' => $post_type,
|
82 |
'posts_per_page' => $posts_per_page,
|
83 |
'paged' => $paged,
|
84 |
'post_status' => 'any',
|
85 |
-
)
|
|
|
|
|
|
|
|
|
86 |
|
87 |
// CSVの内容を貯める
|
88 |
$csv = '';
|
@@ -232,9 +272,6 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
232 |
* DB登録使用時に問い合わせデータ一覧にカラムを追加
|
233 |
*/
|
234 |
public function add_columns() {
|
235 |
-
if ( !$this->is_contact_data_list() ) {
|
236 |
-
return;
|
237 |
-
}
|
238 |
$post_type = get_post_type();
|
239 |
add_filter(
|
240 |
'manage_' . $post_type . '_posts_columns',
|
@@ -292,6 +329,28 @@ class MW_WP_Form_Contact_Data_List_Controller {
|
|
292 |
$View->manage_posts_custom_column();
|
293 |
}
|
294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
295 |
/**
|
296 |
* is_contact_data_list
|
297 |
* @return bool
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data List Controller
|
4 |
+
* Version : 1.0.2
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
+
* Modified : February 14, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
15 |
* initialize
|
16 |
*/
|
17 |
public function initialize() {
|
18 |
+
add_action( 'current_screen', array( $this, 'current_screen' ) );
|
19 |
+
}
|
20 |
+
|
21 |
+
/**
|
22 |
+
* current_screen
|
23 |
+
* @param WP_Screen $screen
|
24 |
+
*/
|
25 |
+
public function current_screen( $screen ) {
|
26 |
+
if ( preg_match( '/^edit-' . MWF_Config::DBDATA . '\d+$/', $screen->id ) ) {
|
27 |
+
if ( !$this->is_contact_data_list() ) {
|
28 |
+
exit;
|
29 |
+
}
|
30 |
+
$this->csv_download();
|
31 |
+
add_action( 'pre_get_posts' , array( $this, 'pre_get_posts' ) );
|
32 |
+
add_action( 'admin_head' , array( $this, 'add_columns' ) );
|
33 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
34 |
+
add_action( 'admin_print_styles' , array( $this, 'admin_print_styles' ) );
|
35 |
+
add_action( 'in_admin_footer' , array( $this, 'add_csv_download_button' ) );
|
36 |
+
add_filter( 'wp_count_posts' , array( $this, 'wp_count_posts' ), 10, 2 );
|
37 |
+
}
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* pre_get_posts
|
42 |
+
* @param WP_Query $wp_query
|
43 |
+
*/
|
44 |
+
public function pre_get_posts( $wp_query ) {
|
45 |
+
if ( $wp_query->is_main_query() ) {
|
46 |
+
$post_type = $wp_query->get( 'post_type' );
|
47 |
+
$args = apply_filters( 'mwform_get_inquiry_data_args-' . $post_type, array() );
|
48 |
+
if ( !empty( $args ) && is_array( $args ) ) {
|
49 |
+
foreach ( $args as $key => $value ) {
|
50 |
+
$wp_query->set( $key, $value );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
}
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* admin_enqueue_scripts
|
58 |
+
*/
|
59 |
+
public function admin_enqueue_scripts() {
|
60 |
+
$url = plugins_url( MWF_Config::NAME );
|
61 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-data-list', $url . '/css/admin-data-list.css' );
|
62 |
+
wp_enqueue_script( MWF_Config::NAME . '-admin-data-list', $url . '/js/admin-data-list.js' );
|
63 |
}
|
64 |
|
65 |
/**
|
67 |
* DB登録データの一覧で新規追加のリンクを消す
|
68 |
*/
|
69 |
public function admin_print_styles() {
|
|
|
|
|
|
|
70 |
$View = new MW_WP_Form_Contact_Data_List_View();
|
71 |
$View->admin_print_styles_for_list();
|
72 |
}
|
76 |
* CSVダウンロードボタンを表示
|
77 |
*/
|
78 |
public function add_csv_download_button() {
|
|
|
|
|
|
|
79 |
$post_type = get_post_type();
|
80 |
if ( true !== apply_filters( 'mwform_csv_button_' . $post_type, true ) ) {
|
81 |
return;
|
112 |
$posts_per_page = $this->get_posts_per_page();
|
113 |
$paged = $this->get_paged();
|
114 |
|
115 |
+
$_args = apply_filters( 'mwform_get_inquiry_data_args-' . $post_type, array() );
|
116 |
+
$args = array(
|
117 |
'post_type' => $post_type,
|
118 |
'posts_per_page' => $posts_per_page,
|
119 |
'paged' => $paged,
|
120 |
'post_status' => 'any',
|
121 |
+
);
|
122 |
+
if ( !empty( $_args ) && is_array( $_args ) ) {
|
123 |
+
$args = array_merge( $_args, $args );
|
124 |
+
}
|
125 |
+
$posts_mwf = get_posts( $args );
|
126 |
|
127 |
// CSVの内容を貯める
|
128 |
$csv = '';
|
272 |
* DB登録使用時に問い合わせデータ一覧にカラムを追加
|
273 |
*/
|
274 |
public function add_columns() {
|
|
|
|
|
|
|
275 |
$post_type = get_post_type();
|
276 |
add_filter(
|
277 |
'manage_' . $post_type . '_posts_columns',
|
329 |
$View->manage_posts_custom_column();
|
330 |
}
|
331 |
|
332 |
+
/**
|
333 |
+
* wp_count_posts
|
334 |
+
* @param object $counts
|
335 |
+
* @param string $type 投稿タイプ名
|
336 |
+
* @return object
|
337 |
+
*/
|
338 |
+
public function wp_count_posts( $counts, $type ) {
|
339 |
+
$args = apply_filters( 'mwform_get_inquiry_data_args-' . $type, array() );
|
340 |
+
if ( !empty( $args ) && is_array( $args ) ) {
|
341 |
+
$args = array_merge( $args, array(
|
342 |
+
'post_type' => $type,
|
343 |
+
'posts_per_page' => 1,
|
344 |
+
) );
|
345 |
+
|
346 |
+
foreach ( $counts as $key => $count ) {
|
347 |
+
$query = new WP_Query( array_merge( $args, array( 'post_status' => $key ) ) );
|
348 |
+
$counts->$key = $query->found_posts;
|
349 |
+
}
|
350 |
+
}
|
351 |
+
return $counts;
|
352 |
+
}
|
353 |
+
|
354 |
/**
|
355 |
* is_contact_data_list
|
356 |
* @return bool
|
classes/controllers/class.contact-data.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data Controller
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : December 31, 2014
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -22,13 +22,50 @@ class MW_WP_Form_Contact_Data_Controller {
|
|
22 |
*/
|
23 |
public function initialize() {
|
24 |
$this->contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts();
|
25 |
-
$
|
26 |
-
add_action( '
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
}
|
33 |
|
34 |
/**
|
@@ -58,12 +95,8 @@ class MW_WP_Form_Contact_Data_Controller {
|
|
58 |
* 本当は css, js のロードだけしたいけど、ここからしか post_id がとれないので渋々…
|
59 |
*/
|
60 |
public function admin_enqueue_scripts() {
|
61 |
-
|
62 |
-
|
63 |
-
}
|
64 |
-
$url = plugin_dir_url( __FILE__ );
|
65 |
-
wp_enqueue_style( MWF_Config::NAME . '-admin', $url . '../../css/admin.css' );
|
66 |
-
wp_enqueue_script( MWF_Config::NAME . '-admin-data', $url . '../../js/admin-data.js' );
|
67 |
}
|
68 |
|
69 |
/**
|
@@ -71,9 +104,6 @@ class MW_WP_Form_Contact_Data_Controller {
|
|
71 |
* 詳細画面で新規追加のリンクを消す
|
72 |
*/
|
73 |
public function admin_print_styles() {
|
74 |
-
if ( !$this->is_contact_data_post_type() ) {
|
75 |
-
return;
|
76 |
-
}
|
77 |
$View = new MW_WP_Form_Contact_Data_View();
|
78 |
$View->admin_print_styles_for_detail();
|
79 |
}
|
@@ -82,9 +112,6 @@ class MW_WP_Form_Contact_Data_Controller {
|
|
82 |
* add_meta_boxes
|
83 |
*/
|
84 |
public function add_meta_boxes() {
|
85 |
-
if ( !$this->is_contact_data_post_type() ) {
|
86 |
-
return;
|
87 |
-
}
|
88 |
$post_type = get_post_type();
|
89 |
$View = new MW_WP_Form_Contact_Data_View();
|
90 |
$View->set( 'post_type', $post_type );
|
@@ -103,25 +130,10 @@ class MW_WP_Form_Contact_Data_Controller {
|
|
103 |
* @param object $post
|
104 |
*/
|
105 |
public function edit_form_top( $post ) {
|
106 |
-
if ( !$this->is_contact_data_post_type() ) {
|
107 |
-
return;
|
108 |
-
}
|
109 |
$post_type = get_post_type();
|
110 |
$link = admin_url( '/edit.php?post_type=' . $post_type );
|
111 |
$View = new MW_WP_Form_Contact_Data_View();
|
112 |
$View->set( 'link', $link );
|
113 |
$View->returning_link();
|
114 |
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* is_contact_data_post_type
|
118 |
-
*/
|
119 |
-
protected function is_contact_data_post_type() {
|
120 |
-
$post_type = get_post_type();
|
121 |
-
if ( is_array( $this->contact_data_post_types ) &&
|
122 |
-
in_array( $post_type, $this->contact_data_post_types ) ) {
|
123 |
-
return true;
|
124 |
-
}
|
125 |
-
return false;
|
126 |
-
}
|
127 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data Controller
|
4 |
+
* Version : 1.0.3
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : December 31, 2014
|
8 |
+
* Modified : February 14, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
22 |
*/
|
23 |
public function initialize() {
|
24 |
$this->contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts();
|
25 |
+
add_action( 'admin_menu', array( $this, 'admin_menu' ) );
|
26 |
+
add_action( 'current_screen', array( $this, 'current_screen' ) );
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* current_screen
|
31 |
+
* @param WP_Screen $screen
|
32 |
+
*/
|
33 |
+
public function current_screen( $screen ) {
|
34 |
+
if ( $screen->id === MWF_Config::NAME . '_page_' . MWF_Config::NAME . '-save-data' ||
|
35 |
+
preg_match( '/^' . MWF_Config::DBDATA . '\d+$/', $screen->id ) ) {
|
36 |
+
|
37 |
+
$contact_data_post_types = MW_WP_Form_Contact_Data_Setting::get_posts();
|
38 |
+
// 一覧画面・詳細ページの制限
|
39 |
+
if ( $screen->base ==='post' &&
|
40 |
+
!in_array( $screen->post_type, $contact_data_post_types ) ) {
|
41 |
+
exit;
|
42 |
+
}
|
43 |
+
// 詳細ページの制限
|
44 |
+
if ( $screen->base ==='post' &&
|
45 |
+
in_array( $screen->id, $contact_data_post_types ) ) {
|
46 |
+
$_args = apply_filters( 'mwform_get_inquiry_data_args-' . $screen->post_type, array() );
|
47 |
+
if ( !empty( $_args ) && is_array( $_args ) ) {
|
48 |
+
$args = array(
|
49 |
+
'post_type' => $screen->post_type,
|
50 |
+
'post_status' => 'publish',
|
51 |
+
'posts_per_page' => 1,
|
52 |
+
'p' => $_GET['post'],
|
53 |
+
);
|
54 |
+
$args = array_merge( $_args, $args );
|
55 |
+
$permit_posts = get_posts( $args );
|
56 |
+
if ( empty( $permit_posts ) ) {
|
57 |
+
exit;
|
58 |
+
}
|
59 |
+
}
|
60 |
+
}
|
61 |
+
|
62 |
+
$Contact_Data = new MW_WP_Form_Contact_Data();
|
63 |
+
add_action( 'add_meta_boxes' , array( $this, 'add_meta_boxes' ) );
|
64 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
65 |
+
add_action( 'admin_print_styles' , array( $this, 'admin_print_styles' ) );
|
66 |
+
add_action( 'edit_form_top' , array( $this, 'edit_form_top' ) );
|
67 |
+
add_action( 'save_post' , array( $Contact_Data, 'save_post' ) );
|
68 |
+
}
|
69 |
}
|
70 |
|
71 |
/**
|
95 |
* 本当は css, js のロードだけしたいけど、ここからしか post_id がとれないので渋々…
|
96 |
*/
|
97 |
public function admin_enqueue_scripts() {
|
98 |
+
$url = plugins_url( MWF_Config::NAME );
|
99 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-data', $url . '/css/admin-data.css' );
|
|
|
|
|
|
|
|
|
100 |
}
|
101 |
|
102 |
/**
|
104 |
* 詳細画面で新規追加のリンクを消す
|
105 |
*/
|
106 |
public function admin_print_styles() {
|
|
|
|
|
|
|
107 |
$View = new MW_WP_Form_Contact_Data_View();
|
108 |
$View->admin_print_styles_for_detail();
|
109 |
}
|
112 |
* add_meta_boxes
|
113 |
*/
|
114 |
public function add_meta_boxes() {
|
|
|
|
|
|
|
115 |
$post_type = get_post_type();
|
116 |
$View = new MW_WP_Form_Contact_Data_View();
|
117 |
$View->set( 'post_type', $post_type );
|
130 |
* @param object $post
|
131 |
*/
|
132 |
public function edit_form_top( $post ) {
|
|
|
|
|
|
|
133 |
$post_type = get_post_type();
|
134 |
$link = admin_url( '/edit.php?post_type=' . $post_type );
|
135 |
$View = new MW_WP_Form_Contact_Data_View();
|
136 |
$View->set( 'link', $link );
|
137 |
$View->returning_link();
|
138 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
}
|
classes/controllers/class.main.php
CHANGED
@@ -247,26 +247,7 @@ class MW_WP_Form_Main_Controller {
|
|
247 |
|
248 |
// 管理画面で作成した場合だけ自動で送信
|
249 |
if ( $this->ExecShortcode->is_generated_by_formkey() ) {
|
250 |
-
$
|
251 |
-
|
252 |
-
// save_mail_body で登録されないように
|
253 |
-
foreach ( $attachments as $key => $attachment ) {
|
254 |
-
$this->Data->clear_value( $key );
|
255 |
-
}
|
256 |
-
|
257 |
-
// メール送信前にファイルのリネームをしないと、tempファイル名をメールで送信してしまう。
|
258 |
-
if ( $this->Setting->get( 'usedb' ) ) {
|
259 |
-
$Mail_Service->save_contact_data( $Mail_admin_raw, $attachments );
|
260 |
-
}
|
261 |
-
|
262 |
-
$Mail_admin = $Mail_Service->get_Mail_admin();
|
263 |
-
$Mail_admin->send();
|
264 |
-
|
265 |
-
// DB非保存時は管理者メール送信後、ファイルを削除
|
266 |
-
if ( !$this->Setting->get( 'usedb' ) ) {
|
267 |
-
$File = new MW_WP_Form_File();
|
268 |
-
$File->delete_files( $attachments );
|
269 |
-
}
|
270 |
|
271 |
// 自動返信メールの送信
|
272 |
$automatic_reply_email = $this->Setting->get( 'automatic_reply_email' );
|
@@ -276,8 +257,7 @@ class MW_WP_Form_Main_Controller {
|
|
276 |
$automatic_reply_email
|
277 |
);
|
278 |
if ( $automatic_reply_email && !$is_invalid_mail_address ) {
|
279 |
-
$
|
280 |
-
$Mail_auto->send();
|
281 |
}
|
282 |
}
|
283 |
|
247 |
|
248 |
// 管理画面で作成した場合だけ自動で送信
|
249 |
if ( $this->ExecShortcode->is_generated_by_formkey() ) {
|
250 |
+
$Mail_Service->send_admin_mail();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
251 |
|
252 |
// 自動返信メールの送信
|
253 |
$automatic_reply_email = $this->Setting->get( 'automatic_reply_email' );
|
257 |
$automatic_reply_email
|
258 |
);
|
259 |
if ( $automatic_reply_email && !$is_invalid_mail_address ) {
|
260 |
+
$Mail_Service->send_reply_mail();
|
|
|
261 |
}
|
262 |
}
|
263 |
|
classes/form-fields/class.checkbox.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Field Checkbox
|
4 |
* Description: チェックボックスを出力
|
5 |
-
* Version : 1.5.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
-
* Modified : February
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -43,6 +43,7 @@ class MW_WP_Form_Field_Checkbox extends MW_WP_Form_Abstract_Form_Field {
|
|
43 |
'children' => '',
|
44 |
'value' => '',
|
45 |
'vertically' => '',
|
|
|
46 |
'show_error' => 'true',
|
47 |
'separator' => ', ',
|
48 |
);
|
@@ -62,7 +63,9 @@ class MW_WP_Form_Field_Checkbox extends MW_WP_Form_Abstract_Form_Field {
|
|
62 |
'value' => $value,
|
63 |
'vertically' => $this->atts['vertically'],
|
64 |
), $separator );
|
65 |
-
|
|
|
|
|
66 |
if ( $this->atts['show_error'] !== 'false' ) {
|
67 |
$_ret .= $this->get_error( $this->atts['name'] );
|
68 |
}
|
@@ -80,8 +83,10 @@ class MW_WP_Form_Field_Checkbox extends MW_WP_Form_Abstract_Form_Field {
|
|
80 |
$posted_value = $this->Form->get_separated_raw_value( $this->atts['name'], $children );
|
81 |
$_ret = esc_html( $value );
|
82 |
$_ret .= $this->Form->hidden( $this->atts['name'] . '[data]', $posted_value );
|
83 |
-
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
84 |
$_ret .= $this->Form->separator( $this->atts['name'] );
|
|
|
|
|
|
|
85 |
return $_ret;
|
86 |
}
|
87 |
|
@@ -112,6 +117,12 @@ class MW_WP_Form_Field_Checkbox extends MW_WP_Form_Abstract_Form_Field {
|
|
112 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
113 |
</span>
|
114 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
<p>
|
116 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
117 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
2 |
/**
|
3 |
* Name : MW WP Form Field Checkbox
|
4 |
* Description: チェックボックスを出力
|
5 |
+
* Version : 1.5.5
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified : February 12, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
43 |
'children' => '',
|
44 |
'value' => '',
|
45 |
'vertically' => '',
|
46 |
+
'post_raw' => 'true',
|
47 |
'show_error' => 'true',
|
48 |
'separator' => ', ',
|
49 |
);
|
63 |
'value' => $value,
|
64 |
'vertically' => $this->atts['vertically'],
|
65 |
), $separator );
|
66 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
67 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
68 |
+
}
|
69 |
if ( $this->atts['show_error'] !== 'false' ) {
|
70 |
$_ret .= $this->get_error( $this->atts['name'] );
|
71 |
}
|
83 |
$posted_value = $this->Form->get_separated_raw_value( $this->atts['name'], $children );
|
84 |
$_ret = esc_html( $value );
|
85 |
$_ret .= $this->Form->hidden( $this->atts['name'] . '[data]', $posted_value );
|
|
|
86 |
$_ret .= $this->Form->separator( $this->atts['name'] );
|
87 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
88 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
89 |
+
}
|
90 |
return $_ret;
|
91 |
}
|
92 |
|
117 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
118 |
</span>
|
119 |
</p>
|
120 |
+
<p>
|
121 |
+
<strong><?php esc_html_e( 'Send value by e-mail', MWF_Config::DOMAIN ); ?></strong>
|
122 |
+
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
123 |
+
<?php $post_raw = $this->get_value_for_generator( 'post_raw', $options ); ?>
|
124 |
+
<label><input type="checkbox" name="post_raw" value="false" <?php checked( 'false', $post_raw ); ?> /> <?php esc_html_e( 'Send post value when you split the post value and display value by ":" in choices.', MWF_Config::DOMAIN ); ?></label>
|
125 |
+
</p>
|
126 |
<p>
|
127 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
128 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
classes/form-fields/class.radio.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Field Radio
|
4 |
* Description: ラジオボタンを出力
|
5 |
-
* Version : 1.5.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
-
* Modified : February
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -43,6 +43,7 @@ class MW_WP_Form_Field_Radio extends MW_WP_Form_Abstract_Form_Field {
|
|
43 |
'children' => '',
|
44 |
'value' => '',
|
45 |
'vertically' => '',
|
|
|
46 |
'show_error' => 'true',
|
47 |
);
|
48 |
}
|
@@ -59,7 +60,9 @@ class MW_WP_Form_Field_Radio extends MW_WP_Form_Abstract_Form_Field {
|
|
59 |
'value' => $this->atts['value'],
|
60 |
'vertically' => $this->atts['vertically'],
|
61 |
) );
|
62 |
-
|
|
|
|
|
63 |
if ( $this->atts['show_error'] !== 'false' ) {
|
64 |
$_ret .= $this->get_error( $this->atts['name'] );
|
65 |
}
|
@@ -77,7 +80,9 @@ class MW_WP_Form_Field_Radio extends MW_WP_Form_Abstract_Form_Field {
|
|
77 |
$posted_value = $this->Form->get_raw( $this->atts['name'] );
|
78 |
$_ret = esc_html( $value );
|
79 |
$_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
|
80 |
-
|
|
|
|
|
81 |
return $_ret;
|
82 |
}
|
83 |
|
@@ -108,6 +113,12 @@ class MW_WP_Form_Field_Radio extends MW_WP_Form_Abstract_Form_Field {
|
|
108 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
109 |
</span>
|
110 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
<p>
|
112 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
113 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
2 |
/**
|
3 |
* Name : MW WP Form Field Radio
|
4 |
* Description: ラジオボタンを出力
|
5 |
+
* Version : 1.5.4
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified : February 12, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
43 |
'children' => '',
|
44 |
'value' => '',
|
45 |
'vertically' => '',
|
46 |
+
'post_raw' => 'true',
|
47 |
'show_error' => 'true',
|
48 |
);
|
49 |
}
|
60 |
'value' => $this->atts['value'],
|
61 |
'vertically' => $this->atts['vertically'],
|
62 |
) );
|
63 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
64 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
65 |
+
}
|
66 |
if ( $this->atts['show_error'] !== 'false' ) {
|
67 |
$_ret .= $this->get_error( $this->atts['name'] );
|
68 |
}
|
80 |
$posted_value = $this->Form->get_raw( $this->atts['name'] );
|
81 |
$_ret = esc_html( $value );
|
82 |
$_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
|
83 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
84 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
85 |
+
}
|
86 |
return $_ret;
|
87 |
}
|
88 |
|
113 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
114 |
</span>
|
115 |
</p>
|
116 |
+
<p>
|
117 |
+
<strong><?php esc_html_e( 'Send value by e-mail', MWF_Config::DOMAIN ); ?></strong>
|
118 |
+
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
119 |
+
<?php $post_raw = $this->get_value_for_generator( 'post_raw', $options ); ?>
|
120 |
+
<label><input type="checkbox" name="post_raw" value="false" <?php checked( 'false', $post_raw ); ?> /> <?php esc_html_e( 'Send post value when you split the post value and display value by ":" in choices.', MWF_Config::DOMAIN ); ?></label>
|
121 |
+
</p>
|
122 |
<p>
|
123 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
124 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
classes/form-fields/class.select.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Field Select
|
4 |
* Description: セレクトボックスを出力
|
5 |
-
* Version : 1.5.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
-
* Modified : February
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -42,6 +42,7 @@ class MW_WP_Form_Field_Select extends MW_WP_Form_Abstract_Form_Field {
|
|
42 |
'id' => '',
|
43 |
'children' => '',
|
44 |
'value' => '',
|
|
|
45 |
'show_error' => 'true',
|
46 |
);
|
47 |
}
|
@@ -57,7 +58,9 @@ class MW_WP_Form_Field_Select extends MW_WP_Form_Abstract_Form_Field {
|
|
57 |
'id' => $this->atts['id'],
|
58 |
'value' => $this->atts['value'],
|
59 |
) );
|
60 |
-
|
|
|
|
|
61 |
if ( $this->atts['show_error'] !== 'false' ) {
|
62 |
$_ret .= $this->get_error( $this->atts['name'] );
|
63 |
}
|
@@ -75,7 +78,9 @@ class MW_WP_Form_Field_Select extends MW_WP_Form_Abstract_Form_Field {
|
|
75 |
$posted_value = $this->Form->get_raw( $this->atts['name'] );
|
76 |
$_ret = esc_html( $value );
|
77 |
$_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
|
78 |
-
|
|
|
|
|
79 |
return $_ret;
|
80 |
}
|
81 |
|
@@ -106,6 +111,12 @@ class MW_WP_Form_Field_Select extends MW_WP_Form_Abstract_Form_Field {
|
|
106 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
107 |
</span>
|
108 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
<p>
|
110 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
111 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
2 |
/**
|
3 |
* Name : MW WP Form Field Select
|
4 |
* Description: セレクトボックスを出力
|
5 |
+
* Version : 1.5.4
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : December 14, 2012
|
9 |
+
* Modified : February 12, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
42 |
'id' => '',
|
43 |
'children' => '',
|
44 |
'value' => '',
|
45 |
+
'post_raw' => 'true',
|
46 |
'show_error' => 'true',
|
47 |
);
|
48 |
}
|
58 |
'id' => $this->atts['id'],
|
59 |
'value' => $this->atts['value'],
|
60 |
) );
|
61 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
62 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
63 |
+
}
|
64 |
if ( $this->atts['show_error'] !== 'false' ) {
|
65 |
$_ret .= $this->get_error( $this->atts['name'] );
|
66 |
}
|
78 |
$posted_value = $this->Form->get_raw( $this->atts['name'] );
|
79 |
$_ret = esc_html( $value );
|
80 |
$_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
|
81 |
+
if ( $this->atts['post_raw'] !== 'false' ) {
|
82 |
+
$_ret .= $this->Form->children( $this->atts['name'], $children );
|
83 |
+
}
|
84 |
return $_ret;
|
85 |
}
|
86 |
|
111 |
<?php esc_html_e( 'When you want to use ":", please enter "::".', MWF_Config::DOMAIN ); ?>
|
112 |
</span>
|
113 |
</p>
|
114 |
+
<p>
|
115 |
+
<strong><?php esc_html_e( 'Send value by e-mail', MWF_Config::DOMAIN ); ?></strong>
|
116 |
+
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
117 |
+
<?php $post_raw = $this->get_value_for_generator( 'post_raw', $options ); ?>
|
118 |
+
<label><input type="checkbox" name="post_raw" value="false" <?php checked( 'false', $post_raw ); ?> /> <?php esc_html_e( 'Send post value when you split the post value and display value by ":" in choices.', MWF_Config::DOMAIN ); ?></label>
|
119 |
+
</p>
|
120 |
<p>
|
121 |
<strong><?php esc_html_e( 'Default value', MWF_Config::DOMAIN ); ?></strong>
|
122 |
<?php $value = $this->get_value_for_generator( 'value', $options ); ?>
|
classes/models/class.admin.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Admin
|
4 |
* Description: 管理画面クラス
|
5 |
-
* Version : 2.0.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : February 21, 2013
|
9 |
-
* Modified :
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -98,4 +98,21 @@ class MW_WP_Form_Admin {
|
|
98 |
) );
|
99 |
return $forms;
|
100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
}
|
2 |
/**
|
3 |
* Name : MW WP Form Admin
|
4 |
* Description: 管理画面クラス
|
5 |
+
* Version : 2.0.1
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : February 21, 2013
|
9 |
+
* Modified : February 7, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
98 |
) );
|
99 |
return $forms;
|
100 |
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* get_forms_using_database
|
104 |
+
* @return array データベースに保存が有効なフォーム(WP_Post)の配列
|
105 |
+
*/
|
106 |
+
public function get_forms_using_database() {
|
107 |
+
$forms_using_database = array();
|
108 |
+
$forms = $this->get_forms();
|
109 |
+
foreach ( $forms as $form ) {
|
110 |
+
$Setting = new MW_WP_Form_Setting( $form->ID );
|
111 |
+
if ( !$Setting->get( 'usedb' ) ) {
|
112 |
+
continue;
|
113 |
+
}
|
114 |
+
$forms_using_database[$form->ID] = $form;
|
115 |
+
}
|
116 |
+
return $forms_using_database;
|
117 |
+
}
|
118 |
}
|
classes/models/class.contact-data-setting.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data Setting
|
4 |
* Description: 管理画面クラス
|
5 |
-
* Version : 1.0.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : January 1, 2015
|
9 |
-
* Modified :
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -184,16 +184,24 @@ class MW_WP_Form_Contact_Data_Setting {
|
|
184 |
public static function get_posts() {
|
185 |
$contact_data_post_types = array();
|
186 |
$Admin = new MW_WP_Form_Admin();
|
187 |
-
$forms = $Admin->
|
188 |
foreach ( $forms as $form ) {
|
189 |
-
$Setting = new MW_WP_Form_Setting( $form->ID );
|
190 |
-
if ( !$Setting->get( 'usedb' ) ) {
|
191 |
-
continue;
|
192 |
-
}
|
193 |
$post_type = MWF_Config::DBDATA . $form->ID;
|
194 |
$contact_data_post_types[] = $post_type;
|
195 |
}
|
196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
}
|
198 |
|
199 |
/**
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data Setting
|
4 |
* Description: 管理画面クラス
|
5 |
+
* Version : 1.0.1
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : January 1, 2015
|
9 |
+
* Modified : February 7, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
184 |
public static function get_posts() {
|
185 |
$contact_data_post_types = array();
|
186 |
$Admin = new MW_WP_Form_Admin();
|
187 |
+
$forms = $Admin->get_forms_using_database();
|
188 |
foreach ( $forms as $form ) {
|
|
|
|
|
|
|
|
|
189 |
$post_type = MWF_Config::DBDATA . $form->ID;
|
190 |
$contact_data_post_types[] = $post_type;
|
191 |
}
|
192 |
+
$raw_post_types = $contact_data_post_types;
|
193 |
+
$new_post_types = array();
|
194 |
+
$contact_data_post_types = apply_filters(
|
195 |
+
'mwform_contact_data_post_types',
|
196 |
+
$contact_data_post_types
|
197 |
+
);
|
198 |
+
// もともとの配列に含まれていない値は削除する
|
199 |
+
foreach ( $contact_data_post_types as $post_type ) {
|
200 |
+
if ( in_array( $post_type, $raw_post_types ) ) {
|
201 |
+
$new_post_types[] = $post_type;
|
202 |
+
}
|
203 |
+
}
|
204 |
+
return $new_post_types;
|
205 |
}
|
206 |
|
207 |
/**
|
classes/models/class.file.php
CHANGED
@@ -13,9 +13,9 @@
|
|
13 |
class MW_WP_Form_File {
|
14 |
|
15 |
/**
|
16 |
-
*
|
17 |
*/
|
18 |
-
public function
|
19 |
add_filter( 'upload_mimes', array( $this, 'upload_mimes' ) );
|
20 |
}
|
21 |
|
@@ -26,7 +26,7 @@ class MW_WP_Form_File {
|
|
26 |
public function upload_mimes( $t ) {
|
27 |
$t['psd'] = 'image/vnd.adobe.photoshop';
|
28 |
$t['eps'] = 'application/octet-stream';
|
29 |
-
$t['ai']
|
30 |
return $t;
|
31 |
}
|
32 |
|
@@ -98,24 +98,26 @@ class MW_WP_Form_File {
|
|
98 |
*/
|
99 |
protected function set_upload_file_name( $extension ) {
|
100 |
$count = 0;
|
101 |
-
$basename =
|
102 |
-
$
|
103 |
-
$temp_dir = $this->get_temp_dir();
|
104 |
$upload_dir = $temp_dir['dir'];
|
105 |
$upload_url = $temp_dir['url'];
|
106 |
if ( !is_writable( $temp_dir['dir'] ) ) {
|
107 |
$wp_upload_dir = wp_upload_dir();
|
108 |
-
$upload_dir
|
109 |
-
$upload_url
|
110 |
}
|
111 |
-
|
112 |
-
$
|
113 |
-
|
|
|
114 |
$count ++;
|
115 |
-
$
|
116 |
-
$
|
117 |
-
$uploadfile['url'] = trailingslashit( $upload_url ) . $filename;
|
118 |
}
|
|
|
|
|
|
|
119 |
return $uploadfile;
|
120 |
}
|
121 |
|
13 |
class MW_WP_Form_File {
|
14 |
|
15 |
/**
|
16 |
+
* __construct
|
17 |
*/
|
18 |
+
public function __construct() {
|
19 |
add_filter( 'upload_mimes', array( $this, 'upload_mimes' ) );
|
20 |
}
|
21 |
|
26 |
public function upload_mimes( $t ) {
|
27 |
$t['psd'] = 'image/vnd.adobe.photoshop';
|
28 |
$t['eps'] = 'application/octet-stream';
|
29 |
+
$t['ai'] = 'application/pdf';
|
30 |
return $t;
|
31 |
}
|
32 |
|
98 |
*/
|
99 |
protected function set_upload_file_name( $extension ) {
|
100 |
$count = 0;
|
101 |
+
$basename = uniqid( rand() );
|
102 |
+
$temp_dir = $this->get_temp_dir();
|
|
|
103 |
$upload_dir = $temp_dir['dir'];
|
104 |
$upload_url = $temp_dir['url'];
|
105 |
if ( !is_writable( $temp_dir['dir'] ) ) {
|
106 |
$wp_upload_dir = wp_upload_dir();
|
107 |
+
$upload_dir = realpath( $wp_upload_dir['path'] );
|
108 |
+
$upload_url = $wp_upload_dir['url'];
|
109 |
}
|
110 |
+
|
111 |
+
$filename_no_exension = $basename;
|
112 |
+
$filepath_no_exension = trailingslashit( $upload_dir ) . $filename_no_exension;
|
113 |
+
while ( glob( $filepath_no_exension . '.*' ) ) {
|
114 |
$count ++;
|
115 |
+
$filename_no_exension = $basename . '-' . $count;
|
116 |
+
$filepath_no_exension = trailingslashit( $upload_dir ) . $filename_no_exension;
|
|
|
117 |
}
|
118 |
+
$filename = $filename_no_exension . '.' . $extension;
|
119 |
+
$uploadfile['file'] = trailingslashit( $upload_dir ) . $filename;
|
120 |
+
$uploadfile['url'] = trailingslashit( $upload_url ) . $filename;
|
121 |
return $uploadfile;
|
122 |
}
|
123 |
|
classes/models/class.mail.php
CHANGED
@@ -84,6 +84,13 @@ class MW_WP_Form_Mail {
|
|
84 |
add_filter( 'wp_mail_from' , array( $this, 'set_mail_from' ) );
|
85 |
add_filter( 'wp_mail_from_name', array( $this, 'set_mail_from_name' ) );
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
$tos = explode( ',', $this->to );
|
88 |
foreach ( $tos as $to ) {
|
89 |
$headers = array();
|
@@ -94,7 +101,20 @@ class MW_WP_Form_Mail {
|
|
94 |
$headers[] = 'Bcc: ' . $this->bcc;
|
95 |
}
|
96 |
$to = trim( $to );
|
97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
}
|
99 |
|
100 |
remove_action( 'phpmailer_init' , array( $this, 'set_return_path' ) );
|
84 |
add_filter( 'wp_mail_from' , array( $this, 'set_mail_from' ) );
|
85 |
add_filter( 'wp_mail_from_name', array( $this, 'set_mail_from_name' ) );
|
86 |
|
87 |
+
if ( defined( 'MWFORM_DEBUG' ) && MWFORM_DEBUG === true ) {
|
88 |
+
$File = new MW_WP_Form_File();
|
89 |
+
$temp_dir = $File->get_temp_dir();
|
90 |
+
$temp_dir = trailingslashit( $temp_dir['dir'] );
|
91 |
+
$temp_dir = apply_filters( 'mwform_log_directory', $temp_dir );
|
92 |
+
}
|
93 |
+
|
94 |
$tos = explode( ',', $this->to );
|
95 |
foreach ( $tos as $to ) {
|
96 |
$headers = array();
|
101 |
$headers[] = 'Bcc: ' . $this->bcc;
|
102 |
}
|
103 |
$to = trim( $to );
|
104 |
+
if ( !empty( $File ) ) {
|
105 |
+
$contents = sprintf(
|
106 |
+
"====================\n\nSend Date: %s\nTo: %s\nSubject: %s\nheaders:%s\n-----\n%s\n-----\nattachments:\n%s\n\n",
|
107 |
+
date( 'M j Y, H:i:s' ),
|
108 |
+
$to,
|
109 |
+
$subject,
|
110 |
+
implode( "\n", $headers ),
|
111 |
+
$body,
|
112 |
+
implode( "\n", $this->attachments )
|
113 |
+
);
|
114 |
+
file_put_contents( $temp_dir . '/mw-wp-form-debug.log', $contents, FILE_APPEND );
|
115 |
+
} else {
|
116 |
+
@wp_mail( $to, $subject, $body, $headers, $this->attachments );
|
117 |
+
}
|
118 |
}
|
119 |
|
120 |
remove_action( 'phpmailer_init' , array( $this, 'set_return_path' ) );
|
classes/models/class.validation.php
CHANGED
@@ -2,11 +2,11 @@
|
|
2 |
/**
|
3 |
* Name : MW WP Form Validation
|
4 |
* Description: 与えられたデータに対してバリデーションエラーがあるかチェックする
|
5 |
-
* Version : 1.8.
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : July 20, 2012
|
9 |
-
* Modified :
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
@@ -148,7 +148,10 @@ class MW_WP_Form_Validation {
|
|
148 |
$rules = $this->validate[$key];
|
149 |
$this->_check( $key, $rules );
|
150 |
}
|
151 |
-
|
|
|
|
|
|
|
152 |
}
|
153 |
|
154 |
/**
|
2 |
/**
|
3 |
* Name : MW WP Form Validation
|
4 |
* Description: 与えられたデータに対してバリデーションエラーがあるかチェックする
|
5 |
+
* Version : 1.8.2
|
6 |
* Author : Takashi Kitajima
|
7 |
* Author URI : http://2inc.org
|
8 |
* Created : July 20, 2012
|
9 |
+
* Modified : February 7, 2015
|
10 |
* License : GPLv2
|
11 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
*/
|
148 |
$rules = $this->validate[$key];
|
149 |
$this->_check( $key, $rules );
|
150 |
}
|
151 |
+
if ( $this->Error->get_error( $key ) ) {
|
152 |
+
return false;
|
153 |
+
}
|
154 |
+
return true;
|
155 |
}
|
156 |
|
157 |
/**
|
classes/services/class.mail.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Mail Service
|
4 |
-
* Version : 1.0
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -36,18 +36,6 @@ class MW_WP_Form_Mail_Service {
|
|
36 |
*/
|
37 |
protected $Mail_auto_raw;
|
38 |
|
39 |
-
/**
|
40 |
-
* $Mail_admin
|
41 |
-
* @var MW_WP_Form_Mail
|
42 |
-
*/
|
43 |
-
protected $Mail_admin;
|
44 |
-
|
45 |
-
/**
|
46 |
-
* $Mail_auto
|
47 |
-
* @var MW_WP_Form_Mail
|
48 |
-
*/
|
49 |
-
protected $Mail_auto;
|
50 |
-
|
51 |
/**
|
52 |
* $Data
|
53 |
* @var MW_WP_Form_Data
|
@@ -102,59 +90,163 @@ class MW_WP_Form_Mail_Service {
|
|
102 |
$this->set_admin_mail_raw_params();
|
103 |
$this->set_attachments( $this->Mail_admin_raw );
|
104 |
$this->Mail_admin_raw = $this->apply_filters_mwform_admin_mail_raw( $this->Mail_admin_raw );
|
105 |
-
$this->Mail_admin = $this->parse_mail_object( $this->Mail_admin_raw );
|
106 |
-
$this->Mail_admin = $this->set_admin_mail_reaquire_params( $this->Mail_admin );
|
107 |
-
$this->Mail_admin = $this->apply_filters_mwform_mail( $this->Mail_admin );
|
108 |
-
$this->Mail_admin = $this->apply_filters_mwform_admin_mail( $this->Mail_admin );
|
109 |
|
110 |
$this->set_reply_mail_raw_params();
|
111 |
$this->Mail_auto_raw = $this->apply_filters_mwform_auto_mail_raw( $this->Mail_auto_raw );
|
112 |
-
$this->Mail_auto = $this->parse_mail_object( $this->Mail_auto_raw );
|
113 |
-
$this->Mail_auto = $this->set_reply_mail_reaquire_params( $this->Mail_auto );
|
114 |
-
$this->Mail_auto = $this->apply_filters_mwform_auto_mail( $this->Mail_auto );
|
115 |
} else {
|
116 |
$Mail = $this->apply_filters_mwform_mail( $Mail );
|
117 |
}
|
118 |
}
|
119 |
|
120 |
/**
|
121 |
-
*
|
122 |
-
*
|
123 |
*/
|
124 |
-
public function
|
125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
}
|
127 |
|
128 |
/**
|
129 |
-
*
|
|
|
|
|
|
|
130 |
* @return MW_WP_Form_Mail
|
131 |
*/
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
}
|
135 |
|
136 |
/**
|
137 |
-
*
|
138 |
-
* @
|
|
|
|
|
139 |
*/
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
}
|
143 |
|
144 |
/**
|
145 |
-
*
|
146 |
-
*
|
|
|
|
|
|
|
147 |
*/
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
|
152 |
/**
|
153 |
-
*
|
154 |
-
*
|
|
|
|
|
|
|
|
|
155 |
*/
|
156 |
-
|
157 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
/**
|
@@ -376,107 +468,4 @@ class MW_WP_Form_Mail_Service {
|
|
376 |
clone $this->Data
|
377 |
);
|
378 |
}
|
379 |
-
|
380 |
-
/**
|
381 |
-
* parse_mail_object
|
382 |
-
* @param MW_WP_Form_Mail $_Mail
|
383 |
-
* @return MW_WP_Form_Mail $Mail
|
384 |
-
*/
|
385 |
-
protected function parse_mail_object( MW_WP_Form_Mail $_Mail ) {
|
386 |
-
$Mail = clone $_Mail;
|
387 |
-
$parsed_Mail_vars = get_object_vars( $Mail );
|
388 |
-
foreach ( $parsed_Mail_vars as $key => $value ) {
|
389 |
-
if ( is_array( $value ) || $key == 'to' || $key == 'cc' || $key == 'bcc' ) {
|
390 |
-
continue;
|
391 |
-
}
|
392 |
-
$value = $this->parse_mail_content( $value );
|
393 |
-
$Mail->$key = $value;
|
394 |
-
}
|
395 |
-
return $Mail;
|
396 |
-
}
|
397 |
-
|
398 |
-
/**
|
399 |
-
* parse_mail_content
|
400 |
-
* メール本文用に {name属性} を置換
|
401 |
-
* @param string $value
|
402 |
-
* @return string
|
403 |
-
*/
|
404 |
-
protected function parse_mail_content( $value ) {
|
405 |
-
return preg_replace_callback(
|
406 |
-
'/{(.+?)}/',
|
407 |
-
array( $this, '_parse_mail_content' ),
|
408 |
-
$value
|
409 |
-
);
|
410 |
-
}
|
411 |
-
protected function _parse_mail_content( $matches ) {
|
412 |
-
return $this->parse_mail_body( $matches, false );
|
413 |
-
}
|
414 |
-
|
415 |
-
/**
|
416 |
-
* save_mail_body
|
417 |
-
* DB保存用に {name属性} を置換、保存
|
418 |
-
*/
|
419 |
-
protected function save_mail_body( $value ) {
|
420 |
-
return preg_replace_callback(
|
421 |
-
'/{(.+?)}/',
|
422 |
-
array( $this, '_save_mail_body' ),
|
423 |
-
$value
|
424 |
-
);
|
425 |
-
}
|
426 |
-
protected function _save_mail_body( $matches ) {
|
427 |
-
return $this->parse_mail_body( $matches, true );
|
428 |
-
}
|
429 |
-
|
430 |
-
/**
|
431 |
-
* save_contact_data
|
432 |
-
* @param int $form_id
|
433 |
-
* @param MW_WP_Form_Mail $Mail
|
434 |
-
* @param array $files 保存するファイルパスの配列
|
435 |
-
*/
|
436 |
-
public function save_contact_data( MW_WP_Form_Mail $Mail, array $files = array() ) {
|
437 |
-
$form_id = $this->Setting->get( 'post_id' );
|
438 |
-
$insert_contact_data_id = wp_insert_post( array(
|
439 |
-
'post_title' => $this->parse_mail_content( $Mail->subject ),
|
440 |
-
'post_status' => 'publish',
|
441 |
-
'post_type' => MWF_Config::DBDATA . $form_id,
|
442 |
-
) );
|
443 |
-
$this->insert_contact_data_id = $insert_contact_data_id;
|
444 |
-
|
445 |
-
// メタデータを保存
|
446 |
-
$this->save_mail_body( $Mail->body );
|
447 |
-
|
448 |
-
// 添付ファイルをメディアに保存
|
449 |
-
if ( !empty( $insert_contact_data_id ) ) {
|
450 |
-
MWF_Functions::save_attachments_in_media(
|
451 |
-
$insert_contact_data_id,
|
452 |
-
$files,
|
453 |
-
$form_id
|
454 |
-
);
|
455 |
-
}
|
456 |
-
}
|
457 |
-
|
458 |
-
/**
|
459 |
-
* parse_mail_body
|
460 |
-
* $this->create_mail_body(), $this->save_mail_body の本体
|
461 |
-
* 第2引数でDB保存するか判定
|
462 |
-
* @param array $matches
|
463 |
-
* @param bool $doUpdate
|
464 |
-
* @return string $value
|
465 |
-
*/
|
466 |
-
protected function parse_mail_body( $matches, $doUpdate = false ) {
|
467 |
-
$match = $matches[1];
|
468 |
-
// MWF_Config::TRACKINGNUMBER のときはお問い合せ番号を参照する
|
469 |
-
if ( $match === MWF_Config::TRACKINGNUMBER ) {
|
470 |
-
$form_id = $this->Setting->get( 'post_id' );
|
471 |
-
if ( $form_id ) {
|
472 |
-
$value = $this->Setting->get_tracking_number( $form_id );
|
473 |
-
}
|
474 |
-
} else {
|
475 |
-
$value = $this->Data->get( $match );
|
476 |
-
}
|
477 |
-
if ( $value !== null && $doUpdate ) {
|
478 |
-
update_post_meta( $this->insert_contact_data_id, $match, $value );
|
479 |
-
}
|
480 |
-
return $value;
|
481 |
-
}
|
482 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Mail Service
|
4 |
+
* Version : 1.1.0
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 1, 2015
|
8 |
+
* Modified : February 13, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
36 |
*/
|
37 |
protected $Mail_auto_raw;
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
/**
|
40 |
* $Data
|
41 |
* @var MW_WP_Form_Data
|
90 |
$this->set_admin_mail_raw_params();
|
91 |
$this->set_attachments( $this->Mail_admin_raw );
|
92 |
$this->Mail_admin_raw = $this->apply_filters_mwform_admin_mail_raw( $this->Mail_admin_raw );
|
|
|
|
|
|
|
|
|
93 |
|
94 |
$this->set_reply_mail_raw_params();
|
95 |
$this->Mail_auto_raw = $this->apply_filters_mwform_auto_mail_raw( $this->Mail_auto_raw );
|
|
|
|
|
|
|
96 |
} else {
|
97 |
$Mail = $this->apply_filters_mwform_mail( $Mail );
|
98 |
}
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
+
* send_admin_mail
|
103 |
+
* 管理者メールの送信とデータベースへの保存
|
104 |
*/
|
105 |
+
public function send_admin_mail() {
|
106 |
+
// save_mail_body でファイルURLではなくファイルのIDが保存されるように
|
107 |
+
foreach ( $this->attachments as $key => $attachment ) {
|
108 |
+
$this->Data->clear_value( $key );
|
109 |
+
}
|
110 |
+
|
111 |
+
if ( $this->Setting->get( 'usedb' ) ) {
|
112 |
+
$parsed_mail_object = $this->get_parsed_mail_object( $this->Mail_admin_raw, true );
|
113 |
+
} else {
|
114 |
+
$parsed_mail_object = $this->get_parsed_mail_object( $this->Mail_admin_raw );
|
115 |
+
}
|
116 |
+
|
117 |
+
$Mail_admin = $this->set_admin_mail_reaquire_params( $parsed_mail_object );
|
118 |
+
$Mail_admin = $this->apply_filters_mwform_mail( $Mail_admin );
|
119 |
+
$Mail_admin = $this->apply_filters_mwform_admin_mail( $Mail_admin );
|
120 |
+
$Mail_admin->send();
|
121 |
+
|
122 |
+
// DB非保存時は管理者メール送信後、ファイルを削除
|
123 |
+
if ( !$this->Setting->get( 'usedb' ) ) {
|
124 |
+
$File = new MW_WP_Form_File();
|
125 |
+
$File->delete_files( $this->attachments );
|
126 |
+
}
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
+
* get_parsed_mail_object
|
131 |
+
* パースしたMailオブジェクトの取得とデータベースへの保存
|
132 |
+
* @param MW_WP_Form_Mail $_Mail
|
133 |
+
* @param bool $do_update
|
134 |
* @return MW_WP_Form_Mail
|
135 |
*/
|
136 |
+
protected function get_parsed_mail_object( MW_WP_Form_Mail $_Mail, $do_update = false ) {
|
137 |
+
$Mail = clone $_Mail;
|
138 |
+
if ( $do_update ) {
|
139 |
+
$form_id = $this->Setting->get( 'post_id' );
|
140 |
+
$insert_contact_data_id = wp_insert_post( array(
|
141 |
+
'post_title' => $this->parse_mail_content( $Mail->subject ),
|
142 |
+
'post_status' => 'publish',
|
143 |
+
'post_type' => MWF_Config::DBDATA . $form_id,
|
144 |
+
) );
|
145 |
+
|
146 |
+
// 添付ファイルをメディアに保存
|
147 |
+
// save_mail_body 内のフックで添付ファイルの情報を使えるように、
|
148 |
+
// save_mail_body より前にこのブロックを実行する
|
149 |
+
if ( !empty( $insert_contact_data_id ) ) {
|
150 |
+
MWF_Functions::save_attachments_in_media(
|
151 |
+
$insert_contact_data_id,
|
152 |
+
$this->attachments,
|
153 |
+
$form_id
|
154 |
+
);
|
155 |
+
}
|
156 |
+
$this->insert_contact_data_id = $insert_contact_data_id;
|
157 |
+
}
|
158 |
+
return $this->parse_mail_object( $Mail, $do_update );
|
159 |
}
|
160 |
|
161 |
/**
|
162 |
+
* parse_mail_object
|
163 |
+
* @param MW_WP_Form_Mail $_Mail
|
164 |
+
* @param bool $do_update
|
165 |
+
* @return MW_WP_Form_Mail $Mail
|
166 |
*/
|
167 |
+
protected function parse_mail_object( MW_WP_Form_Mail $_Mail, $do_update = false ) {
|
168 |
+
$Mail = clone $_Mail;
|
169 |
+
$parsed_Mail_vars = get_object_vars( $Mail );
|
170 |
+
foreach ( $parsed_Mail_vars as $key => $value ) {
|
171 |
+
if ( is_array( $value ) || $key == 'to' || $key == 'cc' || $key == 'bcc' ) {
|
172 |
+
continue;
|
173 |
+
}
|
174 |
+
if ( $key == 'body' && $do_update ) {
|
175 |
+
$value = $this->parse_mail_content( $value, true );
|
176 |
+
} else {
|
177 |
+
$value = $this->parse_mail_content( $value );
|
178 |
+
}
|
179 |
+
$Mail->$key = $value;
|
180 |
+
}
|
181 |
+
return $Mail;
|
182 |
}
|
183 |
|
184 |
/**
|
185 |
+
* parse_mail_content
|
186 |
+
* メール本文用に {name属性} を置換
|
187 |
+
* @param string $value
|
188 |
+
* @param bool $do_update
|
189 |
+
* @return string
|
190 |
*/
|
191 |
+
protected function parse_mail_content( $value, $do_update = false ) {
|
192 |
+
if ( $do_update ) {
|
193 |
+
$callback = '_save_mail_content';
|
194 |
+
} else {
|
195 |
+
$callback = '_parse_mail_content';
|
196 |
+
}
|
197 |
+
return preg_replace_callback(
|
198 |
+
'/{(.+?)}/',
|
199 |
+
array( $this, $callback ),
|
200 |
+
$value
|
201 |
+
);
|
202 |
+
}
|
203 |
+
protected function _parse_mail_content( $matches ) {
|
204 |
+
return $this->parse( $matches, false );
|
205 |
+
}
|
206 |
+
protected function _save_mail_content( $matches ) {
|
207 |
+
return $this->parse( $matches, true );
|
208 |
}
|
209 |
|
210 |
/**
|
211 |
+
* parse
|
212 |
+
* $this->_parse_mail_content(), $this->_save_mail_content の本体
|
213 |
+
* 第2引数でDB保存するか判定
|
214 |
+
* @param array $matches
|
215 |
+
* @param bool $do_update
|
216 |
+
* @return string $value
|
217 |
*/
|
218 |
+
protected function parse( $matches, $do_update = false ) {
|
219 |
+
$match = $matches[1];
|
220 |
+
// MWF_Config::TRACKINGNUMBER のときはお問い合せ番号を参照する
|
221 |
+
if ( $match === MWF_Config::TRACKINGNUMBER ) {
|
222 |
+
$form_id = $this->Setting->get( 'post_id' );
|
223 |
+
if ( $form_id ) {
|
224 |
+
$value = $this->Setting->get_tracking_number( $form_id );
|
225 |
+
}
|
226 |
+
} else {
|
227 |
+
$value = $this->Data->get( $match );
|
228 |
+
$value = apply_filters(
|
229 |
+
'mwform_custom_mail_tag_' . $this->form_key,
|
230 |
+
$value,
|
231 |
+
$match,
|
232 |
+
$this->insert_contact_data_id
|
233 |
+
);
|
234 |
+
}
|
235 |
+
if ( $value !== null && $do_update ) {
|
236 |
+
update_post_meta( $this->insert_contact_data_id, $match, $value );
|
237 |
+
}
|
238 |
+
return $value;
|
239 |
+
}
|
240 |
+
|
241 |
+
/**
|
242 |
+
* send_reply_mail
|
243 |
+
* 自動返信メールの送信
|
244 |
+
*/
|
245 |
+
public function send_reply_mail() {
|
246 |
+
$Mail_auto = $this->parse_mail_object( $this->Mail_auto_raw );
|
247 |
+
$Mail_auto = $this->set_reply_mail_reaquire_params( $Mail_auto );
|
248 |
+
$Mail_auto = $this->apply_filters_mwform_auto_mail( $Mail_auto );
|
249 |
+
$Mail_auto->send();
|
250 |
}
|
251 |
|
252 |
/**
|
468 |
clone $this->Data
|
469 |
);
|
470 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
}
|
classes/views/class.admin-list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin List View
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -21,4 +21,15 @@ class MW_WP_Form_Admin_List_View extends MW_WP_Form_View {
|
|
21 |
$post_id
|
22 |
);
|
23 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin List View
|
4 |
+
* Version : 1.0.1
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
+
* Modified : February 8, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
21 |
$post_id
|
22 |
);
|
23 |
}
|
24 |
+
|
25 |
+
/**
|
26 |
+
* donate_link
|
27 |
+
* @param array $views
|
28 |
+
* @return array
|
29 |
+
*/
|
30 |
+
public function donate_link( $views ) {
|
31 |
+
$donation = array( 'donation' => '<div class="donation"><p>' . __( 'Your contribution is needed for making this plugin better.', MWF_Config::DOMAIN ) . ' <a href="http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40" class="button">' . __( 'Donate', MWF_Config::DOMAIN ) . '</a></p></div>' );
|
32 |
+
$views = array_merge( $donation, $views );
|
33 |
+
return $views;
|
34 |
+
}
|
35 |
}
|
classes/views/class.admin.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin View
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -307,17 +307,6 @@ class MW_WP_Form_Admin_View extends MW_WP_Form_View {
|
|
307 |
<?php
|
308 |
}
|
309 |
|
310 |
-
/**
|
311 |
-
* donate_link
|
312 |
-
* @param array $views
|
313 |
-
* @return array
|
314 |
-
*/
|
315 |
-
public function donate_link( $views ) {
|
316 |
-
$donation = array( 'donation' => '<div class="donation"><p>' . __( 'Your contribution is needed for making this plugin better.', MWF_Config::DOMAIN ) . ' <a href="http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40" class="button">' . __( 'Donate', MWF_Config::DOMAIN ) . '</a></p></div>' );
|
317 |
-
$views = array_merge( $donation, $views );
|
318 |
-
return $views;
|
319 |
-
}
|
320 |
-
|
321 |
/**
|
322 |
* tag_generator
|
323 |
* タグジェネレータを出力
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Admin View
|
4 |
+
* Version : 1.0.2
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
+
* Modified : February 8, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
307 |
<?php
|
308 |
}
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
/**
|
311 |
* tag_generator
|
312 |
* タグジェネレータを出力
|
classes/views/class.chart.php
CHANGED
@@ -1,43 +1,35 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Chart View
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
12 |
class MW_WP_Form_Chart_View extends MW_WP_Form_View {
|
13 |
|
14 |
-
/**
|
15 |
-
* admin_print_styles
|
16 |
-
*/
|
17 |
-
public function admin_print_styles() {
|
18 |
-
?>
|
19 |
-
<style>
|
20 |
-
#menu-posts-mw-wp-form .wp-submenu li a[href$="-chart"] {
|
21 |
-
display: none;
|
22 |
-
}
|
23 |
-
</style>
|
24 |
-
<?php
|
25 |
-
}
|
26 |
-
|
27 |
/**
|
28 |
* index
|
29 |
*/
|
30 |
public function index() {
|
31 |
-
if ( !$this->get( 'is_chart' ) ) {
|
32 |
-
return;
|
33 |
-
}
|
34 |
-
|
35 |
$post_type = $this->get( 'post_type' );
|
36 |
$option_group = $this->get( 'option_group' );
|
37 |
-
$
|
38 |
-
'post_type' => $post_type,
|
39 |
'posts_per_page' => -1,
|
40 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
$custom_keys = array();
|
43 |
foreach ( $form_posts as $post ) {
|
@@ -181,7 +173,7 @@ class MW_WP_Form_Chart_View extends MW_WP_Form_View {
|
|
181 |
$value = $raw_data_value;
|
182 |
}
|
183 |
$data[] = array(
|
184 |
-
$raw_data_key,
|
185 |
$value,
|
186 |
);
|
187 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Chart View
|
4 |
+
* Version : 1.0.3
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
+
* Modified : February 14, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
12 |
class MW_WP_Form_Chart_View extends MW_WP_Form_View {
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
/**
|
15 |
* index
|
16 |
*/
|
17 |
public function index() {
|
|
|
|
|
|
|
|
|
18 |
$post_type = $this->get( 'post_type' );
|
19 |
$option_group = $this->get( 'option_group' );
|
20 |
+
$default_args = array(
|
|
|
21 |
'posts_per_page' => -1,
|
22 |
+
);
|
23 |
+
$_args = apply_filters( 'mwform_get_inquiry_data_args-' . $post_type, $default_args );
|
24 |
+
$args = array(
|
25 |
+
'post_type' => $post_type,
|
26 |
+
);
|
27 |
+
if ( !empty( $_args ) && is_array( $_args ) ) {
|
28 |
+
$args = array_merge( $_args, $args );
|
29 |
+
} else {
|
30 |
+
$args = array_merge( $_args, $default_args );
|
31 |
+
}
|
32 |
+
$form_posts = get_posts( $args );
|
33 |
|
34 |
$custom_keys = array();
|
35 |
foreach ( $form_posts as $post ) {
|
173 |
$value = $raw_data_value;
|
174 |
}
|
175 |
$data[] = array(
|
176 |
+
( string ) $raw_data_key,
|
177 |
$value,
|
178 |
);
|
179 |
}
|
classes/views/class.contact-data-list.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data List View
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -99,5 +99,9 @@ class MW_WP_Form_Contact_Data_List_View extends MW_WP_Form_View {
|
|
99 |
);
|
100 |
}
|
101 |
}
|
|
|
|
|
|
|
|
|
102 |
}
|
103 |
}
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data List View
|
4 |
+
* Version : 1.0.1
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
+
* Modified : February 13, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
99 |
);
|
100 |
}
|
101 |
}
|
102 |
+
// 添付されているけど、フック等でメタ情報が書き換えられて添付ファイルID以外になってしまった場合
|
103 |
+
else {
|
104 |
+
echo esc_html( $value );
|
105 |
+
}
|
106 |
}
|
107 |
}
|
classes/views/class.contact-data.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data View
|
4 |
-
* Version : 1.0.
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
-
* Modified :
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
@@ -155,6 +155,10 @@ class MW_WP_Form_Contact_Data_View extends MW_WP_Form_View {
|
|
155 |
);
|
156 |
}
|
157 |
}
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
|
160 |
/**
|
@@ -163,10 +167,15 @@ class MW_WP_Form_Contact_Data_View extends MW_WP_Form_View {
|
|
163 |
* @return numeric 投稿数
|
164 |
*/
|
165 |
protected function get_count( $post_type ) {
|
166 |
-
$
|
167 |
-
|
|
|
168 |
'posts_per_page' => 1,
|
169 |
-
)
|
|
|
|
|
|
|
|
|
170 |
return $query->found_posts;
|
171 |
}
|
172 |
|
1 |
<?php
|
2 |
/**
|
3 |
* Name : MW WP Form Contact Data View
|
4 |
+
* Version : 1.0.1
|
5 |
* Author : Takashi Kitajima
|
6 |
* Author URI : http://2inc.org
|
7 |
* Created : January 2, 2015
|
8 |
+
* Modified : February 13, 2015
|
9 |
* License : GPLv2
|
10 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
*/
|
155 |
);
|
156 |
}
|
157 |
}
|
158 |
+
// 添付されているけど、フック等でメタ情報が書き換えられて添付ファイルID以外になってしまった場合
|
159 |
+
else {
|
160 |
+
echo esc_html( $value );
|
161 |
+
}
|
162 |
}
|
163 |
|
164 |
/**
|
167 |
* @return numeric 投稿数
|
168 |
*/
|
169 |
protected function get_count( $post_type ) {
|
170 |
+
$_args = apply_filters( 'mwform_get_inquiry_data_args-' . $post_type, array() );
|
171 |
+
$args = array(
|
172 |
+
'post_type' => $post_type,
|
173 |
'posts_per_page' => 1,
|
174 |
+
);
|
175 |
+
if ( !empty( $_args ) && is_array( $_args ) ) {
|
176 |
+
$args = array_merge( $_args, $args );
|
177 |
+
}
|
178 |
+
$query = new WP_Query( $args );
|
179 |
return $query->found_posts;
|
180 |
}
|
181 |
|
css/admin-common.css
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
#menu-posts-mw-wp-form .wp-submenu li a[href$="-chart"] {
|
4 |
+
display: none;
|
5 |
+
}
|
css/admin-data-list.css
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* クイック編集リンク
|
5 |
+
*/
|
6 |
+
.wp-list-table .post-title span.hide-if-no-js {
|
7 |
+
display: none;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* CSVダウンロードボタン
|
12 |
+
*/
|
13 |
+
#wpbody-content {
|
14 |
+
padding-bottom: 85px; /* default: 65px */;
|
15 |
+
}
|
16 |
+
#mw-wp-form_csv {
|
17 |
+
position: absolute;
|
18 |
+
top: -34px;
|
19 |
+
}
|
20 |
+
#mw-wp-form_csv .button-primary {
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* .mw-wp-form-table
|
25 |
+
*/
|
26 |
+
.mw-wp-form-table-count,
|
27 |
+
.mw-wp-form-table-date {
|
28 |
+
width: 20%;
|
29 |
+
}
|
30 |
+
|
31 |
+
/**
|
32 |
+
* .wp-list-table
|
33 |
+
*/
|
34 |
+
.mw-wp-form-wp-list-table {
|
35 |
+
overflow: auto;
|
36 |
+
}
|
37 |
+
.mw-wp-form-wp-list-table .wp-list-table {
|
38 |
+
table-layout: auto;
|
39 |
+
width: 100%;
|
40 |
+
}
|
41 |
+
.mw-wp-form-wp-list-table .wp-list-table th {
|
42 |
+
white-space: nowrap;
|
43 |
+
}
|
css/admin-data.css
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* 投稿ステータス等
|
5 |
+
*/
|
6 |
+
#minor-publishing-actions,
|
7 |
+
#misc-publishing-actions {
|
8 |
+
display: none;
|
9 |
+
}
|
10 |
+
|
11 |
+
/**
|
12 |
+
* 更新時の記事リンク
|
13 |
+
*/
|
14 |
+
.post-php #message a {
|
15 |
+
display: none;
|
16 |
+
}
|
17 |
+
|
18 |
+
/**
|
19 |
+
* DB保存データのカスタムフィールド
|
20 |
+
*/
|
21 |
+
#mw-wp-form_custom_fields table,
|
22 |
+
#mw-wp-form_data_custom_fields table {
|
23 |
+
font-size: 100%;
|
24 |
+
border-top: #dfdfdf solid 1px;
|
25 |
+
border-right: #dfdfdf solid 1px;
|
26 |
+
width: 100%;
|
27 |
+
}
|
28 |
+
#mw-wp-form_custom_fields table th,
|
29 |
+
#mw-wp-form_custom_fields table td,
|
30 |
+
#mw-wp-form_data_custom_fields table th,
|
31 |
+
#mw-wp-form_data_custom_fields table td {
|
32 |
+
border-bottom: #dfdfdf solid 1px;
|
33 |
+
border-left: #dfdfdf solid 1px;
|
34 |
+
padding: 5px 10px;
|
35 |
+
text-align: left;
|
36 |
+
vertical-align: top;
|
37 |
+
width: 30%;
|
38 |
+
}
|
39 |
+
#mw-wp-form_custom_fields table td,
|
40 |
+
#mw-wp-form_data_custom_fields table td {
|
41 |
+
background-color: #fff;
|
42 |
+
width: 70%;
|
43 |
+
}
|
44 |
+
#mw-wp-form_data_custom_fields textarea {
|
45 |
+
width: 100%;
|
46 |
+
}
|
css/admin-list.css
ADDED
@@ -0,0 +1,65 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* クイック編集リンク
|
5 |
+
*/
|
6 |
+
.wp-list-table .post-title span.hide-if-no-js {
|
7 |
+
display: none;
|
8 |
+
}
|
9 |
+
|
10 |
+
/**
|
11 |
+
* フォーム識別子
|
12 |
+
*/
|
13 |
+
span#formkey_field {
|
14 |
+
background-color: #fff;
|
15 |
+
border: #dfdfdf solid 1px;
|
16 |
+
border-radius: 3px;
|
17 |
+
color: #333;
|
18 |
+
display: block;
|
19 |
+
margin: 1px;
|
20 |
+
padding: 3px;
|
21 |
+
}
|
22 |
+
|
23 |
+
/**
|
24 |
+
* 寄付ボタン
|
25 |
+
*/
|
26 |
+
.wp-admin li.donation {
|
27 |
+
color: #ffffe0;
|
28 |
+
display: block;
|
29 |
+
margin: -8px 0 0;
|
30 |
+
overflow: hidden;
|
31 |
+
zoom: 1;
|
32 |
+
}
|
33 |
+
.wp-admin li.donation div.donation {
|
34 |
+
background-color: #ffffe0;
|
35 |
+
border: #e6db55 solid 1px;
|
36 |
+
color: #000;
|
37 |
+
float: left;
|
38 |
+
padding: 0 10px;
|
39 |
+
margin: 0 -5px 10px 0;
|
40 |
+
border-radius: 3px;
|
41 |
+
}
|
42 |
+
.wp-admin li.donation div.donation p {
|
43 |
+
margin: 3px 0;
|
44 |
+
}
|
45 |
+
|
46 |
+
/**
|
47 |
+
* .column-mwform_form_key
|
48 |
+
*/
|
49 |
+
.fixed .column-title {
|
50 |
+
width: 30%;
|
51 |
+
}
|
52 |
+
.fixed .column-mwform_form_key {
|
53 |
+
width: 30%;
|
54 |
+
}
|
55 |
+
.fixed .column-date {
|
56 |
+
width: 20%;
|
57 |
+
}
|
58 |
+
@media screen and (max-width: 782px) {
|
59 |
+
.fixed .column-title {
|
60 |
+
width: auto;
|
61 |
+
}
|
62 |
+
.fixed .column-mwform_form_key {
|
63 |
+
display: none;
|
64 |
+
}
|
65 |
+
}
|
css/admin-repeatable.css
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
|
3 |
+
/**
|
4 |
+
* バリデーションルール
|
5 |
+
* チャート設定
|
6 |
+
*/
|
7 |
+
#mw-wp-form_validation .repeatable-box,
|
8 |
+
#mw-wp-form_chart .repeatable-box {
|
9 |
+
background: #fff;
|
10 |
+
border: #ddd solid 1px;
|
11 |
+
border-radius: 5px;
|
12 |
+
margin: 10px 0;
|
13 |
+
padding: 10px;
|
14 |
+
}
|
15 |
+
#mw-wp-form_validation .repeatable-box .repeatable-box-content,
|
16 |
+
#mw-wp-form_chart .repeatable-box .repeatable-box-content {
|
17 |
+
border-top: #ddd solid 1px;
|
18 |
+
margin: 10px 0 0;
|
19 |
+
padding: 10px 0 0;
|
20 |
+
display: none;
|
21 |
+
}
|
22 |
+
#mw-wp-form_validation .repeatable-box table,
|
23 |
+
#mw-wp-form_chart .repeatable-box table {
|
24 |
+
font-size: 100%;
|
25 |
+
margin: 10px 0 0;
|
26 |
+
}
|
27 |
+
#mw-wp-form_validation .repeatable-box table td,
|
28 |
+
#mw-wp-form_chart .repeatable-box table td {
|
29 |
+
padding: 0 10px 5px 0;
|
30 |
+
overflow: hidden;
|
31 |
+
zoom: 1;
|
32 |
+
}
|
33 |
+
#mw-wp-form_validation .repeatable-box table td label,
|
34 |
+
#mw-wp-form_chart .repeatable-box table td label {
|
35 |
+
margin: 0 10px 5px 0;
|
36 |
+
display: block;
|
37 |
+
float: left;
|
38 |
+
}
|
39 |
+
#mw-wp-form_validation .repeatable-box table td label input ,
|
40 |
+
#mw-wp-form_chart .repeatable-box table td label input{
|
41 |
+
margin: 0 2px 0 0;
|
42 |
+
}
|
43 |
+
#mw-wp-form_validation .repeatable-box table td table,
|
44 |
+
#mw-wp-form_chart .repeatable-box table td table {
|
45 |
+
clear: both;
|
46 |
+
margin: 0;
|
47 |
+
}
|
48 |
+
#mw-wp-form_validation .repeatable-box table td table td,
|
49 |
+
#mw-wp-form_chart .repeatable-box table td table td {
|
50 |
+
padding-bottom: 0;
|
51 |
+
}
|
52 |
+
#mw-wp-form_chart .inside {
|
53 |
+
margin-bottom: 0;
|
54 |
+
}
|
55 |
+
#mw-wp-form_chart .inside .submit {
|
56 |
+
margin-top: 10px;
|
57 |
+
padding: 5px 0;
|
58 |
+
}
|
59 |
+
|
60 |
+
/**
|
61 |
+
* バリデーションルールを追加
|
62 |
+
*/
|
63 |
+
#mw-wp-form_validation b.add-btn,
|
64 |
+
#mw-wp-form_chart b.add-btn {
|
65 |
+
cursor: pointer;
|
66 |
+
margin: 2px 1px 4px;
|
67 |
+
line-height: 18px;
|
68 |
+
display: inline-block;
|
69 |
+
min-width: 26px;
|
70 |
+
padding: 2px 4px;
|
71 |
+
color: #464646;
|
72 |
+
border: 1px solid #c3c3c3;
|
73 |
+
border-radius: 3px;
|
74 |
+
background: #f5f5f5;
|
75 |
+
}
|
76 |
+
#mw-wp-form_validation b.add-btn:hover,
|
77 |
+
#mw-wp-form_chart b.add-btn:hover {
|
78 |
+
background: #eee;
|
79 |
+
}
|
80 |
+
|
81 |
+
/**
|
82 |
+
* 開閉ボタン
|
83 |
+
*/
|
84 |
+
#mw-wp-form_validation .repeatable-box .open-btn,
|
85 |
+
#mw-wp-form_chart .repeatable-box .open-btn {
|
86 |
+
overflow: hidden;
|
87 |
+
zoom: 1;
|
88 |
+
}
|
89 |
+
#mw-wp-form_validation .repeatable-box .open-btn span,
|
90 |
+
#mw-wp-form_chart .repeatable-box .open-btn span {
|
91 |
+
font-weight: bold;
|
92 |
+
}
|
93 |
+
#mw-wp-form_validation .repeatable-box .open-btn b,
|
94 |
+
#mw-wp-form_chart .repeatable-box .open-btn b {
|
95 |
+
cursor: pointer;
|
96 |
+
display: block;
|
97 |
+
float: right;
|
98 |
+
margin: 0 0 0 10px;
|
99 |
+
}
|
100 |
+
|
101 |
+
/**
|
102 |
+
* ソートボタン
|
103 |
+
*/
|
104 |
+
#mw-wp-form_validation .repeatable-box .sortable-icon-handle,
|
105 |
+
#mw-wp-form_chart .repeatable-box .sortable-icon-handle {
|
106 |
+
background: url( ../images/handle.png ) no-repeat;
|
107 |
+
cursor: move;
|
108 |
+
float: left;
|
109 |
+
margin-right: 10px;
|
110 |
+
height: 10px;
|
111 |
+
width: 10px;
|
112 |
+
overflow: hidden;
|
113 |
+
position: relative;
|
114 |
+
top: 4px;
|
115 |
+
}
|
116 |
+
#mw-wp-form_validation .repeatable-box .remove-btn b,
|
117 |
+
#mw-wp-form_chart .repeatable-box .remove-btn b {
|
118 |
+
cursor: pointer;
|
119 |
+
display: block;
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* 削除ボタン
|
124 |
+
*/
|
125 |
+
#mw-wp-form_validation .repeatable-box .remove-btn,
|
126 |
+
#mw-wp-form_chart .repeatable-box .remove-btn {
|
127 |
+
float: left;
|
128 |
+
margin: 0 5px 0 0;
|
129 |
+
}
|
130 |
+
#mw-wp-form_validation .repeatable-box .remove-btn b,
|
131 |
+
#mw-wp-form_chart .repeatable-box .remove-btn b {
|
132 |
+
cursor: pointer;
|
133 |
+
display: block;
|
134 |
+
}
|
css/admin.css
CHANGED
@@ -15,13 +15,6 @@
|
|
15 |
display: none;
|
16 |
}
|
17 |
|
18 |
-
/**
|
19 |
-
* クイック編集リンク
|
20 |
-
*/
|
21 |
-
.wp-list-table .post-title span.hide-if-no-js {
|
22 |
-
display: none;
|
23 |
-
}
|
24 |
-
|
25 |
/**
|
26 |
* 抜粋表示の続きを読む
|
27 |
*/
|
@@ -98,139 +91,6 @@ span#formkey_field {
|
|
98 |
width: 100%;
|
99 |
}
|
100 |
|
101 |
-
/**
|
102 |
-
* バリデーションルール
|
103 |
-
* チャート設定
|
104 |
-
*/
|
105 |
-
#mw-wp-form_validation .repeatable-box,
|
106 |
-
#mw-wp-form_chart .repeatable-box {
|
107 |
-
background: #fff;
|
108 |
-
border: #ddd solid 1px;
|
109 |
-
border-radius: 5px;
|
110 |
-
margin: 10px 0;
|
111 |
-
padding: 10px;
|
112 |
-
}
|
113 |
-
#mw-wp-form_validation .repeatable-box .repeatable-box-content,
|
114 |
-
#mw-wp-form_chart .repeatable-box .repeatable-box-content {
|
115 |
-
border-top: #ddd solid 1px;
|
116 |
-
margin: 10px 0 0;
|
117 |
-
padding: 10px 0 0;
|
118 |
-
display: none;
|
119 |
-
}
|
120 |
-
#mw-wp-form_validation .repeatable-box table,
|
121 |
-
#mw-wp-form_chart .repeatable-box table {
|
122 |
-
font-size: 100%;
|
123 |
-
margin: 10px 0 0;
|
124 |
-
}
|
125 |
-
#mw-wp-form_validation .repeatable-box table td,
|
126 |
-
#mw-wp-form_chart .repeatable-box table td {
|
127 |
-
padding: 0 10px 5px 0;
|
128 |
-
overflow: hidden;
|
129 |
-
zoom: 1;
|
130 |
-
}
|
131 |
-
#mw-wp-form_validation .repeatable-box table td label,
|
132 |
-
#mw-wp-form_chart .repeatable-box table td label {
|
133 |
-
margin: 0 10px 5px 0;
|
134 |
-
display: block;
|
135 |
-
float: left;
|
136 |
-
}
|
137 |
-
#mw-wp-form_validation .repeatable-box table td label input ,
|
138 |
-
#mw-wp-form_chart .repeatable-box table td label input{
|
139 |
-
margin: 0 2px 0 0;
|
140 |
-
}
|
141 |
-
#mw-wp-form_validation .repeatable-box table td table,
|
142 |
-
#mw-wp-form_chart .repeatable-box table td table {
|
143 |
-
clear: both;
|
144 |
-
margin: 0;
|
145 |
-
}
|
146 |
-
#mw-wp-form_validation .repeatable-box table td table td,
|
147 |
-
#mw-wp-form_chart .repeatable-box table td table td {
|
148 |
-
padding-bottom: 0;
|
149 |
-
}
|
150 |
-
#mw-wp-form_chart .inside {
|
151 |
-
margin-bottom: 0;
|
152 |
-
}
|
153 |
-
#mw-wp-form_chart .inside .submit {
|
154 |
-
margin-top: 10px;
|
155 |
-
padding: 5px 0;
|
156 |
-
}
|
157 |
-
|
158 |
-
/**
|
159 |
-
* バリデーションルールを追加
|
160 |
-
*/
|
161 |
-
#mw-wp-form_validation b.add-btn,
|
162 |
-
#mw-wp-form_chart b.add-btn {
|
163 |
-
cursor: pointer;
|
164 |
-
margin: 2px 1px 4px;
|
165 |
-
line-height: 18px;
|
166 |
-
display: inline-block;
|
167 |
-
min-width: 26px;
|
168 |
-
padding: 2px 4px;
|
169 |
-
color: #464646;
|
170 |
-
border: 1px solid #c3c3c3;
|
171 |
-
border-radius: 3px;
|
172 |
-
background: #f5f5f5;
|
173 |
-
}
|
174 |
-
#mw-wp-form_validation b.add-btn:hover,
|
175 |
-
#mw-wp-form_chart b.add-btn:hover {
|
176 |
-
background: #eee;
|
177 |
-
}
|
178 |
-
|
179 |
-
/**
|
180 |
-
* 開閉ボタン
|
181 |
-
*/
|
182 |
-
#mw-wp-form_validation .repeatable-box .open-btn,
|
183 |
-
#mw-wp-form_chart .repeatable-box .open-btn {
|
184 |
-
overflow: hidden;
|
185 |
-
zoom: 1;
|
186 |
-
}
|
187 |
-
#mw-wp-form_validation .repeatable-box .open-btn span,
|
188 |
-
#mw-wp-form_chart .repeatable-box .open-btn span {
|
189 |
-
font-weight: bold;
|
190 |
-
}
|
191 |
-
#mw-wp-form_validation .repeatable-box .open-btn b,
|
192 |
-
#mw-wp-form_chart .repeatable-box .open-btn b {
|
193 |
-
cursor: pointer;
|
194 |
-
display: block;
|
195 |
-
float: right;
|
196 |
-
margin: 0 0 0 10px;
|
197 |
-
}
|
198 |
-
|
199 |
-
/**
|
200 |
-
* ソートボタン
|
201 |
-
*/
|
202 |
-
#mw-wp-form_validation .repeatable-box .sortable-icon-handle,
|
203 |
-
#mw-wp-form_chart .repeatable-box .sortable-icon-handle {
|
204 |
-
background: url( ../images/handle.png ) no-repeat;
|
205 |
-
cursor: move;
|
206 |
-
float: left;
|
207 |
-
margin-right: 10px;
|
208 |
-
height: 10px;
|
209 |
-
width: 10px;
|
210 |
-
overflow: hidden;
|
211 |
-
position: relative;
|
212 |
-
top: 4px;
|
213 |
-
}
|
214 |
-
#mw-wp-form_validation .repeatable-box .remove-btn b,
|
215 |
-
#mw-wp-form_chart .repeatable-box .remove-btn b {
|
216 |
-
cursor: pointer;
|
217 |
-
display: block;
|
218 |
-
}
|
219 |
-
|
220 |
-
/**
|
221 |
-
* 削除ボタン
|
222 |
-
*/
|
223 |
-
#mw-wp-form_validation .repeatable-box .remove-btn,
|
224 |
-
#mw-wp-form_chart .repeatable-box .remove-btn {
|
225 |
-
float: left;
|
226 |
-
margin: 0 5px 0 0;
|
227 |
-
}
|
228 |
-
#mw-wp-form_validation .repeatable-box .remove-btn b,
|
229 |
-
#mw-wp-form_chart .repeatable-box .remove-btn b {
|
230 |
-
cursor: pointer;
|
231 |
-
display: block;
|
232 |
-
}
|
233 |
-
|
234 |
/**
|
235 |
* 設定
|
236 |
*/
|
@@ -239,6 +99,9 @@ span#formkey_field {
|
|
239 |
margin: 0 0 15px;
|
240 |
padding: 0 0 15px;
|
241 |
}
|
|
|
|
|
|
|
242 |
#mw-wp-form_settings table td {
|
243 |
padding: 0 5px 0 0;
|
244 |
text-align: left;
|
@@ -253,35 +116,6 @@ span#formkey_field {
|
|
253 |
text-align: left;
|
254 |
}
|
255 |
|
256 |
-
/**
|
257 |
-
* DB保存データのカスタムフィールド
|
258 |
-
*/
|
259 |
-
#mw-wp-form_custom_fields table,
|
260 |
-
#mw-wp-form_data_custom_fields table {
|
261 |
-
border-top: #dfdfdf solid 1px;
|
262 |
-
border-right: #dfdfdf solid 1px;
|
263 |
-
width: 100%;
|
264 |
-
}
|
265 |
-
#mw-wp-form_custom_fields table th,
|
266 |
-
#mw-wp-form_custom_fields table td,
|
267 |
-
#mw-wp-form_data_custom_fields table th,
|
268 |
-
#mw-wp-form_data_custom_fields table td {
|
269 |
-
border-bottom: #dfdfdf solid 1px;
|
270 |
-
border-left: #dfdfdf solid 1px;
|
271 |
-
padding: 5px 10px;
|
272 |
-
text-align: left;
|
273 |
-
vertical-align: top;
|
274 |
-
width: 30%;
|
275 |
-
}
|
276 |
-
#mw-wp-form_custom_fields table td,
|
277 |
-
#mw-wp-form_data_custom_fields table td {
|
278 |
-
background-color: #fff;
|
279 |
-
width: 70%;
|
280 |
-
}
|
281 |
-
#mw-wp-form_data_custom_fields textarea {
|
282 |
-
width: 100%;
|
283 |
-
}
|
284 |
-
|
285 |
/**
|
286 |
* 注釈
|
287 |
*/
|
@@ -298,42 +132,6 @@ span#formkey_field {
|
|
298 |
margin-left: 3px;
|
299 |
}
|
300 |
|
301 |
-
/**
|
302 |
-
* CSVダウンロードボタン
|
303 |
-
*/
|
304 |
-
#wpbody-content {
|
305 |
-
padding-bottom: 85px; /* default: 65px */;
|
306 |
-
}
|
307 |
-
#mw-wp-form_csv {
|
308 |
-
position: absolute;
|
309 |
-
top: -34px;
|
310 |
-
}
|
311 |
-
#mw-wp-form_csv .button-primary {
|
312 |
-
}
|
313 |
-
|
314 |
-
/**
|
315 |
-
* 寄付ボタン
|
316 |
-
*/
|
317 |
-
.wp-admin li.donation {
|
318 |
-
color: #ffffe0;
|
319 |
-
display: block;
|
320 |
-
margin: -8px 0 0;
|
321 |
-
overflow: hidden;
|
322 |
-
zoom: 1;
|
323 |
-
}
|
324 |
-
.wp-admin li.donation div.donation {
|
325 |
-
background-color: #ffffe0;
|
326 |
-
border: #e6db55 solid 1px;
|
327 |
-
color: #000;
|
328 |
-
float: left;
|
329 |
-
padding: 0 10px;
|
330 |
-
margin: 0 -5px 10px 0;
|
331 |
-
border-radius: 3px;
|
332 |
-
}
|
333 |
-
.wp-admin li.donation div.donation p {
|
334 |
-
margin: 3px 0;
|
335 |
-
}
|
336 |
-
|
337 |
/**
|
338 |
* .mwform-dialog
|
339 |
*/
|
@@ -383,28 +181,6 @@ span#formkey_field {
|
|
383 |
display: block;
|
384 |
}
|
385 |
|
386 |
-
/**
|
387 |
-
* .mw-wp-form-table
|
388 |
-
*/
|
389 |
-
.mw-wp-form-table-count,
|
390 |
-
.mw-wp-form-table-date {
|
391 |
-
width: 20%;
|
392 |
-
}
|
393 |
-
|
394 |
-
/**
|
395 |
-
* .wp-list-table
|
396 |
-
*/
|
397 |
-
.mw-wp-form-wp-list-table {
|
398 |
-
overflow: auto;
|
399 |
-
}
|
400 |
-
.mw-wp-form-wp-list-table .wp-list-table {
|
401 |
-
table-layout: auto;
|
402 |
-
width: 100%;
|
403 |
-
}
|
404 |
-
.mw-wp-form-wp-list-table .wp-list-table th {
|
405 |
-
white-space: nowrap;
|
406 |
-
}
|
407 |
-
|
408 |
/**
|
409 |
* .mwform-chart-wrapper
|
410 |
*/
|
@@ -429,24 +205,3 @@ span#formkey_field {
|
|
429 |
.mwform-chart-wrapper .mwform-legend .mwform-legend-value {
|
430 |
margin-left: 10px;
|
431 |
}
|
432 |
-
|
433 |
-
/**
|
434 |
-
* .column-mwform_form_key
|
435 |
-
*/
|
436 |
-
.fixed .column-title {
|
437 |
-
width: 30%;
|
438 |
-
}
|
439 |
-
.fixed .column-mwform_form_key {
|
440 |
-
width: 30%;
|
441 |
-
}
|
442 |
-
.fixed .column-date {
|
443 |
-
width: 20%;
|
444 |
-
}
|
445 |
-
@media screen and (max-width: 782px) {
|
446 |
-
.fixed .column-title {
|
447 |
-
width: auto;
|
448 |
-
}
|
449 |
-
.fixed .column-mwform_form_key {
|
450 |
-
display: none;
|
451 |
-
}
|
452 |
-
}
|
15 |
display: none;
|
16 |
}
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
/**
|
19 |
* 抜粋表示の続きを読む
|
20 |
*/
|
91 |
width: 100%;
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
* 設定
|
96 |
*/
|
99 |
margin: 0 0 15px;
|
100 |
padding: 0 0 15px;
|
101 |
}
|
102 |
+
#mw-wp-form_settings table {
|
103 |
+
font-size: 100%;
|
104 |
+
}
|
105 |
#mw-wp-form_settings table td {
|
106 |
padding: 0 5px 0 0;
|
107 |
text-align: left;
|
116 |
text-align: left;
|
117 |
}
|
118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
119 |
/**
|
120 |
* 注釈
|
121 |
*/
|
132 |
margin-left: 3px;
|
133 |
}
|
134 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
/**
|
136 |
* .mwform-dialog
|
137 |
*/
|
181 |
display: block;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
/**
|
185 |
* .mwform-chart-wrapper
|
186 |
*/
|
205 |
.mwform-chart-wrapper .mwform-legend .mwform-legend-value {
|
206 |
margin-left: 10px;
|
207 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/{admin-data.js → admin-data-list.js}
RENAMED
File without changes
|
js/admin.js
CHANGED
@@ -57,7 +57,7 @@ jQuery( function( $ ) {
|
|
57 |
send_to_editor( mwform_create_shortcode( $( this ).attr( 'id' ) ) );
|
58 |
$( this ).dialog( 'close' );
|
59 |
},
|
60 |
-
'
|
61 |
$( this ).dialog( 'close' );
|
62 |
}
|
63 |
},
|
57 |
send_to_editor( mwform_create_shortcode( $( this ).attr( 'id' ) ) );
|
58 |
$( this ).dialog( 'close' );
|
59 |
},
|
60 |
+
'Cancel': function() {
|
61 |
$( this ).dialog( 'close' );
|
62 |
}
|
63 |
},
|
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 2.2.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
-
"POT-Creation-Date: 2015-02-
|
8 |
-
"PO-Revision-Date: 2015-02-
|
9 |
"Last-Translator: Takashi Kitajima <inc@2inc.org>\n"
|
10 |
"Language-Team: Takashi Kitajima <inc@2inc.org>\n"
|
11 |
"Language: ja\n"
|
@@ -112,85 +112,99 @@ msgstr "ボタン"
|
|
112 |
msgid "Checkbox"
|
113 |
msgstr "チェックボックス"
|
114 |
|
115 |
-
#: classes/form-fields/class.checkbox.php:
|
116 |
-
#: classes/form-fields/class.radio.php:
|
117 |
-
#: classes/form-fields/class.select.php:
|
118 |
msgid "Choices"
|
119 |
msgstr "選択肢"
|
120 |
|
121 |
-
#: classes/form-fields/class.checkbox.php:
|
122 |
#: classes/form-fields/class.error.php:78
|
123 |
-
#: classes/form-fields/class.radio.php:
|
124 |
-
#: classes/form-fields/class.select.php:
|
125 |
msgid "Input one line about one item."
|
126 |
msgstr "1項目につき1行で入力してください。"
|
127 |
|
128 |
-
#: classes/form-fields/class.checkbox.php:
|
129 |
-
#: classes/form-fields/class.radio.php:
|
130 |
-
#: classes/form-fields/class.select.php:
|
131 |
msgid "Example: value1↵value2 or key1:value1↵key2:value2"
|
132 |
msgstr "例:値1↵値2 もしくは キー1:値1↵キー2:値2"
|
133 |
|
134 |
-
#: classes/form-fields/class.checkbox.php:
|
135 |
-
#: classes/form-fields/class.radio.php:
|
136 |
-
#: classes/form-fields/class.select.php:
|
137 |
msgid ""
|
138 |
"You can split the post value and display value by \":\". But display value "
|
139 |
"is sent in e-mail."
|
140 |
msgstr ""
|
141 |
"送信値と表示値を「:」で分割できます。ただし、メールでは表示値が送信されます。"
|
142 |
|
143 |
-
#: classes/form-fields/class.checkbox.php:
|
144 |
-
#: classes/form-fields/class.radio.php:
|
145 |
-
#: classes/form-fields/class.select.php:
|
146 |
msgid "When you want to use \":\", please enter \"::\"."
|
147 |
msgstr "「:」を使いたいときは「::」と入力してください。"
|
148 |
|
149 |
-
#: classes/form-fields/class.checkbox.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
#: classes/form-fields/class.datepicker.php:131
|
151 |
#: classes/form-fields/class.hidden.php:79
|
152 |
#: classes/form-fields/class.password.php:107
|
153 |
-
#: classes/form-fields/class.radio.php:
|
154 |
-
#: classes/form-fields/class.select.php:
|
155 |
#: classes/form-fields/class.text.php:115
|
156 |
#: classes/form-fields/class.textarea.php:109
|
157 |
msgid "Default value"
|
158 |
msgstr "初期値"
|
159 |
|
160 |
-
#: classes/form-fields/class.checkbox.php:
|
161 |
msgid "Separator string"
|
162 |
msgstr "区切り文字"
|
163 |
|
164 |
-
#: classes/form-fields/class.checkbox.php:
|
165 |
-
#: classes/form-fields/class.radio.php:
|
166 |
msgid "Display method"
|
167 |
msgstr "表示方法"
|
168 |
|
169 |
-
#: classes/form-fields/class.checkbox.php:
|
170 |
-
#: classes/form-fields/class.radio.php:
|
171 |
msgid "Arranged vertically."
|
172 |
msgstr "垂直に配置する"
|
173 |
|
174 |
-
#: classes/form-fields/class.checkbox.php:
|
175 |
#: classes/form-fields/class.datepicker.php:136
|
176 |
#: classes/form-fields/class.file.php:109
|
177 |
#: classes/form-fields/class.image.php:110
|
178 |
#: classes/form-fields/class.password.php:117
|
179 |
-
#: classes/form-fields/class.radio.php:
|
180 |
-
#: classes/form-fields/class.select.php:
|
181 |
#: classes/form-fields/class.tel.php:89 classes/form-fields/class.text.php:125
|
182 |
#: classes/form-fields/class.textarea.php:119
|
183 |
#: classes/form-fields/class.zip.php:89
|
184 |
msgid "Dsiplay error"
|
185 |
msgstr "エラー表示"
|
186 |
|
187 |
-
#: classes/form-fields/class.checkbox.php:
|
188 |
#: classes/form-fields/class.datepicker.php:138
|
189 |
#: classes/form-fields/class.file.php:111
|
190 |
#: classes/form-fields/class.image.php:112
|
191 |
#: classes/form-fields/class.password.php:119
|
192 |
-
#: classes/form-fields/class.radio.php:
|
193 |
-
#: classes/form-fields/class.select.php:
|
194 |
#: classes/form-fields/class.tel.php:91 classes/form-fields/class.text.php:127
|
195 |
#: classes/form-fields/class.textarea.php:121
|
196 |
#: classes/form-fields/class.zip.php:91
|
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 2.2.8\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
+
"POT-Creation-Date: 2015-02-12 11:09:11+00:00\n"
|
8 |
+
"PO-Revision-Date: 2015-02-12 20:11+0900\n"
|
9 |
"Last-Translator: Takashi Kitajima <inc@2inc.org>\n"
|
10 |
"Language-Team: Takashi Kitajima <inc@2inc.org>\n"
|
11 |
"Language: ja\n"
|
112 |
msgid "Checkbox"
|
113 |
msgstr "チェックボックス"
|
114 |
|
115 |
+
#: classes/form-fields/class.checkbox.php:110
|
116 |
+
#: classes/form-fields/class.radio.php:106
|
117 |
+
#: classes/form-fields/class.select.php:104
|
118 |
msgid "Choices"
|
119 |
msgstr "選択肢"
|
120 |
|
121 |
+
#: classes/form-fields/class.checkbox.php:114
|
122 |
#: classes/form-fields/class.error.php:78
|
123 |
+
#: classes/form-fields/class.radio.php:110
|
124 |
+
#: classes/form-fields/class.select.php:108
|
125 |
msgid "Input one line about one item."
|
126 |
msgstr "1項目につき1行で入力してください。"
|
127 |
|
128 |
+
#: classes/form-fields/class.checkbox.php:115
|
129 |
+
#: classes/form-fields/class.radio.php:111
|
130 |
+
#: classes/form-fields/class.select.php:109
|
131 |
msgid "Example: value1↵value2 or key1:value1↵key2:value2"
|
132 |
msgstr "例:値1↵値2 もしくは キー1:値1↵キー2:値2"
|
133 |
|
134 |
+
#: classes/form-fields/class.checkbox.php:116
|
135 |
+
#: classes/form-fields/class.radio.php:112
|
136 |
+
#: classes/form-fields/class.select.php:110
|
137 |
msgid ""
|
138 |
"You can split the post value and display value by \":\". But display value "
|
139 |
"is sent in e-mail."
|
140 |
msgstr ""
|
141 |
"送信値と表示値を「:」で分割できます。ただし、メールでは表示値が送信されます。"
|
142 |
|
143 |
+
#: classes/form-fields/class.checkbox.php:117
|
144 |
+
#: classes/form-fields/class.radio.php:113
|
145 |
+
#: classes/form-fields/class.select.php:111
|
146 |
msgid "When you want to use \":\", please enter \"::\"."
|
147 |
msgstr "「:」を使いたいときは「::」と入力してください。"
|
148 |
|
149 |
+
#: classes/form-fields/class.checkbox.php:121
|
150 |
+
#: classes/form-fields/class.radio.php:117
|
151 |
+
#: classes/form-fields/class.select.php:115
|
152 |
+
msgid "Send value by e-mail"
|
153 |
+
msgstr "メールで送信する値"
|
154 |
+
|
155 |
+
#: classes/form-fields/class.checkbox.php:124
|
156 |
+
#: classes/form-fields/class.radio.php:120
|
157 |
+
#: classes/form-fields/class.select.php:118
|
158 |
+
msgid ""
|
159 |
+
"Send post value when you split the post value and display value by \":\" in "
|
160 |
+
"choices."
|
161 |
+
msgstr "choicesで送信値と表示値を「:」で分割したとき、送信値をメールで送信"
|
162 |
+
|
163 |
+
#: classes/form-fields/class.checkbox.php:127
|
164 |
#: classes/form-fields/class.datepicker.php:131
|
165 |
#: classes/form-fields/class.hidden.php:79
|
166 |
#: classes/form-fields/class.password.php:107
|
167 |
+
#: classes/form-fields/class.radio.php:123
|
168 |
+
#: classes/form-fields/class.select.php:121
|
169 |
#: classes/form-fields/class.text.php:115
|
170 |
#: classes/form-fields/class.textarea.php:109
|
171 |
msgid "Default value"
|
172 |
msgstr "初期値"
|
173 |
|
174 |
+
#: classes/form-fields/class.checkbox.php:132
|
175 |
msgid "Separator string"
|
176 |
msgstr "区切り文字"
|
177 |
|
178 |
+
#: classes/form-fields/class.checkbox.php:137
|
179 |
+
#: classes/form-fields/class.radio.php:128
|
180 |
msgid "Display method"
|
181 |
msgstr "表示方法"
|
182 |
|
183 |
+
#: classes/form-fields/class.checkbox.php:139
|
184 |
+
#: classes/form-fields/class.radio.php:130
|
185 |
msgid "Arranged vertically."
|
186 |
msgstr "垂直に配置する"
|
187 |
|
188 |
+
#: classes/form-fields/class.checkbox.php:142
|
189 |
#: classes/form-fields/class.datepicker.php:136
|
190 |
#: classes/form-fields/class.file.php:109
|
191 |
#: classes/form-fields/class.image.php:110
|
192 |
#: classes/form-fields/class.password.php:117
|
193 |
+
#: classes/form-fields/class.radio.php:133
|
194 |
+
#: classes/form-fields/class.select.php:126
|
195 |
#: classes/form-fields/class.tel.php:89 classes/form-fields/class.text.php:125
|
196 |
#: classes/form-fields/class.textarea.php:119
|
197 |
#: classes/form-fields/class.zip.php:89
|
198 |
msgid "Dsiplay error"
|
199 |
msgstr "エラー表示"
|
200 |
|
201 |
+
#: classes/form-fields/class.checkbox.php:144
|
202 |
#: classes/form-fields/class.datepicker.php:138
|
203 |
#: classes/form-fields/class.file.php:111
|
204 |
#: classes/form-fields/class.image.php:112
|
205 |
#: classes/form-fields/class.password.php:119
|
206 |
+
#: classes/form-fields/class.radio.php:135
|
207 |
+
#: classes/form-fields/class.select.php:128
|
208 |
#: classes/form-fields/class.tel.php:91 classes/form-fields/class.text.php:127
|
209 |
#: classes/form-fields/class.textarea.php:121
|
210 |
#: classes/form-fields/class.zip.php:91
|
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 2.2.
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
-
"POT-Creation-Date: 2015-02-
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -111,82 +111,94 @@ msgstr ""
|
|
111 |
msgid "Checkbox"
|
112 |
msgstr ""
|
113 |
|
114 |
-
#: classes/form-fields/class.checkbox.php:
|
115 |
-
#: classes/form-fields/class.radio.php:
|
116 |
-
#: classes/form-fields/class.select.php:
|
117 |
msgid "Choices"
|
118 |
msgstr ""
|
119 |
|
120 |
-
#: classes/form-fields/class.checkbox.php:
|
121 |
#: classes/form-fields/class.error.php:78
|
122 |
-
#: classes/form-fields/class.radio.php:
|
123 |
-
#: classes/form-fields/class.select.php:
|
124 |
msgid "Input one line about one item."
|
125 |
msgstr ""
|
126 |
|
127 |
-
#: classes/form-fields/class.checkbox.php:
|
128 |
-
#: classes/form-fields/class.radio.php:
|
129 |
-
#: classes/form-fields/class.select.php:
|
130 |
msgid "Example: value1↵value2 or key1:value1↵key2:value2"
|
131 |
msgstr ""
|
132 |
|
133 |
-
#: classes/form-fields/class.checkbox.php:
|
134 |
-
#: classes/form-fields/class.radio.php:
|
135 |
-
#: classes/form-fields/class.select.php:
|
136 |
msgid "You can split the post value and display value by \":\". But display value is sent in e-mail."
|
137 |
msgstr ""
|
138 |
|
139 |
-
#: classes/form-fields/class.checkbox.php:
|
140 |
-
#: classes/form-fields/class.radio.php:
|
141 |
-
#: classes/form-fields/class.select.php:
|
142 |
msgid "When you want to use \":\", please enter \"::\"."
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: classes/form-fields/class.checkbox.php:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
#: classes/form-fields/class.datepicker.php:131
|
147 |
#: classes/form-fields/class.hidden.php:79
|
148 |
#: classes/form-fields/class.password.php:107
|
149 |
-
#: classes/form-fields/class.radio.php:
|
150 |
-
#: classes/form-fields/class.select.php:
|
151 |
#: classes/form-fields/class.text.php:115
|
152 |
#: classes/form-fields/class.textarea.php:109
|
153 |
msgid "Default value"
|
154 |
msgstr ""
|
155 |
|
156 |
-
#: classes/form-fields/class.checkbox.php:
|
157 |
msgid "Separator string"
|
158 |
msgstr ""
|
159 |
|
160 |
-
#: classes/form-fields/class.checkbox.php:
|
161 |
-
#: classes/form-fields/class.radio.php:
|
162 |
msgid "Display method"
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: classes/form-fields/class.checkbox.php:
|
166 |
-
#: classes/form-fields/class.radio.php:
|
167 |
msgid "Arranged vertically."
|
168 |
msgstr ""
|
169 |
|
170 |
-
#: classes/form-fields/class.checkbox.php:
|
171 |
#: classes/form-fields/class.datepicker.php:136
|
172 |
#: classes/form-fields/class.file.php:109
|
173 |
#: classes/form-fields/class.image.php:110
|
174 |
#: classes/form-fields/class.password.php:117
|
175 |
-
#: classes/form-fields/class.radio.php:
|
176 |
-
#: classes/form-fields/class.select.php:
|
177 |
#: classes/form-fields/class.tel.php:89 classes/form-fields/class.text.php:125
|
178 |
#: classes/form-fields/class.textarea.php:119
|
179 |
#: classes/form-fields/class.zip.php:89
|
180 |
msgid "Dsiplay error"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: classes/form-fields/class.checkbox.php:
|
184 |
#: classes/form-fields/class.datepicker.php:138
|
185 |
#: classes/form-fields/class.file.php:111
|
186 |
#: classes/form-fields/class.image.php:112
|
187 |
#: classes/form-fields/class.password.php:119
|
188 |
-
#: classes/form-fields/class.radio.php:
|
189 |
-
#: classes/form-fields/class.select.php:
|
190 |
#: classes/form-fields/class.tel.php:91 classes/form-fields/class.text.php:127
|
191 |
#: classes/form-fields/class.textarea.php:121
|
192 |
#: classes/form-fields/class.zip.php:91
|
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 2.2.8\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mw-wp-form\n"
|
7 |
+
"POT-Creation-Date: 2015-02-12 11:09:11+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=UTF-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
111 |
msgid "Checkbox"
|
112 |
msgstr ""
|
113 |
|
114 |
+
#: classes/form-fields/class.checkbox.php:110
|
115 |
+
#: classes/form-fields/class.radio.php:106
|
116 |
+
#: classes/form-fields/class.select.php:104
|
117 |
msgid "Choices"
|
118 |
msgstr ""
|
119 |
|
120 |
+
#: classes/form-fields/class.checkbox.php:114
|
121 |
#: classes/form-fields/class.error.php:78
|
122 |
+
#: classes/form-fields/class.radio.php:110
|
123 |
+
#: classes/form-fields/class.select.php:108
|
124 |
msgid "Input one line about one item."
|
125 |
msgstr ""
|
126 |
|
127 |
+
#: classes/form-fields/class.checkbox.php:115
|
128 |
+
#: classes/form-fields/class.radio.php:111
|
129 |
+
#: classes/form-fields/class.select.php:109
|
130 |
msgid "Example: value1↵value2 or key1:value1↵key2:value2"
|
131 |
msgstr ""
|
132 |
|
133 |
+
#: classes/form-fields/class.checkbox.php:116
|
134 |
+
#: classes/form-fields/class.radio.php:112
|
135 |
+
#: classes/form-fields/class.select.php:110
|
136 |
msgid "You can split the post value and display value by \":\". But display value is sent in e-mail."
|
137 |
msgstr ""
|
138 |
|
139 |
+
#: classes/form-fields/class.checkbox.php:117
|
140 |
+
#: classes/form-fields/class.radio.php:113
|
141 |
+
#: classes/form-fields/class.select.php:111
|
142 |
msgid "When you want to use \":\", please enter \"::\"."
|
143 |
msgstr ""
|
144 |
|
145 |
+
#: classes/form-fields/class.checkbox.php:121
|
146 |
+
#: classes/form-fields/class.radio.php:117
|
147 |
+
#: classes/form-fields/class.select.php:115
|
148 |
+
msgid "Send value by e-mail"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: classes/form-fields/class.checkbox.php:124
|
152 |
+
#: classes/form-fields/class.radio.php:120
|
153 |
+
#: classes/form-fields/class.select.php:118
|
154 |
+
msgid "Send post value when you split the post value and display value by \":\" in choices."
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: classes/form-fields/class.checkbox.php:127
|
158 |
#: classes/form-fields/class.datepicker.php:131
|
159 |
#: classes/form-fields/class.hidden.php:79
|
160 |
#: classes/form-fields/class.password.php:107
|
161 |
+
#: classes/form-fields/class.radio.php:123
|
162 |
+
#: classes/form-fields/class.select.php:121
|
163 |
#: classes/form-fields/class.text.php:115
|
164 |
#: classes/form-fields/class.textarea.php:109
|
165 |
msgid "Default value"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: classes/form-fields/class.checkbox.php:132
|
169 |
msgid "Separator string"
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: classes/form-fields/class.checkbox.php:137
|
173 |
+
#: classes/form-fields/class.radio.php:128
|
174 |
msgid "Display method"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: classes/form-fields/class.checkbox.php:139
|
178 |
+
#: classes/form-fields/class.radio.php:130
|
179 |
msgid "Arranged vertically."
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: classes/form-fields/class.checkbox.php:142
|
183 |
#: classes/form-fields/class.datepicker.php:136
|
184 |
#: classes/form-fields/class.file.php:109
|
185 |
#: classes/form-fields/class.image.php:110
|
186 |
#: classes/form-fields/class.password.php:117
|
187 |
+
#: classes/form-fields/class.radio.php:133
|
188 |
+
#: classes/form-fields/class.select.php:126
|
189 |
#: classes/form-fields/class.tel.php:89 classes/form-fields/class.text.php:125
|
190 |
#: classes/form-fields/class.textarea.php:119
|
191 |
#: classes/form-fields/class.zip.php:89
|
192 |
msgid "Dsiplay error"
|
193 |
msgstr ""
|
194 |
|
195 |
+
#: classes/form-fields/class.checkbox.php:144
|
196 |
#: classes/form-fields/class.datepicker.php:138
|
197 |
#: classes/form-fields/class.file.php:111
|
198 |
#: classes/form-fields/class.image.php:112
|
199 |
#: classes/form-fields/class.password.php:119
|
200 |
+
#: classes/form-fields/class.radio.php:135
|
201 |
+
#: classes/form-fields/class.select.php:128
|
202 |
#: classes/form-fields/class.tel.php:91 classes/form-fields/class.text.php:127
|
203 |
#: classes/form-fields/class.textarea.php:121
|
204 |
#: classes/form-fields/class.zip.php:91
|
mw-wp-form.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://plugins.2inc.org/mw-wp-form/
|
5 |
* Description: MW WP Form is shortcode base contact form plugin. This plugin have many feature. For example you can use many validation rules, contact data saving, and chart aggregation using saved contact data.
|
6 |
-
* Version: 2.
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
@@ -127,8 +127,15 @@ class MW_WP_Form {
|
|
127 |
public function initialize() {
|
128 |
load_plugin_textdomain( MWF_Config::DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );
|
129 |
|
|
|
130 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
|
|
131 |
|
|
|
|
|
|
|
|
|
|
|
132 |
// フォームフィールドの読み込み、インスタンス化
|
133 |
$this->instantiate_form_fields();
|
134 |
|
@@ -137,6 +144,8 @@ class MW_WP_Form {
|
|
137 |
|
138 |
$plugin_dir_path = plugin_dir_path( __FILE__ );
|
139 |
if ( is_admin() ) {
|
|
|
|
|
140 |
$Controller = new MW_WP_Form_Admin_Controller( $validation_rules );
|
141 |
$Controller->initialize();
|
142 |
|
@@ -157,6 +166,11 @@ class MW_WP_Form {
|
|
157 |
}
|
158 |
}
|
159 |
|
|
|
|
|
|
|
|
|
|
|
160 |
/**
|
161 |
* register_post_type
|
162 |
* 管理画面(カスタム投稿タイプ)の設定
|
@@ -183,13 +197,8 @@ class MW_WP_Form {
|
|
183 |
|
184 |
// MW WP Form のデータベースに保存される問い合わせデータを管理する投稿タイプ
|
185 |
$Admin = new MW_WP_Form_Admin();
|
186 |
-
$forms = $Admin->
|
187 |
foreach ( $forms as $form ) {
|
188 |
-
$Setting = new MW_WP_Form_Setting( $form->ID );
|
189 |
-
if ( !$Setting->get( 'usedb' ) ) {
|
190 |
-
continue;
|
191 |
-
}
|
192 |
-
|
193 |
$post_type = MWF_Config::DBDATA . $form->ID;
|
194 |
register_post_type( $post_type, array(
|
195 |
'label' => $form->post_title,
|
3 |
* Plugin Name: MW WP Form
|
4 |
* Plugin URI: http://plugins.2inc.org/mw-wp-form/
|
5 |
* Description: MW WP Form is shortcode base contact form plugin. This plugin have many feature. For example you can use many validation rules, contact data saving, and chart aggregation using saved contact data.
|
6 |
+
* Version: 2.3.0
|
7 |
* Author: Takashi Kitajima
|
8 |
* Author URI: http://2inc.org
|
9 |
* Created : September 25, 2012
|
127 |
public function initialize() {
|
128 |
load_plugin_textdomain( MWF_Config::DOMAIN, false, basename( dirname( __FILE__ ) ) . '/languages' );
|
129 |
|
130 |
+
add_action( 'after_setup_theme', array( $this, 'after_setup_theme' ), 11 );
|
131 |
add_action( 'init', array( $this, 'register_post_type' ) );
|
132 |
+
}
|
133 |
|
134 |
+
/**
|
135 |
+
* after_setup_theme
|
136 |
+
* 各管理画面の初期化、もしくはフロント画面の初期化
|
137 |
+
*/
|
138 |
+
public function after_setup_theme() {
|
139 |
// フォームフィールドの読み込み、インスタンス化
|
140 |
$this->instantiate_form_fields();
|
141 |
|
144 |
|
145 |
$plugin_dir_path = plugin_dir_path( __FILE__ );
|
146 |
if ( is_admin() ) {
|
147 |
+
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
148 |
+
|
149 |
$Controller = new MW_WP_Form_Admin_Controller( $validation_rules );
|
150 |
$Controller->initialize();
|
151 |
|
166 |
}
|
167 |
}
|
168 |
|
169 |
+
public function admin_enqueue_scripts() {
|
170 |
+
$url = plugins_url( MWF_Config::NAME );
|
171 |
+
wp_enqueue_style( MWF_Config::NAME . '-admin-common', $url . '/css/admin-common.css' );
|
172 |
+
}
|
173 |
+
|
174 |
/**
|
175 |
* register_post_type
|
176 |
* 管理画面(カスタム投稿タイプ)の設定
|
197 |
|
198 |
// MW WP Form のデータベースに保存される問い合わせデータを管理する投稿タイプ
|
199 |
$Admin = new MW_WP_Form_Admin();
|
200 |
+
$forms = $Admin->get_forms_using_database();
|
201 |
foreach ( $forms as $form ) {
|
|
|
|
|
|
|
|
|
|
|
202 |
$post_type = MWF_Config::DBDATA . $form->ID;
|
203 |
register_post_type( $post_type, array(
|
204 |
'label' => $form->post_title,
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: inc2734, ryu263
|
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
Tags: plugin, form, confirm, preview, shortcode, mail, chart, graph, html, contact form, form creation, form creator, form manager, form builder, custom form
|
5 |
Requires at least: 3.7
|
6 |
-
Tested up to: 4.1
|
7 |
-
Stable tag: 2.
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -71,6 +71,19 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
|
|
71 |
|
72 |
== Changelog ==
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
= 2.2.7 =
|
75 |
* Changed : Changed to be able to use ":" as value at checkbox, select, radio.
|
76 |
|
3 |
Donate link: http://www.amazon.co.jp/registry/wishlist/39ANKRNSTNW40
|
4 |
Tags: plugin, form, confirm, preview, shortcode, mail, chart, graph, html, contact form, form creation, form creator, form manager, form builder, custom form
|
5 |
Requires at least: 3.7
|
6 |
+
Tested up to: 4.1.1
|
7 |
+
Stable tag: 2.3.0
|
8 |
License: GPLv2
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 2.3.0 =
|
75 |
+
* Refactoring mail sending part.
|
76 |
+
* Added : Add "Send value by e-mail" option for checkbox, select, radio.
|
77 |
+
* Added : Add filter hook mwform_custom_mail_tag_mw-wp-form-xxx.
|
78 |
+
* Added : Add filter hook mwform_contact_data_post_type.
|
79 |
+
* Added : Add filter hook mwform_get_inquiry_data_args-mwf_xxx
|
80 |
+
* Added : Add debug mode. no send mail and logging when set "define( 'MWFORM_DEBUG', true );".
|
81 |
+
* Added : Add filter hook mwform_log_directory.
|
82 |
+
* Changed : Refactoring admin pages.
|
83 |
+
* Changed : Changed generating method of file name that uploaded.
|
84 |
+
* Bugfix : Fixed ai, psd, eps file upload bug.
|
85 |
+
* Bugfix : Fix typo.
|
86 |
+
|
87 |
= 2.2.7 =
|
88 |
* Changed : Changed to be able to use ":" as value at checkbox, select, radio.
|
89 |
|