MW WP Form - Version 2.2.4

Version Description

  • Added : Added sortable handle in validation settings and chart settings.
  • Bug fix : Fixed a children attribute bug.
  • Bug fix : Fixed a bug that also "contact data" menu is displayed when there is no form that has been set contact data saving.
Download this release

Release Info

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

Code changes from version 2.2.3 to 2.2.4

classes/controllers/class.admin.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Name : MW WP Form Admin Controller
4
- * Version : 1.0.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
  */
@@ -220,6 +220,7 @@ class MW_WP_Form_Admin_Controller {
220
  wp_enqueue_script( MWF_Config::NAME . '-repeatable', $url . '../../js/mw-wp-form-repeatable.js' );
221
  wp_enqueue_script( MWF_Config::NAME . '-admin', $url . '../../js/admin.js' );
222
  wp_enqueue_script( 'jquery-ui-dialog' );
 
223
 
224
  global $wp_scripts;
225
  $ui = $wp_scripts->query( 'jquery-ui-core' );
1
  <?php
2
  /**
3
  * Name : MW WP Form Admin Controller
4
+ * Version : 1.0.1
5
  * Author : Takashi Kitajima
6
  * Author URI : http://2inc.org
7
  * Created : December 31, 2014
8
+ * Modified : January 20, 2015
9
  * License : GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
220
  wp_enqueue_script( MWF_Config::NAME . '-repeatable', $url . '../../js/mw-wp-form-repeatable.js' );
221
  wp_enqueue_script( MWF_Config::NAME . '-admin', $url . '../../js/admin.js' );
222
  wp_enqueue_script( 'jquery-ui-dialog' );
223
+ wp_enqueue_script( 'jquery-ui-sortable' );
224
 
225
  global $wp_scripts;
226
  $ui = $wp_scripts->query( 'jquery-ui-core' );
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.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
  */
@@ -38,6 +38,11 @@ class MW_WP_Form_Contact_Data_Controller {
38
  public function admin_menu() {
39
  $View = new MW_WP_Form_Contact_Data_View();
40
  $View->set( 'contact_data_post_types', $this->contact_data_post_types );
 
 
 
 
 
41
  add_submenu_page(
42
  'edit.php?post_type=' . MWF_Config::NAME,
43
  __( 'Inquiry data', MWF_Config::DOMAIN ), // ページタイトル
1
  <?php
2
  /**
3
  * Name : MW WP Form Contact Data Controller
4
+ * Version : 1.0.1
5
  * Author : Takashi Kitajima
6
  * Author URI : http://2inc.org
7
  * Created : December 31, 2014
8
+ * Modified : January 20, 2015
9
  * License : GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
38
  public function admin_menu() {
39
  $View = new MW_WP_Form_Contact_Data_View();
40
  $View->set( 'contact_data_post_types', $this->contact_data_post_types );
41
+
42
+ if ( empty( $this->contact_data_post_types ) ) {
43
+ return;
44
+ }
45
+
46
  add_submenu_page(
47
  'edit.php?post_type=' . MWF_Config::NAME,
48
  __( 'Inquiry data', MWF_Config::DOMAIN ), // ページタイトル
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.0
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
- * Modified : January 2, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -74,11 +74,12 @@ class MW_WP_Form_Field_Checkbox extends MW_WP_Form_Abstract_Form_Field {
74
  * @return string HTML
75
  */
76
  protected function confirm_page() {
77
- $children = $this->get_children( $this->atts['children'] );
78
- $value = $this->Form->get_checked_value( $this->atts['name'], $children );
79
- $_ret = esc_html( $value );
80
- $_ret .= $this->Form->hidden( $this->atts['name'] . '[data]', $value );
81
- $_ret .= $this->Form->separator( $this->atts['name'] );
 
82
  return $_ret;
83
  }
84
 
2
  /**
3
  * Name : MW WP Form Field Checkbox
4
  * Description: チェックボックスを出力
5
+ * Version : 1.5.1
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
+ * Modified : January 20, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
74
  * @return string HTML
75
  */
76
  protected function confirm_page() {
77
+ $children = $this->get_children( $this->atts['children'] );
78
+ $value = $this->Form->get_checked_value( $this->atts['name'], $children );
79
+ $posted_value = $this->Form->get_raw( $this->atts['name'] );
80
+ $_ret = esc_html( $value );
81
+ $_ret .= $this->Form->hidden( $this->atts['name'] . '[data]', $posted_value );
82
+ $_ret .= $this->Form->separator( $this->atts['name'] );
83
  return $_ret;
84
  }
85
 
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.0
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
- * Modified : January 2, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -71,10 +71,11 @@ class MW_WP_Form_Field_Radio extends MW_WP_Form_Abstract_Form_Field {
71
  * @return string HTML
72
  */
73
  protected function confirm_page() {
74
- $children = $this->get_children( $this->atts['children'] );
75
- $value = $this->Form->get_radio_value( $this->atts['name'], $children );
76
- $_ret = esc_html( $value );
77
- $_ret .= $this->Form->hidden( $this->atts['name'], $value );
 
78
  return $_ret;
79
  }
80
 
2
  /**
3
  * Name : MW WP Form Field Radio
4
  * Description: ラジオボタンを出力
5
+ * Version : 1.5.1
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
+ * Modified : January 20, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
71
  * @return string HTML
72
  */
73
  protected function confirm_page() {
74
+ $children = $this->get_children( $this->atts['children'] );
75
+ $value = $this->Form->get_radio_value( $this->atts['name'], $children );
76
+ $posted_value = $this->Form->get_raw( $this->atts['name'] );
77
+ $_ret = esc_html( $value );
78
+ $_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
79
  return $_ret;
80
  }
81
 
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.0
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
- * Modified : January 2, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -69,10 +69,11 @@ class MW_WP_Form_Field_Select extends MW_WP_Form_Abstract_Form_Field {
69
  * @return string HTML
70
  */
71
  protected function confirm_page() {
72
- $children = $this->get_children( $this->atts['children'] );
73
- $value = $this->Form->get_selected_value( $this->atts['name'], $children );
74
- $_ret = esc_html( $value );
75
- $_ret .= $this->Form->hidden( $this->atts['name'], $value );
 
76
  return $_ret;
77
  }
78
 
2
  /**
3
  * Name : MW WP Form Field Select
4
  * Description: セレクトボックスを出力
5
+ * Version : 1.5.1
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : December 14, 2012
9
+ * Modified : January 20, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
69
  * @return string HTML
70
  */
71
  protected function confirm_page() {
72
+ $children = $this->get_children( $this->atts['children'] );
73
+ $value = $this->Form->get_selected_value( $this->atts['name'], $children );
74
+ $posted_value = $this->Form->get_raw( $this->atts['name'] );
75
+ $_ret = esc_html( $value );
76
+ $_ret .= $this->Form->hidden( $this->atts['name'], $posted_value );
77
  return $_ret;
78
  }
79
 
classes/models/class.data.php CHANGED
@@ -2,11 +2,11 @@
2
  /**
3
  * Name : MW WP Form Data
4
  * Description: MW WP Form のデータ操作用
5
- * Version : 1.3.1
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : October 10, 2013
9
- * Modified : January 14, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
@@ -331,19 +331,19 @@ class MW_WP_Form_Data {
331
  */
332
  public function get_separated_value( $key, array $children = array() ) {
333
  $separator = $this->get_separator_value( $key );
334
- $value = $this->get_raw( $key );
335
  if ( is_array( $value ) && isset( $value['data'] ) && is_array( $value['data'] ) && !empty( $separator ) ) {
336
  if ( $children ) {
337
  $rightData = array();
338
- foreach ( $value['data'] as $child ) {
339
- if ( isset( $children[$child] ) && !in_array( $children[$child], $rightData ) ) {
340
- $rightData[] = $children[$child];
341
  }
342
  }
343
  return implode( $separator, $rightData );
344
  } else {
345
  // すべて空のからのときはimplodeしないように(---がいってしまうため)
346
- foreach ( $value['data'] as $child ) {
347
  if ( $child !== '' && $child !== null ) {
348
  return implode( $separator, $value['data'] );
349
  }
2
  /**
3
  * Name : MW WP Form Data
4
  * Description: MW WP Form のデータ操作用
5
+ * Version : 1.3.2
6
  * Author : Takashi Kitajima
7
  * Author URI : http://2inc.org
8
  * Created : October 10, 2013
9
+ * Modified : January 20, 2015
10
  * License : GPLv2
11
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
  */
331
  */
332
  public function get_separated_value( $key, array $children = array() ) {
333
  $separator = $this->get_separator_value( $key );
334
+ $value = $this->get_raw( $key );
335
  if ( is_array( $value ) && isset( $value['data'] ) && is_array( $value['data'] ) && !empty( $separator ) ) {
336
  if ( $children ) {
337
  $rightData = array();
338
+ foreach ( $value['data'] as $name => $child ) {
339
+ if ( isset( $children[$name] ) && !in_array( $children[$name], $rightData ) ) {
340
+ $rightData[] = $children[$name];
341
  }
342
  }
343
  return implode( $separator, $rightData );
344
  } else {
345
  // すべて空のからのときはimplodeしないように(---がいってしまうため)
346
+ foreach ( $value['data'] as $name => $child ) {
347
  if ( $child !== '' && $child !== null ) {
348
  return implode( $separator, $value['data'] );
349
  }
classes/views/class.admin.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Name : MW WP Form Admin View
4
- * Version : 1.0.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
  */
@@ -91,6 +91,7 @@ class MW_WP_Form_Admin_View extends MW_WP_Form_View {
91
  <div class="repeatable-boxes">
92
  <?php foreach ( $validation as $key => $value ) : $value = array_merge( $validation_keys, $value ); ?>
93
  <div class="repeatable-box" <?php if ( $key === 0 ) : ?>style="display:none"<?php endif; ?>>
 
94
  <div class="remove-btn"><b>×</b></div>
95
  <div class="open-btn"><span><?php echo esc_attr( $value['target'] ); ?></span><b>▼</b></div>
96
  <div class="repeatable-box-content">
1
  <?php
2
  /**
3
  * Name : MW WP Form Admin View
4
+ * Version : 1.0.1
5
  * Author : Takashi Kitajima
6
  * Author URI : http://2inc.org
7
  * Created : January 2, 2015
8
+ * Modified : January 20, 2015
9
  * License : GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
91
  <div class="repeatable-boxes">
92
  <?php foreach ( $validation as $key => $value ) : $value = array_merge( $validation_keys, $value ); ?>
93
  <div class="repeatable-box" <?php if ( $key === 0 ) : ?>style="display:none"<?php endif; ?>>
94
+ <div class="sortable-icon-handle"></div>
95
  <div class="remove-btn"><b>×</b></div>
96
  <div class="open-btn"><span><?php echo esc_attr( $value['target'] ); ?></span><b>▼</b></div>
97
  <div class="repeatable-box-content">
classes/views/class.chart.php CHANGED
@@ -1,11 +1,11 @@
1
  <?php
2
  /**
3
  * Name : MW WP Form Chart View
4
- * Version : 1.0.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
  */
@@ -85,6 +85,7 @@ class MW_WP_Form_Chart_View extends MW_WP_Form_View {
85
  <div class="repeatable-boxes">
86
  <?php foreach ( $postdata as $key => $value ) : ?>
87
  <div class="repeatable-box" <?php if ( $key === 0 ) : ?>style="display:none"<?php endif; ?>>
 
88
  <div class="remove-btn"><b>×</b></div>
89
  <div class="open-btn"><span><?php echo esc_html( $value['target'] ); ?></span><b>▼</b></div>
90
  <div class="repeatable-box-content">
1
  <?php
2
  /**
3
  * Name : MW WP Form Chart View
4
+ * Version : 1.0.1
5
  * Author : Takashi Kitajima
6
  * Author URI : http://2inc.org
7
  * Created : January 2, 2015
8
+ * Modified : January 20, 2015
9
  * License : GPLv2
10
  * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
  */
85
  <div class="repeatable-boxes">
86
  <?php foreach ( $postdata as $key => $value ) : ?>
87
  <div class="repeatable-box" <?php if ( $key === 0 ) : ?>style="display:none"<?php endif; ?>>
88
+ <div class="sortable-icon-handle"></div>
89
  <div class="remove-btn"><b>×</b></div>
90
  <div class="open-btn"><span><?php echo esc_html( $value['target'] ); ?></span><b>▼</b></div>
91
  <div class="repeatable-box-content">
css/admin.css CHANGED
@@ -196,6 +196,27 @@ span#formkey_field {
196
  margin: 0 0 0 10px;
197
  }
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  /**
200
  * 削除ボタン
201
  */
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
  */
images/handle.png ADDED
Binary file
js/admin-chart.js CHANGED
@@ -3,5 +3,8 @@ jQuery( function( $ ) {
3
  add_position: 'last'
4
  } );
5
 
6
- $( '#mw-wp-form_chart .repeatable-boxes' ).sortable();
 
 
 
7
  } );
3
  add_position: 'last'
4
  } );
5
 
6
+ $( '#mw-wp-form_chart .repeatable-boxes' ).sortable( {
7
+ items : '> .repeatable-box',
8
+ handle: '.sortable-icon-handle'
9
+ } );
10
  } );
js/admin.js CHANGED
@@ -9,12 +9,9 @@ jQuery( function( $ ) {
9
  $( '#mw-wp-form_complete_message_metabox input[id^="qt_mw-wp-form_complete_message_mwform_"]' ).remove();
10
  } );
11
 
12
- } );
13
-
14
- /**
15
- * フォームタグジェネレータ
16
- */
17
- jQuery( function( $ ) {
18
  function mwform_create_shortcode( dialog_id ) {
19
  var shortcode = [];
20
  var shortcode_name = dialog_id.replace( 'dialog-', '' );
@@ -71,4 +68,12 @@ jQuery( function( $ ) {
71
  var select = $( '.add-mwform-btn select' ).val();
72
  $( '#dialog-' + select ).dialog( 'open' );
73
  } );
 
 
 
 
 
 
 
 
74
  } );
9
  $( '#mw-wp-form_complete_message_metabox input[id^="qt_mw-wp-form_complete_message_mwform_"]' ).remove();
10
  } );
11
 
12
+ /**
13
+ * フォームタグジェネレータ
14
+ */
 
 
 
15
  function mwform_create_shortcode( dialog_id ) {
16
  var shortcode = [];
17
  var shortcode_name = dialog_id.replace( 'dialog-', '' );
68
  var select = $( '.add-mwform-btn select' ).val();
69
  $( '#dialog-' + select ).dialog( 'open' );
70
  } );
71
+
72
+ /**
73
+ * sortable
74
+ */
75
+ $( '#mw-wp-form_validation .repeatable-boxes' ).sortable( {
76
+ items : '> .repeatable-box',
77
+ handle: '.sortable-icon-handle'
78
+ } );
79
  } );
mw-wp-form.php CHANGED
@@ -3,11 +3,11 @@
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.2.3
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
- * Modified: January 18, 2015
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPLv2
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.2.4
7
  * Author: Takashi Kitajima
8
  * Author URI: http://2inc.org
9
  * Created : September 25, 2012
10
+ * Modified: January 20, 2015
11
  * Text Domain: mw-wp-form
12
  * Domain Path: /languages/
13
  * License: GPLv2
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.2.3
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -71,6 +71,11 @@ Do you have questions or issues with MW WP Form? Use these support channels appr
71
 
72
  == Changelog ==
73
 
 
 
 
 
 
74
  = 2.2.3 =
75
  * Bug fix : Fixed a bug that exec shortcode are not converted when use template.
76
 
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.2.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
71
 
72
  == Changelog ==
73
 
74
+ = 2.2.4 =
75
+ * Added : Added sortable handle in validation settings and chart settings.
76
+ * Bug fix : Fixed a children attribute bug.
77
+ * Bug fix : Fixed a bug that also "contact data" menu is displayed when there is no form that has been set contact data saving.
78
+
79
  = 2.2.3 =
80
  * Bug fix : Fixed a bug that exec shortcode are not converted when use template.
81