Contact Form 7 Multi-Step Forms - Version 2.0.6

Version Description

Thanks to @eddraw for the updates!
added translation: add pot file.
fixed translation: use the name of the plugin as textdomain and load it.

Download this release

Release Info

Developer webheadllc
Plugin Icon 128x128 Contact Form 7 Multi-Step Forms
Version 2.0.6
Comparing to
See all releases

Code changes from version 2.0.5 to 2.0.6

contact-form-7-multi-step-module.php CHANGED
@@ -4,8 +4,8 @@ Plugin Name: Contact Form 7 Multi-Step Forms
4
  Plugin URI: http://www.mymonkeydo.com/contact-form-7-multi-step-module/
5
  Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
6
  Author: Webhead LLC.
7
- Author URI: http://webheadcoder.com
8
- Version: 2.0.5
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
@@ -13,22 +13,30 @@ Version: 2.0.5
13
  modify it under the terms of the GNU General Public License
14
  as published by the Free Software Foundation; either version 2
15
  of the License, or (at your option) any later version.
16
-
17
  This program is distributed in the hope that it will be useful,
18
  but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
  GNU General Public License for more details.
21
-
22
  You should have received a copy of the GNU General Public License
23
  along with this program; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
  */
26
 
27
- define( 'CF7MSM_VERSION', '2.0.5' );
28
  define( 'CF7MSM_PLUGIN', __FILE__ );
29
  define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
30
  define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
31
 
 
 
 
 
 
 
 
 
32
 
33
  require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-multistep.php');
34
  require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-session.php');
@@ -51,7 +59,7 @@ function contact_form_7_form_codes() {
51
  } else {
52
  $out .= 'The Contact Form 7 plugin must be installed for the Contact Form 7 Multi-Step Form to work. <a href="'.admin_url('plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550').'" class="thickbox" title="Contact Form 7">Install Now.</a>';
53
  }
54
- $out .= '</p></div>';
55
  echo $out;
56
  }
57
  }
@@ -90,7 +98,7 @@ function cf7msm_load_modules() {
90
  //hack to let contact-form-7-modules be activated.
91
  //next time require it to be activated instead of copying it in!
92
  if (!is_admin() || !isset($_GET['action']) || $_GET['action'] != 'activate' ) {
93
- require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-hidden.php');
94
  }
95
  }
96
  }
@@ -107,7 +115,7 @@ function cf7msm_init_sessions() {
107
  if ( empty( $_COOKIE['cf7msm_check'] ) ) {
108
  $force_session = apply_filters('cf7msm_force_session', false);
109
  if ( !$force_session ) {
110
- setcookie('cf7msm_check', 1, 0, COOKIEPATH, COOKIE_DOMAIN);
111
  }
112
 
113
  if (!session_id()) {
@@ -115,9 +123,9 @@ function cf7msm_init_sessions() {
115
  }
116
  }
117
  }
118
- add_action('init', 'cf7msm_init_sessions');
 
119
 
120
-
121
  /**
122
  * Add scripts to be able to go back to a previous step.
123
  */
@@ -134,7 +142,7 @@ function cf7msm_scripts() {
134
  CF7MSM_VERSION
135
  );
136
 
137
- //this makes the script useful even when cookies aren't used.
138
  $cf7msm_posted_data = cf7msm_get('cf7msm_posted_data');
139
  $cf7msm_posted_data['cf7msm_prev_urls'] = cf7msm_get('cf7msm_prev_urls');
140
  wp_localize_script( 'cf7msm', 'cf7msm_posted_data', $cf7msm_posted_data);
@@ -207,19 +215,19 @@ function cf7msm_step_2($cf7) {
207
  }
208
 
209
  //check if form has a step field
210
- if (!is_admin() &&
211
  ( preg_match('/\[multistep "(\d+)-(\d+)-?(.*)"\]/', $formstring, $matches) || preg_match('/\[hidden step "(\d+)-(\d+)"\]/', $formstring, $matches) ) ) {
212
  $step = cf7msm_get('step');
213
- if ( !isset($matches[1])
214
  || ($matches[1] != 1 && empty($step) )
215
  || ($matches[1] != 1 && ((int) $step) + 1 < $matches[1]) ) {
216
  if ( $has_wpcf7_class ) {
217
- $cf7->set_properties( array(
218
- 'form' => apply_filters('wh_hide_cf7_step_message', __( 'Please fill out the form on the previous page', 'cf7msm' ), $form_id )
219
  ) );
220
  }
221
  else {
222
- $cf7->form = apply_filters('wh_hide_cf7_step_message', __( 'Please fill out the form on the previous page', 'cf7msm' ), $form_id );
223
  }
224
  }
225
  if (count($matches) >= 3 && $matches[1] != $matches[2]) {
@@ -246,7 +254,7 @@ function cf7msm_store_data_steps_filter( $cf7_posted_data ) {
246
  if ( empty($prev_urls) ) {
247
  $prev_urls = array();
248
  }
249
- //example:
250
  // on step 1,
251
  // prev url {"2-3":"page-2"} will be set.
252
  // back button is pressed, key "1-3" is looked up and returns undefined
@@ -256,7 +264,7 @@ function cf7msm_store_data_steps_filter( $cf7_posted_data ) {
256
  // on step 3,
257
  // prev url {"4-3":"page-3"} will be set. - not used
258
  // back button is pressed, key "3-3" is looked up and returns "page-2"
259
- // step
260
  $prev_urls[ ($curr_step+1) . '-' . $last_step] = cf7msm_current_url();
261
  cf7msm_set('cf7msm_prev_urls', $prev_urls);
262
 
@@ -275,7 +283,7 @@ function cf7msm_store_data_steps_filter( $cf7_posted_data ) {
275
  foreach ( $prev_data as $key => $value ) {
276
  if ( strpos( $key, CF7MSM_FREE_TEXT_PREFIX_RADIO ) === 0 ) {
277
  $free_text_keys[$key] = str_replace(CF7MSM_FREE_TEXT_PREFIX_RADIO, '', $key);
278
- }
279
  else if ( strpos( $key, CF7MSM_FREE_TEXT_PREFIX_CHECKBOX ) === 0 ) {
280
  $free_text_keys[$key] = str_replace( CF7MSM_FREE_TEXT_PREFIX_CHECKBOX, '', $key );
281
  }
@@ -381,7 +389,7 @@ function fabricate_additional_settings( $wpcf7 ) {
381
  $properties = $wpcf7->get_properties();
382
  $properties['additional_settings'] .= "\non_sent_ok: \"location.replace('" . esc_url( $redirect_url ) . "');\"
383
  ";
384
- $wpcf7->set_properties( $properties );
385
  }
386
  }
387
  }
@@ -477,4 +485,3 @@ function cf7msm_cf7_before_mail( $wpcf7 ) {
477
  }
478
  }
479
  add_action( 'wpcf7_before_send_mail', 'cf7msm_cf7_before_mail', 8 );
480
-
4
  Plugin URI: http://www.mymonkeydo.com/contact-form-7-multi-step-module/
5
  Description: Enables the Contact Form 7 plugin to create multi-page, multi-step forms.
6
  Author: Webhead LLC.
7
+ Author URI: http://webheadcoder.com
8
+ Version: 2.0.6
9
  */
10
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
11
 
13
  modify it under the terms of the GNU General Public License
14
  as published by the Free Software Foundation; either version 2
15
  of the License, or (at your option) any later version.
16
+
17
  This program is distributed in the hope that it will be useful,
18
  but WITHOUT ANY WARRANTY; without even the implied warranty of
19
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
  GNU General Public License for more details.
21
+
22
  You should have received a copy of the GNU General Public License
23
  along with this program; if not, write to the Free Software
24
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
  */
26
 
27
+ define( 'CF7MSM_VERSION', '2.0.6' );
28
  define( 'CF7MSM_PLUGIN', __FILE__ );
29
  define( 'CF7MSM_FREE_TEXT_PREFIX_RADIO', '_wpcf7_radio_free_text_' );
30
  define( 'CF7MSM_FREE_TEXT_PREFIX_CHECKBOX', '_wpcf7_checkbox_free_text_' );
31
 
32
+ /**
33
+ * Load text domain for translations
34
+ */
35
+ add_action( 'init', 'cf7msm_load_textdomain' );
36
+ function cf7msm_load_textdomain() {
37
+ load_plugin_textdomain( 'contact-form-7-multi-step-module', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
38
+ }
39
+
40
 
41
  require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-multistep.php');
42
  require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-session.php');
59
  } else {
60
  $out .= 'The Contact Form 7 plugin must be installed for the Contact Form 7 Multi-Step Form to work. <a href="'.admin_url('plugin-install.php?tab=plugin-information&plugin=contact-form-7&from=plugins&TB_iframe=true&width=600&height=550').'" class="thickbox" title="Contact Form 7">Install Now.</a>';
61
  }
62
+ $out .= '</p></div>';
63
  echo $out;
64
  }
65
  }
98
  //hack to let contact-form-7-modules be activated.
99
  //next time require it to be activated instead of copying it in!
100
  if (!is_admin() || !isset($_GET['action']) || $_GET['action'] != 'activate' ) {
101
+ require_once(plugin_dir_path(CF7MSM_PLUGIN) . 'form-tags/module-hidden.php');
102
  }
103
  }
104
  }
115
  if ( empty( $_COOKIE['cf7msm_check'] ) ) {
116
  $force_session = apply_filters('cf7msm_force_session', false);
117
  if ( !$force_session ) {
118
+ setcookie('cf7msm_check', 1, 0, COOKIEPATH, COOKIE_DOMAIN);
119
  }
120
 
121
  if (!session_id()) {
123
  }
124
  }
125
  }
126
+ add_action('init', 'cf7msm_init_sessions');
127
+
128
 
 
129
  /**
130
  * Add scripts to be able to go back to a previous step.
131
  */
142
  CF7MSM_VERSION
143
  );
144
 
145
+ //this makes the script useful even when cookies aren't used.
146
  $cf7msm_posted_data = cf7msm_get('cf7msm_posted_data');
147
  $cf7msm_posted_data['cf7msm_prev_urls'] = cf7msm_get('cf7msm_prev_urls');
148
  wp_localize_script( 'cf7msm', 'cf7msm_posted_data', $cf7msm_posted_data);
215
  }
216
 
217
  //check if form has a step field
218
+ if (!is_admin() &&
219
  ( preg_match('/\[multistep "(\d+)-(\d+)-?(.*)"\]/', $formstring, $matches) || preg_match('/\[hidden step "(\d+)-(\d+)"\]/', $formstring, $matches) ) ) {
220
  $step = cf7msm_get('step');
221
+ if ( !isset($matches[1])
222
  || ($matches[1] != 1 && empty($step) )
223
  || ($matches[1] != 1 && ((int) $step) + 1 < $matches[1]) ) {
224
  if ( $has_wpcf7_class ) {
225
+ $cf7->set_properties( array(
226
+ 'form' => apply_filters('wh_hide_cf7_step_message', __( 'Please fill out the form on the previous page', 'contact-form-7-multi-step-module' ), $form_id )
227
  ) );
228
  }
229
  else {
230
+ $cf7->form = apply_filters('wh_hide_cf7_step_message', __( 'Please fill out the form on the previous page', 'contact-form-7-multi-step-module' ), $form_id );
231
  }
232
  }
233
  if (count($matches) >= 3 && $matches[1] != $matches[2]) {
254
  if ( empty($prev_urls) ) {
255
  $prev_urls = array();
256
  }
257
+ //example:
258
  // on step 1,
259
  // prev url {"2-3":"page-2"} will be set.
260
  // back button is pressed, key "1-3" is looked up and returns undefined
264
  // on step 3,
265
  // prev url {"4-3":"page-3"} will be set. - not used
266
  // back button is pressed, key "3-3" is looked up and returns "page-2"
267
+ // step
268
  $prev_urls[ ($curr_step+1) . '-' . $last_step] = cf7msm_current_url();
269
  cf7msm_set('cf7msm_prev_urls', $prev_urls);
270
 
283
  foreach ( $prev_data as $key => $value ) {
284
  if ( strpos( $key, CF7MSM_FREE_TEXT_PREFIX_RADIO ) === 0 ) {
285
  $free_text_keys[$key] = str_replace(CF7MSM_FREE_TEXT_PREFIX_RADIO, '', $key);
286
+ }
287
  else if ( strpos( $key, CF7MSM_FREE_TEXT_PREFIX_CHECKBOX ) === 0 ) {
288
  $free_text_keys[$key] = str_replace( CF7MSM_FREE_TEXT_PREFIX_CHECKBOX, '', $key );
289
  }
389
  $properties = $wpcf7->get_properties();
390
  $properties['additional_settings'] .= "\non_sent_ok: \"location.replace('" . esc_url( $redirect_url ) . "');\"
391
  ";
392
+ $wpcf7->set_properties( $properties );
393
  }
394
  }
395
  }
485
  }
486
  }
487
  add_action( 'wpcf7_before_send_mail', 'cf7msm_cf7_before_mail', 8 );
 
form-tags/module-back.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /* Copyright 2016 Webhead LLC (email: info at webheadcoder.com)
3
-
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
-
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
-
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,9 +22,9 @@
22
  */
23
  function cf7msm_add_shortcode_back() {
24
  if (function_exists('wpcf7_add_shortcode')) {
25
- wpcf7_add_shortcode(
26
- array( 'back', 'previous' ),
27
- 'cf7msm_back_shortcode_handler'
28
  );
29
  }
30
  }
@@ -49,11 +49,11 @@ function cf7msm_back_shortcode_handler( $tag ) {
49
  $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
50
  if ( empty( $value ) ) {
51
  if ( $tag->type == 'previous') {
52
- $value = __( 'Previous', 'cf7msm' );
53
  }
54
  else {
55
  //using old version
56
- $value = __( 'Back', 'cf7msm' );
57
  }
58
  }
59
 
@@ -74,7 +74,7 @@ function cf7msm_back_shortcode_handler( $tag ) {
74
  function cf7msm_add_tag_generator_back() {
75
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
76
  $tag_generator = WPCF7_TagGenerator::get_instance();
77
- $tag_generator->add( 'previous', __( 'previous', 'cf7msm' ),
78
  'cf7msm_previous_tag_pane', array( 'nameless' => 1 ) );
79
  }
80
  else if ( function_exists( 'wpcf7_add_tag_generator' ) ) {
@@ -117,7 +117,7 @@ function cf7msm_previous_tag_pane( $contact_form, $args = '' ) {
117
  </tr>
118
 
119
  </tbody>
120
- </table>
121
  </fieldset>
122
  </div>
123
  <div class="insert-box">
@@ -165,4 +165,4 @@ function wpcf7_cf7msm_back( $contact_form ) {
165
  <?php
166
  }
167
 
168
- ?>
1
  <?php
2
  /* Copyright 2016 Webhead LLC (email: info at webheadcoder.com)
3
+
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
+
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
+
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
  */
23
  function cf7msm_add_shortcode_back() {
24
  if (function_exists('wpcf7_add_shortcode')) {
25
+ wpcf7_add_shortcode(
26
+ array( 'back', 'previous' ),
27
+ 'cf7msm_back_shortcode_handler'
28
  );
29
  }
30
  }
49
  $value = isset( $tag->values[0] ) ? $tag->values[0] : '';
50
  if ( empty( $value ) ) {
51
  if ( $tag->type == 'previous') {
52
+ $value = __( 'Previous', 'contact-form-7-multi-step-module' );
53
  }
54
  else {
55
  //using old version
56
+ $value = __( 'Back', 'contact-form-7-multi-step-module' );
57
  }
58
  }
59
 
74
  function cf7msm_add_tag_generator_back() {
75
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
76
  $tag_generator = WPCF7_TagGenerator::get_instance();
77
+ $tag_generator->add( 'previous', __( 'previous', 'contact-form-7-multi-step-module' ),
78
  'cf7msm_previous_tag_pane', array( 'nameless' => 1 ) );
79
  }
80
  else if ( function_exists( 'wpcf7_add_tag_generator' ) ) {
117
  </tr>
118
 
119
  </tbody>
120
+ </table>
121
  </fieldset>
122
  </div>
123
  <div class="insert-box">
165
  <?php
166
  }
167
 
168
+ ?>
form-tags/module-multistep.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /* Copyright 2016 Webhead LLC (email: info at webheadcoder.com)
3
-
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
-
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
-
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,10 +22,10 @@
22
  */
23
  function cf7msm_add_shortcode_multistep() {
24
  if (function_exists('wpcf7_add_shortcode')) {
25
- wpcf7_add_shortcode(
26
- array( 'multistep', 'multistep*' ),
27
- 'cf7msm_multistep_shortcode_handler',
28
- true
29
  );
30
  }
31
  }
@@ -37,7 +37,7 @@ add_action( 'wpcf7_init', 'cf7msm_add_shortcode_multistep' );
37
  function cf7msm_add_tag_generator_multistep() {
38
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
39
  $tag_generator = WPCF7_TagGenerator::get_instance();
40
- $tag_generator->add( 'multistep', __( 'multistep', 'cf7msm' ), 'cf7msm_multistep_tag_generator' );
41
  }
42
  }
43
  add_action( 'admin_init', 'cf7msm_add_tag_generator_multistep', 30 );
@@ -74,7 +74,7 @@ function cf7msm_multistep_shortcode_handler( $tag ) {
74
 
75
  //populate rest of form in hidden tags.
76
  $submission = WPCF7_Submission::get_instance();
77
-
78
  //get all posted data
79
  foreach ($_POST as $name => $value) {
80
  //add hidden elements for any not in current form.
@@ -177,7 +177,7 @@ function cf7msm_format_multistep_value( $valueString ) {
177
  }
178
  $total_steps = substr( $valueString, $i+1, $j-($i+1) );
179
  if ( !$no_url ) {
180
- $next_url = substr( $valueString, $j+1 );
181
  }
182
 
183
  return array(
1
  <?php
2
  /* Copyright 2016 Webhead LLC (email: info at webheadcoder.com)
3
+
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
+
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
+
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
  */
23
  function cf7msm_add_shortcode_multistep() {
24
  if (function_exists('wpcf7_add_shortcode')) {
25
+ wpcf7_add_shortcode(
26
+ array( 'multistep', 'multistep*' ),
27
+ 'cf7msm_multistep_shortcode_handler',
28
+ true
29
  );
30
  }
31
  }
37
  function cf7msm_add_tag_generator_multistep() {
38
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
39
  $tag_generator = WPCF7_TagGenerator::get_instance();
40
+ $tag_generator->add( 'multistep', __( 'multistep', 'contact-form-7-multi-step-module' ), 'cf7msm_multistep_tag_generator' );
41
  }
42
  }
43
  add_action( 'admin_init', 'cf7msm_add_tag_generator_multistep', 30 );
74
 
75
  //populate rest of form in hidden tags.
76
  $submission = WPCF7_Submission::get_instance();
77
+
78
  //get all posted data
79
  foreach ($_POST as $name => $value) {
80
  //add hidden elements for any not in current form.
177
  }
178
  $total_steps = substr( $valueString, $i+1, $j-($i+1) );
179
  if ( !$no_url ) {
180
+ $next_url = substr( $valueString, $j+1 );
181
  }
182
 
183
  return array(
form-tags/module-session.php CHANGED
@@ -1,16 +1,16 @@
1
  <?php
2
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
3
-
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
-
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
-
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@@ -22,10 +22,10 @@
22
  */
23
  function cf7msm_add_shortcode_form_field() {
24
  if ( function_exists( 'wpcf7_add_shortcode' ) ) {
25
- wpcf7_add_shortcode(
26
- array( 'form', 'form*', 'multiform', 'multiform*' ),
27
- 'wpcf7_form_shortcode_handler',
28
- true
29
  );
30
  }
31
  }
@@ -70,13 +70,13 @@ function wpcf7_form_shortcode_handler( $tag ) {
70
  if ( $id_att ) {
71
  $id_att = trim( $id_att );
72
  }
73
-
74
  $value = '';
75
  //return raw value, let filters sanitize if needed.
76
  $cf7msm_posted_data = cf7msm_get('cf7msm_posted_data');
77
 
78
  if ( !empty( $cf7msm_posted_data ) && is_array( $cf7msm_posted_data ) ) {
79
- $value = isset( $cf7msm_posted_data[$field_name] ) ? $cf7msm_posted_data[$field_name] : '';
80
  //check for free_text
81
  if ( !empty( $value ) ) {
82
  // if value is selected/not empty, set it to the free_text value.
@@ -91,7 +91,7 @@ function wpcf7_form_shortcode_handler( $tag ) {
91
  $value[$last_key] = $cf7msm_posted_data[CF7MSM_FREE_TEXT_PREFIX_CHECKBOX . $field_name];
92
  }
93
  else {
94
- $value = $cf7msm_posted_data[CF7MSM_FREE_TEXT_PREFIX_CHECKBOX . $field_name];
95
  }
96
  }
97
  }
@@ -110,7 +110,7 @@ function wpcf7_form_shortcode_handler( $tag ) {
110
  function cf7msm_add_tag_generator_form_field() {
111
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
112
  $tag_generator = WPCF7_TagGenerator::get_instance();
113
- $tag_generator->add( 'form-field', __( 'form field', 'cf7msm' ), 'cf7msm_form_field_tag_pane' );
114
  }
115
  else if ( function_exists( 'wpcf7_add_tag_generator' ) ) {
116
  wpcf7_add_tag_generator( 'form', __( 'Form value', 'wpcf7' ),
@@ -156,7 +156,7 @@ function cf7msm_form_field_tag_pane( $contact_form, $args = '' ) {
156
 
157
  <br class="clear" />
158
 
159
- <p class="description mail-tag"><label><?php echo esc_html( __( "This field should not be used on the Mail tab.", 'cf7msm' ) ); ?></label>
160
  </p>
161
  <?php cf7msm_form_tag_footer_text();?>
162
  </div>
@@ -188,4 +188,4 @@ function wpcf7_tg_pane_form() {
188
  <?php
189
  }
190
 
191
- ?>
1
  <?php
2
  /* Copyright 2012 Webhead LLC (email: info at webheadcoder.com)
3
+
4
  This program is free software; you can redistribute it and/or
5
  modify it under the terms of the GNU General Public License
6
  as published by the Free Software Foundation; either version 2
7
  of the License, or (at your option) any later version.
8
+
9
  This program is distributed in the hope that it will be useful,
10
  but WITHOUT ANY WARRANTY; without even the implied warranty of
11
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
  GNU General Public License for more details.
13
+
14
  You should have received a copy of the GNU General Public License
15
  along with this program; if not, write to the Free Software
16
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
  */
23
  function cf7msm_add_shortcode_form_field() {
24
  if ( function_exists( 'wpcf7_add_shortcode' ) ) {
25
+ wpcf7_add_shortcode(
26
+ array( 'form', 'form*', 'multiform', 'multiform*' ),
27
+ 'wpcf7_form_shortcode_handler',
28
+ true
29
  );
30
  }
31
  }
70
  if ( $id_att ) {
71
  $id_att = trim( $id_att );
72
  }
73
+
74
  $value = '';
75
  //return raw value, let filters sanitize if needed.
76
  $cf7msm_posted_data = cf7msm_get('cf7msm_posted_data');
77
 
78
  if ( !empty( $cf7msm_posted_data ) && is_array( $cf7msm_posted_data ) ) {
79
+ $value = isset( $cf7msm_posted_data[$field_name] ) ? $cf7msm_posted_data[$field_name] : '';
80
  //check for free_text
81
  if ( !empty( $value ) ) {
82
  // if value is selected/not empty, set it to the free_text value.
91
  $value[$last_key] = $cf7msm_posted_data[CF7MSM_FREE_TEXT_PREFIX_CHECKBOX . $field_name];
92
  }
93
  else {
94
+ $value = $cf7msm_posted_data[CF7MSM_FREE_TEXT_PREFIX_CHECKBOX . $field_name];
95
  }
96
  }
97
  }
110
  function cf7msm_add_tag_generator_form_field() {
111
  if ( class_exists( 'WPCF7_TagGenerator' ) ) {
112
  $tag_generator = WPCF7_TagGenerator::get_instance();
113
+ $tag_generator->add( 'form-field', __( 'form field', 'contact-form-7-multi-step-module' ), 'cf7msm_form_field_tag_pane' );
114
  }
115
  else if ( function_exists( 'wpcf7_add_tag_generator' ) ) {
116
  wpcf7_add_tag_generator( 'form', __( 'Form value', 'wpcf7' ),
156
 
157
  <br class="clear" />
158
 
159
+ <p class="description mail-tag"><label><?php echo esc_html( __( "This field should not be used on the Mail tab.", 'contact-form-7-multi-step-module' ) ); ?></label>
160
  </p>
161
  <?php cf7msm_form_tag_footer_text();?>
162
  </div>
188
  <?php
189
  }
190
 
191
+ ?>
languages/contact-form-7-multi-step-module.pot ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: contact-form-7-multi-step-module\n"
4
+ "POT-Creation-Date: 2016-12-03 12:55+0100\n"
5
+ "PO-Revision-Date: 2016-12-03 12:55+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: \n"
8
+ "Language: en\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Generator: Poedit 1.8.8\n"
13
+ "X-Poedit-Basepath: ..\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "X-Poedit-KeywordsList: __;_e\n"
16
+ "X-Poedit-SearchPath-0: .\n"
17
+
18
+ #: contact-form-7-multi-step-module.php:226
19
+ #: contact-form-7-multi-step-module.php:230
20
+ msgid "Please fill out the form on the previous page"
21
+ msgstr ""
22
+
23
+ #: contact-form-7-multi-step-module.php:431
24
+ #, php-format
25
+ msgid ". For more details, see %s."
26
+ msgstr ""
27
+
28
+ #: contact-form-7-multi-step-module.php:432
29
+ msgid "https://wordpress.org/plugins/contact-form-7-multi-step-module/"
30
+ msgstr ""
31
+
32
+ #: contact-form-7-multi-step-module.php:432
33
+ msgid "the plugin page on WordPress.org"
34
+ msgstr ""
35
+
36
+ #: form-tags/module-back.php:52
37
+ msgid "Previous"
38
+ msgstr ""
39
+
40
+ #: form-tags/module-back.php:56
41
+ msgid "Back"
42
+ msgstr ""
43
+
44
+ #: form-tags/module-back.php:77
45
+ msgid "previous"
46
+ msgstr ""
47
+
48
+ #: form-tags/module-back.php:81
49
+ msgid "Back button"
50
+ msgstr ""
51
+
52
+ #: form-tags/module-back.php:102 form-tags/module-back.php:155
53
+ msgid "Label"
54
+ msgstr ""
55
+
56
+ #: form-tags/module-back.php:110
57
+ msgid "Id attribute"
58
+ msgstr ""
59
+
60
+ #: form-tags/module-back.php:115
61
+ msgid "Class attribute"
62
+ msgstr ""
63
+
64
+ #: form-tags/module-back.php:127 form-tags/module-multistep.php:152
65
+ #: form-tags/module-session.php:154
66
+ msgid "Insert Tag"
67
+ msgstr ""
68
+
69
+ #: form-tags/module-back.php:132 form-tags/module-multistep.php:157
70
+ #: form-tags/module-session.php:159
71
+ msgid "This field should not be used on the Mail tab."
72
+ msgstr ""
73
+
74
+ #: form-tags/module-back.php:147 form-tags/module-back.php:150
75
+ #: form-tags/module-back.php:155 form-tags/module-hidden.php:163
76
+ #: form-tags/module-hidden.php:168 form-tags/module-session.php:178
77
+ msgid "optional"
78
+ msgstr ""
79
+
80
+ #: form-tags/module-back.php:162 form-tags/module-hidden.php:176
81
+ #: form-tags/module-session.php:183
82
+ msgid "Copy this code and paste it into the form left."
83
+ msgstr ""
84
+
85
+ #: form-tags/module-hidden.php:149
86
+ msgid "Hidden field"
87
+ msgstr ""
88
+
89
+ #: form-tags/module-hidden.php:160 form-tags/module-session.php:137
90
+ msgid "Name"
91
+ msgstr ""
92
+
93
+ #: form-tags/module-hidden.php:168
94
+ msgid "Default value"
95
+ msgstr ""
96
+
97
+ #: form-tags/module-hidden.php:171
98
+ msgid "Use this text as watermark?"
99
+ msgstr ""
100
+
101
+ #: form-tags/module-hidden.php:178
102
+ msgid "And, put this code into the Mail fields below."
103
+ msgstr ""
104
+
105
+ #: form-tags/module-multistep.php:40
106
+ msgid "multistep"
107
+ msgstr ""
108
+
109
+ #: form-tags/module-multistep.php:107
110
+ msgid "Current Step"
111
+ msgstr ""
112
+
113
+ #: form-tags/module-multistep.php:118
114
+ msgid "Total Steps"
115
+ msgstr ""
116
+
117
+ #: form-tags/module-multistep.php:130
118
+ msgid "Next Page URL"
119
+ msgstr ""
120
+
121
+ #: form-tags/module-session.php:113
122
+ msgid "form field"
123
+ msgstr ""
124
+
125
+ #: form-tags/module-session.php:116
126
+ msgid "Form value"
127
+ msgstr ""
128
+
129
+ #: form-tags/module-session.php:175
130
+ msgid "Name of previous form field"
131
+ msgstr ""
132
+
133
+ #: form-tags/module-session.php:185
134
+ msgid "Mail fields currently not supported."
135
+ msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: webheadllc
3
  Donate Link: http://webheadcoder.com/donate-cf7-multi-step-forms
4
  Tags: contact form 7, multistep form, form, multiple pages, store form, contact, multi, step
5
  Requires at least: 3.4.1
6
- Tested up to: 4.6
7
- Stable tag: 2.0.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -98,6 +98,12 @@ The `multistep` form tag is a hidden field and tries not to add any spacing to y
98
 
99
  == Changelog ==
100
 
 
 
 
 
 
 
101
  = 2.0.5 =
102
  added form id to wh_hide_cf7_step_message filter.
103
 
3
  Donate Link: http://webheadcoder.com/donate-cf7-multi-step-forms
4
  Tags: contact form 7, multistep form, form, multiple pages, store form, contact, multi, step
5
  Requires at least: 3.4.1
6
+ Tested up to: 4.6.1
7
+ Stable tag: 2.0.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
98
 
99
  == Changelog ==
100
 
101
+ = 2.0.6 =
102
+ Thanks to @eddraw for the updates!
103
+ added translation: add pot file.
104
+ fixed translation: use the name of the plugin as textdomain and load it.
105
+
106
+
107
  = 2.0.5 =
108
  added form id to wh_hide_cf7_step_message filter.
109