Contact Form 7 - Version 3.6

Version Description

Download this release

Release Info

Developer takayukister
Plugin Icon 128x128 Contact Form 7
Version 3.6
Comparing to
See all releases

Code changes from version 3.5.4 to 3.6

Files changed (95) hide show
  1. admin/admin.php +162 -83
  2. admin/css/styles.css +19 -2
  3. admin/edit-contact-form.php +11 -11
  4. admin/includes/class-contact-forms-list-table.php +11 -11
  5. admin/includes/meta-boxes.php +7 -7
  6. admin/js/scripts.js +17 -0
  7. includes/classes.php +70 -25
  8. includes/controller.php +3 -3
  9. includes/css/styles-rtl.css +1 -5
  10. includes/css/styles.css +1 -13
  11. includes/functions.php +159 -87
  12. includes/js/jquery.form.js +16 -3
  13. includes/js/jquery.form.min.js +2 -2
  14. includes/js/scripts.js +105 -123
  15. includes/upgrade.php +76 -0
  16. languages/{wpcf7-af.mo → contact-form-7-af.mo} +0 -0
  17. languages/{wpcf7-ar.mo → contact-form-7-ar.mo} +0 -0
  18. languages/{wpcf7-az_AZ.mo → contact-form-7-az_AZ.mo} +0 -0
  19. languages/{wpcf7-be_BY.mo → contact-form-7-be_BY.mo} +0 -0
  20. languages/{wpcf7-bg_BG.mo → contact-form-7-bg_BG.mo} +0 -0
  21. languages/{wpcf7-bn_BD.mo → contact-form-7-bn_BD.mo} +0 -0
  22. languages/{wpcf7-bn_IN.mo → contact-form-7-bn_IN.mo} +0 -0
  23. languages/{wpcf7-bs.mo → contact-form-7-bs.mo} +0 -0
  24. languages/{wpcf7-ca.mo → contact-form-7-ca.mo} +0 -0
  25. languages/{wpcf7-ckb.mo → contact-form-7-ckb.mo} +0 -0
  26. languages/{wpcf7-cs_CZ.mo → contact-form-7-cs_CZ.mo} +0 -0
  27. languages/{wpcf7-da_DK.mo → contact-form-7-da_DK.mo} +0 -0
  28. languages/{wpcf7-de_DE.mo → contact-form-7-de_DE.mo} +0 -0
  29. languages/{wpcf7-el.mo → contact-form-7-el.mo} +0 -0
  30. languages/{wpcf7-eo_EO.mo → contact-form-7-eo_EO.mo} +0 -0
  31. languages/{wpcf7-es_ES.mo → contact-form-7-es_ES.mo} +0 -0
  32. languages/{wpcf7-et.mo → contact-form-7-et.mo} +0 -0
  33. languages/{wpcf7-eu.mo → contact-form-7-eu.mo} +0 -0
  34. languages/{wpcf7-fa_IR.mo → contact-form-7-fa_IR.mo} +0 -0
  35. languages/{wpcf7-fi.mo → contact-form-7-fi.mo} +0 -0
  36. languages/{wpcf7-fr_FR.mo → contact-form-7-fr_FR.mo} +0 -0
  37. languages/{wpcf7-ga_IE.mo → contact-form-7-ga_IE.mo} +0 -0
  38. languages/{wpcf7-gl_ES.mo → contact-form-7-gl_ES.mo} +0 -0
  39. languages/{wpcf7-gu_IN.mo → contact-form-7-gu_IN.mo} +0 -0
  40. languages/{wpcf7-he_IL.mo → contact-form-7-he_IL.mo} +0 -0
  41. languages/{wpcf7-hi_IN.mo → contact-form-7-hi_IN.mo} +0 -0
  42. languages/{wpcf7-hr.mo → contact-form-7-hr.mo} +0 -0
  43. languages/{wpcf7-hu_HU.mo → contact-form-7-hu_HU.mo} +0 -0
  44. languages/{wpcf7-hy_AM.mo → contact-form-7-hy_AM.mo} +0 -0
  45. languages/{wpcf7-id_ID.mo → contact-form-7-id_ID.mo} +0 -0
  46. languages/{wpcf7-it_IT.mo → contact-form-7-it_IT.mo} +0 -0
  47. languages/contact-form-7-ja.mo +0 -0
  48. languages/{wpcf7-ka_GE.mo → contact-form-7-ka_GE.mo} +0 -0
  49. languages/{wpcf7-ko_KR.mo → contact-form-7-ko_KR.mo} +0 -0
  50. languages/{wpcf7-lt_LT.mo → contact-form-7-lt_LT.mo} +0 -0
  51. languages/{wpcf7-lv.mo → contact-form-7-lv.mo} +0 -0
  52. languages/{wpcf7-mk_MK.mo → contact-form-7-mk_MK.mo} +0 -0
  53. languages/{wpcf7-ml_IN.mo → contact-form-7-ml_IN.mo} +0 -0
  54. languages/{wpcf7-ms_MY.mo → contact-form-7-ms_MY.mo} +0 -0
  55. languages/{wpcf7-mt_MT.mo → contact-form-7-mt_MT.mo} +0 -0
  56. languages/{wpcf7-nb_NO.mo → contact-form-7-nb_NO.mo} +0 -0
  57. languages/{wpcf7-nl_NL.mo → contact-form-7-nl_NL.mo} +0 -0
  58. languages/{wpcf7-pl_PL.mo → contact-form-7-pl_PL.mo} +0 -0
  59. languages/contact-form-7-pt_BR.mo +0 -0
  60. languages/{wpcf7-pt_PT.mo → contact-form-7-pt_PT.mo} +0 -0
  61. languages/{wpcf7-ro_RO.mo → contact-form-7-ro_RO.mo} +0 -0
  62. languages/{wpcf7-ru_RU.mo → contact-form-7-ru_RU.mo} +0 -0
  63. languages/{wpcf7-si_LK.mo → contact-form-7-si_LK.mo} +0 -0
  64. languages/{wpcf7-sk_SK.mo → contact-form-7-sk_SK.mo} +0 -0
  65. languages/{wpcf7-sl_SI.mo → contact-form-7-sl_SI.mo} +0 -0
  66. languages/{wpcf7-sq.mo → contact-form-7-sq.mo} +0 -0
  67. languages/{wpcf7-sr_RS.mo → contact-form-7-sr_RS.mo} +0 -0
  68. languages/{wpcf7-sv_SE.mo → contact-form-7-sv_SE.mo} +0 -0
  69. languages/{wpcf7-ta.mo → contact-form-7-ta.mo} +0 -0
  70. languages/{wpcf7-th.mo → contact-form-7-th.mo} +0 -0
  71. languages/{wpcf7-tl.mo → contact-form-7-tl.mo} +0 -0
  72. languages/{wpcf7-tr_TR.mo → contact-form-7-tr_TR.mo} +0 -0
  73. languages/{wpcf7-uk.mo → contact-form-7-uk.mo} +0 -0
  74. languages/{wpcf7-vi.mo → contact-form-7-vi.mo} +0 -0
  75. languages/{wpcf7-zh_CN.mo → contact-form-7-zh_CN.mo} +0 -0
  76. languages/{wpcf7-zh_TW.mo → contact-form-7-zh_TW.mo} +0 -0
  77. languages/{wpcf7.pot → contact-form-7.pot} +150 -66
  78. languages/wpcf7-ja.mo +0 -0
  79. languages/wpcf7-pt_BR.mo +0 -0
  80. modules/acceptance.php +11 -9
  81. modules/captcha.php +28 -26
  82. modules/checkbox.php +14 -14
  83. modules/date.php +21 -19
  84. modules/file.php +21 -19
  85. modules/flamingo.php +107 -20
  86. modules/jetpack.php +1 -1
  87. modules/number.php +22 -20
  88. modules/quiz.php +13 -12
  89. modules/select.php +14 -12
  90. modules/submit.php +7 -7
  91. modules/text.php +27 -25
  92. modules/textarea.php +15 -13
  93. readme.txt +21 -48
  94. settings.php +20 -135
  95. wp-contact-form-7.php +4 -8
admin/admin.php CHANGED
@@ -5,15 +5,33 @@ require_once WPCF7_PLUGIN_DIR . '/admin/admin-functions.php';
5
  add_action( 'admin_menu', 'wpcf7_admin_menu', 9 );
6
 
7
  function wpcf7_admin_menu() {
8
- add_object_page( __( 'Contact Form 7', 'wpcf7' ), __( 'Contact', 'wpcf7' ),
9
- 'wpcf7_read_contact_forms', 'wpcf7', 'wpcf7_admin_management_page',
10
- wpcf7_plugin_url( 'admin/images/menu-icon.png' ) );
11
 
12
- $contact_form_admin = add_submenu_page( 'wpcf7',
13
- __( 'Edit Contact Forms', 'wpcf7' ), __( 'Edit', 'wpcf7' ),
14
- 'wpcf7_read_contact_forms', 'wpcf7', 'wpcf7_admin_management_page' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
 
16
- add_action( 'load-' . $contact_form_admin, 'wpcf7_load_contact_form_admin' );
 
 
 
 
 
 
17
  }
18
 
19
  add_filter( 'set-screen-option', 'wpcf7_set_screen_options', 10, 3 );
@@ -29,7 +47,7 @@ function wpcf7_set_screen_options( $result, $option, $value ) {
29
  }
30
 
31
  function wpcf7_load_contact_form_admin() {
32
- global $wpcf7_contact_form;
33
 
34
  $action = wpcf7_current_action();
35
 
@@ -38,7 +56,7 @@ function wpcf7_load_contact_form_admin() {
38
  check_admin_referer( 'wpcf7-save-contact-form_' . $id );
39
 
40
  if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
41
- wp_die( __( 'You are not allowed to edit this item.', 'wpcf7' ) );
42
 
43
  if ( ! $contact_form = wpcf7_contact_form( $id ) ) {
44
  $contact_form = new WPCF7_ContactForm();
@@ -111,7 +129,7 @@ function wpcf7_load_contact_form_admin() {
111
  check_admin_referer( 'wpcf7-copy-contact-form_' . $id );
112
 
113
  if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
114
- wp_die( __( 'You are not allowed to edit this item.', 'wpcf7' ) );
115
 
116
  $query = array();
117
 
@@ -152,10 +170,10 @@ function wpcf7_load_contact_form_admin() {
152
  continue;
153
 
154
  if ( ! current_user_can( 'wpcf7_delete_contact_form', $post->id ) )
155
- wp_die( __( 'You are not allowed to delete this item.', 'wpcf7' ) );
156
 
157
  if ( ! $post->delete() )
158
- wp_die( __( 'Error in deleting.', 'wpcf7' ) );
159
 
160
  $deleted += 1;
161
  }
@@ -175,11 +193,12 @@ function wpcf7_load_contact_form_admin() {
175
 
176
  $post = null;
177
 
178
- if ( 'new' == $_GET['post'] && current_user_can( 'wpcf7_edit_contact_forms' ) )
179
- $post = wpcf7_get_contact_form_default_pack(
180
- array( 'locale' => ( isset( $_GET['locale'] ) ? $_GET['locale'] : '' ) ) );
181
- elseif ( ! empty( $_GET['post'] ) )
182
  $post = wpcf7_contact_form( $_GET['post'] );
 
183
 
184
  if ( $post && current_user_can( 'wpcf7_edit_contact_form', $post->id ) ) {
185
  wpcf7_add_meta_boxes( $post->id );
@@ -194,7 +213,7 @@ function wpcf7_load_contact_form_admin() {
194
  array( 'WPCF7_Contact_Form_List_Table', 'define_columns' ) );
195
 
196
  add_screen_option( 'per_page', array(
197
- 'label' => __( 'Contact Forms', 'wpcf7' ),
198
  'default' => 20,
199
  'option' => 'cfseven_contact_forms_per_page' ) );
200
  }
@@ -210,7 +229,7 @@ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
210
 
211
  wp_enqueue_style( 'contact-form-7-admin',
212
  wpcf7_plugin_url( 'admin/css/styles.css' ),
213
- array( 'thickbox' ), WPCF7_VERSION, 'all' );
214
 
215
  if ( wpcf7_is_rtl() ) {
216
  wp_enqueue_style( 'contact-form-7-admin-rtl',
@@ -224,14 +243,14 @@ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
224
 
225
  wp_enqueue_script( 'wpcf7-admin',
226
  wpcf7_plugin_url( 'admin/js/scripts.js' ),
227
- array( 'jquery', 'thickbox', 'postbox', 'wpcf7-admin-taggenerator' ),
228
  WPCF7_VERSION, true );
229
 
230
  $current_screen = get_current_screen();
231
 
232
  wp_localize_script( 'wpcf7-admin', '_wpcf7', array(
233
  'screenId' => $current_screen->id,
234
- 'generateTag' => __( 'Generate Tag', 'wpcf7' ),
235
  'pluginUrl' => wpcf7_plugin_url(),
236
  'tagGenerators' => wpcf7_tag_generators() ) );
237
  }
@@ -256,13 +275,13 @@ function wpcf7_admin_management_page() {
256
  <?php screen_icon(); ?>
257
 
258
  <h2><?php
259
- echo esc_html( __( 'Contact Form 7', 'wpcf7' ) );
260
 
261
- echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html( __( 'Add New', 'wpcf7' ) ) . '</a>';
262
 
263
  if ( ! empty( $_REQUEST['s'] ) ) {
264
  echo sprintf( '<span class="subtitle">'
265
- . __( 'Search results for &#8220;%s&#8221;', 'wpcf7' )
266
  . '</span>', esc_html( $_REQUEST['s'] ) );
267
  }
268
  ?></h2>
@@ -271,62 +290,78 @@ function wpcf7_admin_management_page() {
271
 
272
  <form method="get" action="">
273
  <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
274
- <?php $list_table->search_box( __( 'Search Contact Forms', 'wpcf7' ), 'wpcf7-contact' ); ?>
275
  <?php $list_table->display(); ?>
276
  </form>
277
 
278
  </div>
279
  <?php
280
- wpcf7_admin_lang_select_modal();
281
  }
282
 
283
- function wpcf7_admin_lang_select_modal() {
 
 
 
 
 
 
 
 
 
 
 
284
  $available_locales = wpcf7_l10n();
285
  $default_locale = get_locale();
286
 
287
- if ( ! isset( $available_locales[$default_locale] ) )
288
  $default_locale = 'en_US';
 
289
 
290
  ?>
291
- <div id="wpcf7-lang-select-modal" class="hidden">
292
- <h4><?php echo esc_html( sprintf( __( 'Use the default language (%s)', 'wpcf7' ), $available_locales[$default_locale] ) ); ?></h4>
293
- <p><a href="<?php echo esc_url( add_query_arg( array( 'post' => 'new' ), menu_page_url( 'wpcf7', false ) ) ); ?>" class="button" /><?php echo esc_html( __( 'Add New', 'wpcf7' ) ); ?></a></p>
 
 
 
 
 
 
294
 
295
  <?php unset( $available_locales[$default_locale] ); ?>
296
- <h4><?php echo esc_html( __( 'Or', 'wpcf7' ) ); ?></h4>
297
  <form action="" method="get">
298
- <input type="hidden" name="page" value="wpcf7" />
299
- <input type="hidden" name="post" value="new" />
300
  <select name="locale">
301
- <option value="" selected="selected"><?php echo esc_html( __( '(select language)', 'wpcf7' ) ); ?></option>
302
  <?php foreach ( $available_locales as $code => $locale ) : ?>
303
  <option value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $locale ); ?></option>
304
  <?php endforeach; ?>
305
  </select>
306
- <input type="submit" class="button" value="<?php echo esc_attr( __( 'Add New', 'wpcf7' ) ); ?>" />
307
  </form>
308
  </div>
309
  <?php
310
  }
311
 
312
  function wpcf7_add_meta_boxes( $post_id ) {
313
- add_meta_box( 'formdiv', __( 'Form', 'wpcf7' ),
314
  'wpcf7_form_meta_box', null, 'form', 'core' );
315
 
316
- add_meta_box( 'maildiv', __( 'Mail', 'wpcf7' ),
317
  'wpcf7_mail_meta_box', null, 'mail', 'core' );
318
 
319
- add_meta_box( 'mail2div', __( 'Mail (2)', 'wpcf7' ),
320
  'wpcf7_mail_meta_box', null, 'mail_2', 'core',
321
  array(
322
  'id' => 'wpcf7-mail-2',
323
  'name' => 'mail_2',
324
- 'use' => __( 'Use mail (2)', 'wpcf7' ) ) );
325
 
326
- add_meta_box( 'messagesdiv', __( 'Messages', 'wpcf7' ),
327
  'wpcf7_messages_meta_box', null, 'messages', 'core' );
328
 
329
- add_meta_box( 'additionalsettingsdiv', __( 'Additional Settings', 'wpcf7' ),
330
  'wpcf7_additional_settings_meta_box', null, 'additional_settings', 'core' );
331
 
332
  do_action( 'wpcf7_add_meta_boxes', $post_id );
@@ -357,11 +392,11 @@ function wpcf7_admin_updated_message() {
357
  return;
358
 
359
  if ( 'created' == $_REQUEST['message'] )
360
- $updated_message = esc_html( __( 'Contact form created.', 'wpcf7' ) );
361
  elseif ( 'saved' == $_REQUEST['message'] )
362
- $updated_message = esc_html( __( 'Contact form saved.', 'wpcf7' ) );
363
  elseif ( 'deleted' == $_REQUEST['message'] )
364
- $updated_message = esc_html( __( 'Contact form deleted.', 'wpcf7' ) );
365
 
366
  if ( empty( $updated_message ) )
367
  return;
@@ -378,7 +413,7 @@ function wpcf7_plugin_action_links( $links, $file ) {
378
  return $links;
379
 
380
  $settings_link = '<a href="' . menu_page_url( 'wpcf7', false ) . '">'
381
- . esc_html( __( 'Settings', 'wpcf7' ) ) . '</a>';
382
 
383
  array_unshift( $links, $settings_link );
384
 
@@ -389,72 +424,116 @@ add_action( 'wpcf7_admin_notices', 'wpcf7_cf7com_links', 9 );
389
 
390
  function wpcf7_cf7com_links() {
391
  $links = '<div class="cf7com-links">'
392
- . '<a href="' . esc_url_raw( __( 'http://contactform7.com/docs/', 'wpcf7' ) ) . '" target="_blank">'
393
- . esc_html( __( 'Docs', 'wpcf7' ) ) . '</a> - '
394
- . '<a href="' . esc_url_raw( __( 'http://contactform7.com/faq/', 'wpcf7' ) ) . '" target="_blank">'
395
- . esc_html( __( 'FAQ', 'wpcf7' ) ) . '</a> - '
396
- . '<a href="' . esc_url_raw( __( 'http://contactform7.com/support/', 'wpcf7' ) ) . '" target="_blank">'
397
- . esc_html( __( 'Support', 'wpcf7' ) ) . '</a>'
 
 
398
  . '</div>';
399
 
400
  echo apply_filters( 'wpcf7_cf7com_links', $links );
401
  }
402
 
403
- add_action( 'wpcf7_admin_notices', 'wpcf7_donation_link' );
404
 
405
- function wpcf7_donation_link() {
406
- if ( ! WPCF7_SHOW_DONATION_LINK )
407
- return;
408
 
409
- if ( ! empty( $_REQUEST['post'] ) && 'new' == $_REQUEST['post'] )
410
  return;
 
411
 
412
- if ( ! empty( $_REQUEST['message'] ) )
413
- return;
414
 
415
- $show_link = true;
 
416
 
417
- $num = mt_rand( 0, 99 );
 
 
 
 
 
418
 
419
- if ( $num >= 20 )
420
- $show_link = false;
421
 
422
- $show_link = apply_filters( 'wpcf7_show_donation_link', $show_link );
 
423
 
424
- if ( ! $show_link )
425
  return;
 
426
 
427
- $texts = array(
428
- __( "Contact Form 7 needs your support. Please donate today.", 'wpcf7' ),
429
- __( "Your contribution is needed for making this plugin better.", 'wpcf7' ) );
430
 
431
- $text = $texts[array_rand( $texts )];
 
432
 
 
 
 
433
  ?>
434
- <div class="donation">
435
- <p><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/donate/', 'wpcf7' ) ); ?>"><?php echo esc_html( $text ); ?></a> <a href="<?php echo esc_url_raw( __( 'http://contactform7.com/donate/', 'wpcf7' ) ); ?>" class="button"><?php echo esc_html( __( "Donate", 'wpcf7' ) ); ?></a></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
  </div>
437
  <?php
438
  }
439
 
440
- add_action( 'admin_notices', 'wpcf7_old_wp_version_error', 9 );
441
 
442
- function wpcf7_old_wp_version_error() {
443
- global $plugin_page;
444
 
445
- if ( 'wpcf7' != $plugin_page )
446
- return;
447
 
448
- $wp_version = get_bloginfo( 'version' );
 
 
449
 
450
- if ( ! version_compare( $wp_version, WPCF7_REQUIRED_WP_VERSION, '<' ) )
451
- return;
 
452
 
453
- ?>
454
- <div class="error">
455
- <p><?php echo sprintf( __( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'wpcf7' ), WPCF7_VERSION, WPCF7_REQUIRED_WP_VERSION, admin_url( 'update-core.php' ) ); ?></p>
456
- </div>
457
- <?php
458
  }
459
 
460
  ?>
5
  add_action( 'admin_menu', 'wpcf7_admin_menu', 9 );
6
 
7
  function wpcf7_admin_menu() {
8
+ $icon_url = wpcf7_plugin_url( 'admin/images/menu-icon.png' );
 
 
9
 
10
+ if ( defined( 'MP6' ) && MP6
11
+ || version_compare( get_bloginfo( 'version' ), '3.8-dev', '>=' ) ) {
12
+ $icon_url = '';
13
+ }
14
+
15
+ add_object_page( __( 'Contact Form 7', 'contact-form-7' ),
16
+ __( 'Contact', 'contact-form-7' ),
17
+ 'wpcf7_read_contact_forms', 'wpcf7',
18
+ 'wpcf7_admin_management_page', $icon_url );
19
+
20
+ $edit = add_submenu_page( 'wpcf7',
21
+ __( 'Edit Contact Form', 'contact-form-7' ),
22
+ __( 'Contact Forms', 'contact-form-7' ),
23
+ 'wpcf7_read_contact_forms', 'wpcf7',
24
+ 'wpcf7_admin_management_page' );
25
+
26
+ add_action( 'load-' . $edit, 'wpcf7_load_contact_form_admin' );
27
 
28
+ $addnew = add_submenu_page( 'wpcf7',
29
+ __( 'Add New Contact Form', 'contact-form-7' ),
30
+ __( 'Add New', 'contact-form-7' ),
31
+ 'wpcf7_edit_contact_forms', 'wpcf7-new',
32
+ 'wpcf7_admin_add_new_page' );
33
+
34
+ add_action( 'load-' . $addnew, 'wpcf7_load_contact_form_admin' );
35
  }
36
 
37
  add_filter( 'set-screen-option', 'wpcf7_set_screen_options', 10, 3 );
47
  }
48
 
49
  function wpcf7_load_contact_form_admin() {
50
+ global $wpcf7_contact_form, $plugin_page;
51
 
52
  $action = wpcf7_current_action();
53
 
56
  check_admin_referer( 'wpcf7-save-contact-form_' . $id );
57
 
58
  if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
59
+ wp_die( __( 'You are not allowed to edit this item.', 'contact-form-7' ) );
60
 
61
  if ( ! $contact_form = wpcf7_contact_form( $id ) ) {
62
  $contact_form = new WPCF7_ContactForm();
129
  check_admin_referer( 'wpcf7-copy-contact-form_' . $id );
130
 
131
  if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
132
+ wp_die( __( 'You are not allowed to edit this item.', 'contact-form-7' ) );
133
 
134
  $query = array();
135
 
170
  continue;
171
 
172
  if ( ! current_user_can( 'wpcf7_delete_contact_form', $post->id ) )
173
+ wp_die( __( 'You are not allowed to delete this item.', 'contact-form-7' ) );
174
 
175
  if ( ! $post->delete() )
176
+ wp_die( __( 'Error in deleting.', 'contact-form-7' ) );
177
 
178
  $deleted += 1;
179
  }
193
 
194
  $post = null;
195
 
196
+ if ( 'wpcf7-new' == $plugin_page && isset( $_GET['locale'] ) ) {
197
+ $post = wpcf7_get_contact_form_default_pack( array(
198
+ 'locale' => $_GET['locale'] ) );
199
+ } elseif ( ! empty( $_GET['post'] ) ) {
200
  $post = wpcf7_contact_form( $_GET['post'] );
201
+ }
202
 
203
  if ( $post && current_user_can( 'wpcf7_edit_contact_form', $post->id ) ) {
204
  wpcf7_add_meta_boxes( $post->id );
213
  array( 'WPCF7_Contact_Form_List_Table', 'define_columns' ) );
214
 
215
  add_screen_option( 'per_page', array(
216
+ 'label' => __( 'Contact Forms', 'contact-form-7' ),
217
  'default' => 20,
218
  'option' => 'cfseven_contact_forms_per_page' ) );
219
  }
229
 
230
  wp_enqueue_style( 'contact-form-7-admin',
231
  wpcf7_plugin_url( 'admin/css/styles.css' ),
232
+ array(), WPCF7_VERSION, 'all' );
233
 
234
  if ( wpcf7_is_rtl() ) {
235
  wp_enqueue_style( 'contact-form-7-admin-rtl',
243
 
244
  wp_enqueue_script( 'wpcf7-admin',
245
  wpcf7_plugin_url( 'admin/js/scripts.js' ),
246
+ array( 'jquery', 'postbox', 'wpcf7-admin-taggenerator' ),
247
  WPCF7_VERSION, true );
248
 
249
  $current_screen = get_current_screen();
250
 
251
  wp_localize_script( 'wpcf7-admin', '_wpcf7', array(
252
  'screenId' => $current_screen->id,
253
+ 'generateTag' => __( 'Generate Tag', 'contact-form-7' ),
254
  'pluginUrl' => wpcf7_plugin_url(),
255
  'tagGenerators' => wpcf7_tag_generators() ) );
256
  }
275
  <?php screen_icon(); ?>
276
 
277
  <h2><?php
278
+ echo esc_html( __( 'Contact Forms', 'contact-form-7' ) );
279
 
280
+ echo ' <a href="' . esc_url( menu_page_url( 'wpcf7-new', false ) ) . '" class="add-new-h2">' . esc_html( __( 'Add New', 'contact-form-7' ) ) . '</a>';
281
 
282
  if ( ! empty( $_REQUEST['s'] ) ) {
283
  echo sprintf( '<span class="subtitle">'
284
+ . __( 'Search results for &#8220;%s&#8221;', 'contact-form-7' )
285
  . '</span>', esc_html( $_REQUEST['s'] ) );
286
  }
287
  ?></h2>
290
 
291
  <form method="get" action="">
292
  <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
293
+ <?php $list_table->search_box( __( 'Search Contact Forms', 'contact-form-7' ), 'wpcf7-contact' ); ?>
294
  <?php $list_table->display(); ?>
295
  </form>
296
 
297
  </div>
298
  <?php
 
299
  }
300
 
301
+ function wpcf7_admin_add_new_page() {
302
+ global $wpcf7_contact_form;
303
+
304
+ if ( $wpcf7_contact_form ) {
305
+ $post =& $wpcf7_contact_form;
306
+ $post_id = -1;
307
+
308
+ require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php';
309
+ require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php';
310
+ return;
311
+ }
312
+
313
  $available_locales = wpcf7_l10n();
314
  $default_locale = get_locale();
315
 
316
+ if ( ! isset( $available_locales[$default_locale] ) ) {
317
  $default_locale = 'en_US';
318
+ }
319
 
320
  ?>
321
+ <div class="wrap">
322
+ <?php screen_icon(); ?>
323
+
324
+ <h2><?php echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) ); ?></h2>
325
+
326
+ <?php do_action( 'wpcf7_admin_notices' ); ?>
327
+
328
+ <h3><?php echo esc_html( sprintf( __( 'Use the default language (%s)', 'contact-form-7' ), $available_locales[$default_locale] ) ); ?></h3>
329
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'locale' => $default_locale ), menu_page_url( 'wpcf7-new', false ) ) ); ?>" class="button button-primary" /><?php echo esc_html( __( 'Add New', 'contact-form-7' ) ); ?></a></p>
330
 
331
  <?php unset( $available_locales[$default_locale] ); ?>
332
+ <h3><?php echo esc_html( __( 'Or', 'contact-form-7' ) ); ?></h3>
333
  <form action="" method="get">
334
+ <input type="hidden" name="page" value="wpcf7-new" />
 
335
  <select name="locale">
336
+ <option value="" selected="selected"><?php echo esc_html( __( '(select language)', 'contact-form-7' ) ); ?></option>
337
  <?php foreach ( $available_locales as $code => $locale ) : ?>
338
  <option value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $locale ); ?></option>
339
  <?php endforeach; ?>
340
  </select>
341
+ <input type="submit" class="button" value="<?php echo esc_attr( __( 'Add New', 'contact-form-7' ) ); ?>" />
342
  </form>
343
  </div>
344
  <?php
345
  }
346
 
347
  function wpcf7_add_meta_boxes( $post_id ) {
348
+ add_meta_box( 'formdiv', __( 'Form', 'contact-form-7' ),
349
  'wpcf7_form_meta_box', null, 'form', 'core' );
350
 
351
+ add_meta_box( 'maildiv', __( 'Mail', 'contact-form-7' ),
352
  'wpcf7_mail_meta_box', null, 'mail', 'core' );
353
 
354
+ add_meta_box( 'mail2div', __( 'Mail (2)', 'contact-form-7' ),
355
  'wpcf7_mail_meta_box', null, 'mail_2', 'core',
356
  array(
357
  'id' => 'wpcf7-mail-2',
358
  'name' => 'mail_2',
359
+ 'use' => __( 'Use mail (2)', 'contact-form-7' ) ) );
360
 
361
+ add_meta_box( 'messagesdiv', __( 'Messages', 'contact-form-7' ),
362
  'wpcf7_messages_meta_box', null, 'messages', 'core' );
363
 
364
+ add_meta_box( 'additionalsettingsdiv', __( 'Additional Settings', 'contact-form-7' ),
365
  'wpcf7_additional_settings_meta_box', null, 'additional_settings', 'core' );
366
 
367
  do_action( 'wpcf7_add_meta_boxes', $post_id );
392
  return;
393
 
394
  if ( 'created' == $_REQUEST['message'] )
395
+ $updated_message = esc_html( __( 'Contact form created.', 'contact-form-7' ) );
396
  elseif ( 'saved' == $_REQUEST['message'] )
397
+ $updated_message = esc_html( __( 'Contact form saved.', 'contact-form-7' ) );
398
  elseif ( 'deleted' == $_REQUEST['message'] )
399
+ $updated_message = esc_html( __( 'Contact form deleted.', 'contact-form-7' ) );
400
 
401
  if ( empty( $updated_message ) )
402
  return;
413
  return $links;
414
 
415
  $settings_link = '<a href="' . menu_page_url( 'wpcf7', false ) . '">'
416
+ . esc_html( __( 'Settings', 'contact-form-7' ) ) . '</a>';
417
 
418
  array_unshift( $links, $settings_link );
419
 
424
 
425
  function wpcf7_cf7com_links() {
426
  $links = '<div class="cf7com-links">'
427
+ . '<a href="' . esc_url_raw( __( 'http://contactform7.com/docs/', 'contact-form-7' ) ) . '" target="_blank">'
428
+ . esc_html( __( 'Docs', 'contact-form-7' ) ) . '</a> - '
429
+ . '<a href="' . esc_url_raw( __( 'http://contactform7.com/faq/', 'contact-form-7' ) ) . '" target="_blank">'
430
+ . esc_html( __( 'FAQ', 'contact-form-7' ) ) . '</a> - '
431
+ . '<a href="' . esc_url_raw( __( 'http://contactform7.com/support/', 'contact-form-7' ) ) . '" target="_blank">'
432
+ . esc_html( __( 'Support', 'contact-form-7' ) ) . '</a> - '
433
+ . '<a href="' . esc_url_raw( __( 'http://contactform7.com/donate/', 'contact-form-7' ) ) . '" target="_blank">'
434
+ . esc_html( __( 'Donate', 'contact-form-7' ) ) . '</a>'
435
  . '</div>';
436
 
437
  echo apply_filters( 'wpcf7_cf7com_links', $links );
438
  }
439
 
440
+ add_action( 'admin_notices', 'wpcf7_old_wp_version_error', 9 );
441
 
442
+ function wpcf7_old_wp_version_error() {
443
+ global $plugin_page;
 
444
 
445
+ if ( 'wpcf7' != substr( $plugin_page, 0, 5 ) ) {
446
  return;
447
+ }
448
 
449
+ $wp_version = get_bloginfo( 'version' );
 
450
 
451
+ if ( ! version_compare( $wp_version, WPCF7_REQUIRED_WP_VERSION, '<' ) )
452
+ return;
453
 
454
+ ?>
455
+ <div class="error">
456
+ <p><?php echo sprintf( __( '<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href="%3$s">update WordPress</a> first.', 'contact-form-7' ), WPCF7_VERSION, WPCF7_REQUIRED_WP_VERSION, admin_url( 'update-core.php' ) ); ?></p>
457
+ </div>
458
+ <?php
459
+ }
460
 
461
+ add_action( 'wpcf7_admin_notices', 'wpcf7_welcome_panel', 2 );
 
462
 
463
+ function wpcf7_welcome_panel() {
464
+ global $plugin_page;
465
 
466
+ if ( 'wpcf7' != $plugin_page || ! empty( $_GET['post'] ) ) {
467
  return;
468
+ }
469
 
470
+ $classes = 'welcome-panel';
 
 
471
 
472
+ $vers = (array) get_user_meta( get_current_user_id(),
473
+ 'wpcf7_hide_welcome_panel_on', true );
474
 
475
+ if ( in_array( WPCF7_VERSION, $vers ) ) {
476
+ $classes .= ' hidden';
477
+ }
478
  ?>
479
+ <div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
480
+ <?php wp_nonce_field( 'wpcf7-welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
481
+ <a class="welcome-panel-close" href="<?php echo esc_url( menu_page_url( 'wpcf7', false ) ); ?>"><?php echo esc_html( __( 'Dismiss', 'contact-form-7' ) ); ?></a>
482
+
483
+ <div class="welcome-panel-content">
484
+ <div class="welcome-panel-column-container">
485
+ <div class="welcome-panel-column">
486
+ <h4><?php echo esc_html( __( 'Contact Form 7 Needs Your Support', 'contact-form-7' ) ); ?></h4>
487
+ <p class="message"><?php echo esc_html( __( "It is hard to continue development and support for this plugin without contributions from users like you. If you enjoy using Contact Form 7 and find it useful, please consider making a donation.", 'contact-form-7' ) ); ?></p>
488
+ <p><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/donate/', 'contact-form-7' ) ); ?>" class="button button-primary" target="_blank"><?php echo esc_html( __( 'Donate', 'contact-form-7' ) ); ?></a></p>
489
+ </div>
490
+
491
+ <div class="welcome-panel-column">
492
+ <h4><?php echo esc_html( __( 'Get Started', 'contact-form-7' ) ); ?></h4>
493
+ <ul>
494
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/getting-started-with-contact-form-7/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Getting Started with Contact Form 7", 'contact-form-7' ) ); ?></a></li>
495
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/admin-screen/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Admin Screen", 'contact-form-7' ) ); ?></a></li>
496
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/tag-syntax/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "How Tags Work", 'contact-form-7' ) ); ?></a></li>
497
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/setting-up-mail/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Setting Up Mail", 'contact-form-7' ) ); ?></a></li>
498
+ </ul>
499
+ </div>
500
+
501
+ <div class="welcome-panel-column">
502
+ <h4><?php echo esc_html( __( 'Did You Know?', 'contact-form-7' ) ); ?></h4>
503
+ <ul>
504
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/spam-filtering-with-akismet/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Spam Filtering with Akismet", 'contact-form-7' ) ); ?></a></li>
505
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/save-submitted-messages-with-flamingo/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Save Messages with Flamingo", 'contact-form-7' ) ); ?></a></li>
506
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/selectable-recipient-with-pipes/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Selectable Recipient with Pipes", 'contact-form-7' ) ); ?></a></li>
507
+ <li><a href="<?php echo esc_url_raw( __( 'http://contactform7.com/tracking-form-submissions-with-google-analytics/', 'contact-form-7' ) ); ?>" target="_blank"><?php echo esc_html( __( "Tracking with Google Analytics", 'contact-form-7' ) ); ?></a></li>
508
+ </ul>
509
+ </div>
510
+ </div>
511
+ </div>
512
  </div>
513
  <?php
514
  }
515
 
516
+ add_action( 'wp_ajax_wpcf7-update-welcome-panel', 'wpcf7_admin_ajax_welcome_panel' );
517
 
518
+ function wpcf7_admin_ajax_welcome_panel() {
519
+ check_ajax_referer( 'wpcf7-welcome-panel-nonce', 'welcomepanelnonce' );
520
 
521
+ $vers = get_user_meta( get_current_user_id(),
522
+ 'wpcf7_hide_welcome_panel_on', true );
523
 
524
+ if ( empty( $vers ) || ! is_array( $vers ) ) {
525
+ $vers = array();
526
+ }
527
 
528
+ if ( empty( $_POST['visible'] ) ) {
529
+ $vers[] = WPCF7_VERSION;
530
+ }
531
 
532
+ $vers = array_unique( $vers );
533
+
534
+ update_user_meta( get_current_user_id(), 'wpcf7_hide_welcome_panel_on', $vers );
535
+
536
+ wp_die( 1 );
537
  }
538
 
539
  ?>
admin/css/styles.css CHANGED
@@ -5,7 +5,7 @@
5
  div.wrap div.cf7com-links {
6
  text-align: right;
7
  font-size: .9em;
8
- margin: -2em 1em 1em 0;
9
  }
10
 
11
  div.wrap div.cf7com-links a {
@@ -46,6 +46,7 @@ div.wrap div.donation p a.button {
46
  position: relative;
47
  border: 1px solid #c7c7c7;
48
  padding: 6px;
 
49
  }
50
 
51
  div.save-contact-form {
@@ -84,14 +85,16 @@ input#wpcf7-title {
84
  font: bold 20px serif;
85
  cursor: pointer;
86
  background-color: transparent;
 
87
  }
88
 
89
  input#wpcf7-title.focus {
90
  color: #333;
91
- border: 1px solid #777;
92
  font: normal 13px Verdana, Arial, Helvetica, sans-serif;
93
  cursor: text;
94
  background-color: transparent;
 
95
  }
96
 
97
  input#wpcf7-title.mouseover {
@@ -264,4 +267,18 @@ div.tg-panetitle {
264
  input.shortcode-in-list-table {
265
  width: 100%;
266
  border: none;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  }
5
  div.wrap div.cf7com-links {
6
  text-align: right;
7
  font-size: .9em;
8
+ margin: -20px 1em 1em 0;
9
  }
10
 
11
  div.wrap div.cf7com-links a {
46
  position: relative;
47
  border: 1px solid #c7c7c7;
48
  padding: 6px;
49
+ background-color: #fff;
50
  }
51
 
52
  div.save-contact-form {
85
  font: bold 20px serif;
86
  cursor: pointer;
87
  background-color: transparent;
88
+ box-shadow: none;
89
  }
90
 
91
  input#wpcf7-title.focus {
92
  color: #333;
93
+ border: 1px solid #aaa;
94
  font: normal 13px Verdana, Arial, Helvetica, sans-serif;
95
  cursor: text;
96
  background-color: transparent;
97
+ box-shadow: inset 0 1px 2px rgba(0,0,0,0.07);
98
  }
99
 
100
  input#wpcf7-title.mouseover {
267
  input.shortcode-in-list-table {
268
  width: 100%;
269
  border: none;
270
+ }
271
+
272
+ /* welcome panel */
273
+ .welcome-panel p.message {
274
+ line-height: 1.4em;
275
+ margin-right: 25px;
276
+ }
277
+
278
+ .welcome-panel li {
279
+ margin-bottom: 12px;
280
+ }
281
+
282
+ .welcome-panel-close {
283
+ z-index: 2;
284
  }
admin/edit-contact-form.php CHANGED
@@ -9,10 +9,12 @@ if ( ! defined( 'ABSPATH' ) )
9
  <?php screen_icon(); ?>
10
 
11
  <h2><?php
12
- echo esc_html( __( 'Contact Form 7', 'wpcf7' ) );
 
 
 
13
 
14
- if ( ! $post->initial ) {
15
- echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html( __( 'Add New', 'wpcf7' ) ) . '</a>';
16
  }
17
  ?></h2>
18
 
@@ -44,13 +46,13 @@ if ( $post ) :
44
 
45
  <?php if ( ! $post->initial ) : ?>
46
  <p class="tagcode">
47
- <?php echo esc_html( __( "Copy this code and paste it into your post, page or text widget content.", 'wpcf7' ) ); ?><br />
48
 
49
  <input type="text" id="contact-form-anchor-text" onfocus="this.select();" readonly="readonly" />
50
  </p>
51
 
52
  <p class="tagcode" style="display: none;">
53
- <?php echo esc_html( __( "Old code is also available.", 'wpcf7' ) ); ?><br />
54
 
55
  <input type="text" id="contact-form-anchor-text-old" onfocus="this.select();" readonly="readonly" />
56
  </p>
@@ -58,21 +60,21 @@ if ( $post ) :
58
 
59
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) ) : ?>
60
  <div class="save-contact-form">
61
- <input type="submit" class="button-primary" name="wpcf7-save" value="<?php echo esc_attr( __( 'Save', 'wpcf7' ) ); ?>" />
62
  </div>
63
  <?php endif; ?>
64
 
65
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) && ! $post->initial ) : ?>
66
  <div class="actions-link">
67
  <?php $copy_nonce = wp_create_nonce( 'wpcf7-copy-contact-form_' . $post_id ); ?>
68
- <input type="submit" name="wpcf7-copy" class="copy" value="<?php echo esc_attr( __( 'Duplicate', 'wpcf7' ) ); ?>"
69
  <?php echo "onclick=\"this.form._wpnonce.value = '$copy_nonce'; this.form.action.value = 'copy'; return true;\""; ?> />
70
  |
71
 
72
  <?php $delete_nonce = wp_create_nonce( 'wpcf7-delete-contact-form_' . $post_id ); ?>
73
- <input type="submit" name="wpcf7-delete" class="delete" value="<?php echo esc_attr( __( 'Delete', 'wpcf7' ) ); ?>"
74
  <?php echo "onclick=\"if (confirm('" .
75
- esc_js( __( "You are about to delete this contact form.\n 'Cancel' to stop, 'OK' to delete.", 'wpcf7' ) ) .
76
  "')) {this.form._wpnonce.value = '$delete_nonce'; this.form.action.value = 'delete'; return true;} return false;\""; ?> />
77
  </div>
78
  <?php endif; ?>
@@ -114,6 +116,4 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
114
 
115
  </div>
116
 
117
- <?php wpcf7_admin_lang_select_modal(); ?>
118
-
119
  <?php do_action_ref_array( 'wpcf7_admin_footer', array( &$post ) ); ?>
9
  <?php screen_icon(); ?>
10
 
11
  <h2><?php
12
+ if ( $post->initial ) {
13
+ echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) );
14
+ } else {
15
+ echo esc_html( __( 'Edit Contact Form', 'contact-form-7' ) );
16
 
17
+ echo ' <a href="' . esc_url( menu_page_url( 'wpcf7-new', false ) ) . '" class="add-new-h2">' . esc_html( __( 'Add New', 'contact-form-7' ) ) . '</a>';
 
18
  }
19
  ?></h2>
20
 
46
 
47
  <?php if ( ! $post->initial ) : ?>
48
  <p class="tagcode">
49
+ <?php echo esc_html( __( "Copy this code and paste it into your post, page or text widget content.", 'contact-form-7' ) ); ?><br />
50
 
51
  <input type="text" id="contact-form-anchor-text" onfocus="this.select();" readonly="readonly" />
52
  </p>
53
 
54
  <p class="tagcode" style="display: none;">
55
+ <?php echo esc_html( __( "Old code is also available.", 'contact-form-7' ) ); ?><br />
56
 
57
  <input type="text" id="contact-form-anchor-text-old" onfocus="this.select();" readonly="readonly" />
58
  </p>
60
 
61
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) ) : ?>
62
  <div class="save-contact-form">
63
+ <input type="submit" class="button-primary" name="wpcf7-save" value="<?php echo esc_attr( __( 'Save', 'contact-form-7' ) ); ?>" />
64
  </div>
65
  <?php endif; ?>
66
 
67
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) && ! $post->initial ) : ?>
68
  <div class="actions-link">
69
  <?php $copy_nonce = wp_create_nonce( 'wpcf7-copy-contact-form_' . $post_id ); ?>
70
+ <input type="submit" name="wpcf7-copy" class="copy" value="<?php echo esc_attr( __( 'Duplicate', 'contact-form-7' ) ); ?>"
71
  <?php echo "onclick=\"this.form._wpnonce.value = '$copy_nonce'; this.form.action.value = 'copy'; return true;\""; ?> />
72
  |
73
 
74
  <?php $delete_nonce = wp_create_nonce( 'wpcf7-delete-contact-form_' . $post_id ); ?>
75
+ <input type="submit" name="wpcf7-delete" class="delete" value="<?php echo esc_attr( __( 'Delete', 'contact-form-7' ) ); ?>"
76
  <?php echo "onclick=\"if (confirm('" .
77
+ esc_js( __( "You are about to delete this contact form.\n 'Cancel' to stop, 'OK' to delete.", 'contact-form-7' ) ) .
78
  "')) {this.form._wpnonce.value = '$delete_nonce'; this.form.action.value = 'delete'; return true;} return false;\""; ?> />
79
  </div>
80
  <?php endif; ?>
116
 
117
  </div>
118
 
 
 
119
  <?php do_action_ref_array( 'wpcf7_admin_footer', array( &$post ) ); ?>
admin/includes/class-contact-forms-list-table.php CHANGED
@@ -8,10 +8,10 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
8
  public static function define_columns() {
9
  $columns = array(
10
  'cb' => '<input type="checkbox" />',
11
- 'title' => __( 'Title', 'wpcf7' ),
12
- 'shortcode' => __( 'Shortcode', 'wpcf7' ),
13
- 'author' => __( 'Author', 'wpcf7' ),
14
- 'date' => __( 'Date', 'wpcf7' ) );
15
 
16
  return $columns;
17
  }
@@ -80,7 +80,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
80
 
81
  function get_bulk_actions() {
82
  $actions = array(
83
- 'delete' => __( 'Delete', 'wpcf7' ) );
84
 
85
  return $actions;
86
  }
@@ -101,7 +101,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
101
  $edit_link = add_query_arg( array( 'action' => 'edit' ), $url );
102
 
103
  $actions = array(
104
- 'edit' => '<a href="' . $edit_link . '">' . __( 'Edit', 'wpcf7' ) . '</a>' );
105
 
106
  if ( current_user_can( 'wpcf7_edit_contact_form', $item->id ) ) {
107
  $copy_link = wp_nonce_url(
@@ -109,12 +109,12 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
109
  'wpcf7-copy-contact-form_' . absint( $item->id ) );
110
 
111
  $actions = array_merge( $actions, array(
112
- 'copy' => '<a href="' . $copy_link . '">' . __( 'Copy', 'wpcf7' ) . '</a>' ) );
113
  }
114
 
115
  $a = sprintf( '<a class="row-title" href="%1$s" title="%2$s">%3$s</a>',
116
  $edit_link,
117
- esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'wpcf7' ), $item->title ) ),
118
  esc_html( $item->title ) );
119
 
120
  return '<strong>' . $a . '</strong> ' . $this->row_actions( $actions );
@@ -151,16 +151,16 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
151
  if ( ! $post )
152
  return;
153
 
154
- $t_time = mysql2date( __( 'Y/m/d g:i:s A', 'wpcf7' ), $post->post_date, true );
155
  $m_time = $post->post_date;
156
  $time = mysql2date( 'G', $post->post_date ) - get_option( 'gmt_offset' ) * 3600;
157
 
158
  $time_diff = time() - $time;
159
 
160
  if ( $time_diff > 0 && $time_diff < 24*60*60 )
161
- $h_time = sprintf( __( '%s ago', 'wpcf7' ), human_time_diff( $time ) );
162
  else
163
- $h_time = mysql2date( __( 'Y/m/d', 'wpcf7' ), $m_time );
164
 
165
  return '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
166
  }
8
  public static function define_columns() {
9
  $columns = array(
10
  'cb' => '<input type="checkbox" />',
11
+ 'title' => __( 'Title', 'contact-form-7' ),
12
+ 'shortcode' => __( 'Shortcode', 'contact-form-7' ),
13
+ 'author' => __( 'Author', 'contact-form-7' ),
14
+ 'date' => __( 'Date', 'contact-form-7' ) );
15
 
16
  return $columns;
17
  }
80
 
81
  function get_bulk_actions() {
82
  $actions = array(
83
+ 'delete' => __( 'Delete', 'contact-form-7' ) );
84
 
85
  return $actions;
86
  }
101
  $edit_link = add_query_arg( array( 'action' => 'edit' ), $url );
102
 
103
  $actions = array(
104
+ 'edit' => '<a href="' . $edit_link . '">' . __( 'Edit', 'contact-form-7' ) . '</a>' );
105
 
106
  if ( current_user_can( 'wpcf7_edit_contact_form', $item->id ) ) {
107
  $copy_link = wp_nonce_url(
109
  'wpcf7-copy-contact-form_' . absint( $item->id ) );
110
 
111
  $actions = array_merge( $actions, array(
112
+ 'copy' => '<a href="' . $copy_link . '">' . __( 'Copy', 'contact-form-7' ) . '</a>' ) );
113
  }
114
 
115
  $a = sprintf( '<a class="row-title" href="%1$s" title="%2$s">%3$s</a>',
116
  $edit_link,
117
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'contact-form-7' ), $item->title ) ),
118
  esc_html( $item->title ) );
119
 
120
  return '<strong>' . $a . '</strong> ' . $this->row_actions( $actions );
151
  if ( ! $post )
152
  return;
153
 
154
+ $t_time = mysql2date( __( 'Y/m/d g:i:s A', 'contact-form-7' ), $post->post_date, true );
155
  $m_time = $post->post_date;
156
  $time = mysql2date( 'G', $post->post_date ) - get_option( 'gmt_offset' ) * 3600;
157
 
158
  $time_diff = time() - $time;
159
 
160
  if ( $time_diff > 0 && $time_diff < 24*60*60 )
161
+ $h_time = sprintf( __( '%s ago', 'contact-form-7' ), human_time_diff( $time ) );
162
  else
163
+ $h_time = mysql2date( __( 'Y/m/d', 'contact-form-7' ), $m_time );
164
 
165
  return '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
166
  }
admin/includes/meta-boxes.php CHANGED
@@ -41,29 +41,29 @@ function wpcf7_mail_meta_box( $post, $box ) {
41
  <div class="mail-fields">
42
  <div class="half-left">
43
  <div class="mail-field">
44
- <label for="<?php echo $id; ?>-recipient"><?php echo esc_html( __( 'To:', 'wpcf7' ) ); ?></label><br />
45
  <input type="text" id="<?php echo $id; ?>-recipient" name="<?php echo $id; ?>-recipient" class="wide" size="70" value="<?php echo esc_attr( $mail['recipient'] ); ?>" />
46
  </div>
47
 
48
  <div class="mail-field">
49
- <label for="<?php echo $id; ?>-sender"><?php echo esc_html( __( 'From:', 'wpcf7' ) ); ?></label><br />
50
  <input type="text" id="<?php echo $id; ?>-sender" name="<?php echo $id; ?>-sender" class="wide" size="70" value="<?php echo esc_attr( $mail['sender'] ); ?>" />
51
  </div>
52
 
53
  <div class="mail-field">
54
- <label for="<?php echo $id; ?>-subject"><?php echo esc_html( __( 'Subject:', 'wpcf7' ) ); ?></label><br />
55
  <input type="text" id="<?php echo $id; ?>-subject" name="<?php echo $id; ?>-subject" class="wide" size="70" value="<?php echo esc_attr( $mail['subject'] ); ?>" />
56
  </div>
57
 
58
  <div class="pseudo-hr"></div>
59
 
60
  <div class="mail-field">
61
- <label for="<?php echo $id; ?>-additional-headers"><?php echo esc_html( __( 'Additional headers:', 'wpcf7' ) ); ?></label><br />
62
  <textarea id="<?php echo $id; ?>-additional-headers" name="<?php echo $id; ?>-additional-headers" cols="100" rows="2"><?php echo esc_textarea( $mail['additional_headers'] ); ?></textarea>
63
  </div>
64
 
65
  <div class="mail-field">
66
- <label for="<?php echo $id; ?>-attachments"><?php echo esc_html( __( 'File attachments:', 'wpcf7' ) ); ?></label><br />
67
  <textarea id="<?php echo $id; ?>-attachments" name="<?php echo $id; ?>-attachments" cols="100" rows="2"><?php echo esc_textarea( $mail['attachments'] ); ?></textarea>
68
  </div>
69
 
@@ -71,13 +71,13 @@ function wpcf7_mail_meta_box( $post, $box ) {
71
 
72
  <div class="mail-field">
73
  <input type="checkbox" id="<?php echo $id; ?>-use-html" name="<?php echo $id; ?>-use-html" value="1"<?php echo ( $mail['use_html'] ) ? ' checked="checked"' : ''; ?> />
74
- <label for="<?php echo $id; ?>-use-html"><?php echo esc_html( __( 'Use HTML content type', 'wpcf7' ) ); ?></label>
75
  </div>
76
  </div>
77
 
78
  <div class="half-right">
79
  <div class="mail-field">
80
- <label for="<?php echo $id; ?>-body"><?php echo esc_html( __( 'Message body:', 'wpcf7' ) ); ?></label><br />
81
  <textarea id="<?php echo $id; ?>-body" name="<?php echo $id; ?>-body" cols="100" rows="20"><?php echo esc_textarea( $mail['body'] ); ?></textarea>
82
  </div>
83
  </div>
41
  <div class="mail-fields">
42
  <div class="half-left">
43
  <div class="mail-field">
44
+ <label for="<?php echo $id; ?>-recipient"><?php echo esc_html( __( 'To:', 'contact-form-7' ) ); ?></label><br />
45
  <input type="text" id="<?php echo $id; ?>-recipient" name="<?php echo $id; ?>-recipient" class="wide" size="70" value="<?php echo esc_attr( $mail['recipient'] ); ?>" />
46
  </div>
47
 
48
  <div class="mail-field">
49
+ <label for="<?php echo $id; ?>-sender"><?php echo esc_html( __( 'From:', 'contact-form-7' ) ); ?></label><br />
50
  <input type="text" id="<?php echo $id; ?>-sender" name="<?php echo $id; ?>-sender" class="wide" size="70" value="<?php echo esc_attr( $mail['sender'] ); ?>" />
51
  </div>
52
 
53
  <div class="mail-field">
54
+ <label for="<?php echo $id; ?>-subject"><?php echo esc_html( __( 'Subject:', 'contact-form-7' ) ); ?></label><br />
55
  <input type="text" id="<?php echo $id; ?>-subject" name="<?php echo $id; ?>-subject" class="wide" size="70" value="<?php echo esc_attr( $mail['subject'] ); ?>" />
56
  </div>
57
 
58
  <div class="pseudo-hr"></div>
59
 
60
  <div class="mail-field">
61
+ <label for="<?php echo $id; ?>-additional-headers"><?php echo esc_html( __( 'Additional headers:', 'contact-form-7' ) ); ?></label><br />
62
  <textarea id="<?php echo $id; ?>-additional-headers" name="<?php echo $id; ?>-additional-headers" cols="100" rows="2"><?php echo esc_textarea( $mail['additional_headers'] ); ?></textarea>
63
  </div>
64
 
65
  <div class="mail-field">
66
+ <label for="<?php echo $id; ?>-attachments"><?php echo esc_html( __( 'File attachments:', 'contact-form-7' ) ); ?></label><br />
67
  <textarea id="<?php echo $id; ?>-attachments" name="<?php echo $id; ?>-attachments" cols="100" rows="2"><?php echo esc_textarea( $mail['attachments'] ); ?></textarea>
68
  </div>
69
 
71
 
72
  <div class="mail-field">
73
  <input type="checkbox" id="<?php echo $id; ?>-use-html" name="<?php echo $id; ?>-use-html" value="1"<?php echo ( $mail['use_html'] ) ? ' checked="checked"' : ''; ?> />
74
+ <label for="<?php echo $id; ?>-use-html"><?php echo esc_html( __( 'Use HTML content type', 'contact-form-7' ) ); ?></label>
75
  </div>
76
  </div>
77
 
78
  <div class="half-right">
79
  <div class="mail-field">
80
+ <label for="<?php echo $id; ?>-body"><?php echo esc_html( __( 'Message body:', 'contact-form-7' ) ); ?></label><br />
81
  <textarea id="<?php echo $id; ?>-body" name="<?php echo $id; ?>-body" cols="100" rows="20"><?php echo esc_textarea( $mail['body'] ); ?></textarea>
82
  </div>
83
  </div>
admin/js/scripts.js CHANGED
@@ -2,6 +2,23 @@
2
 
3
  $(function() {
4
  try {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  $('div.cf7com-links').insertAfter($('div.wrap h2:first'));
6
 
7
  $.extend($.tgPanes, _wpcf7.tagGenerators);
2
 
3
  $(function() {
4
  try {
5
+ var welcomePanel = $('#welcome-panel');
6
+ var updateWelcomePanel;
7
+
8
+ updateWelcomePanel = function( visible ) {
9
+ $.post( ajaxurl, {
10
+ action: 'wpcf7-update-welcome-panel',
11
+ visible: visible,
12
+ welcomepanelnonce: $( '#welcomepanelnonce' ).val()
13
+ });
14
+ };
15
+
16
+ $('a.welcome-panel-close', welcomePanel).click(function(event) {
17
+ event.preventDefault();
18
+ welcomePanel.addClass('hidden');
19
+ updateWelcomePanel( 0 );
20
+ });
21
+
22
  $('div.cf7com-links').insertAfter($('div.wrap h2:first'));
23
 
24
  $.extend($.tgPanes, _wpcf7.tagGenerators);
includes/classes.php CHANGED
@@ -9,6 +9,7 @@ class WPCF7_ContactForm {
9
  var $initial = false;
10
 
11
  var $id;
 
12
  var $title;
13
 
14
  var $unit_tag;
@@ -24,8 +25,8 @@ class WPCF7_ContactForm {
24
  public static function register_post_type() {
25
  register_post_type( self::post_type, array(
26
  'labels' => array(
27
- 'name' => __( 'Contact Forms', 'wpcf7' ),
28
- 'singular_name' => __( 'Contact Form', 'wpcf7' ) ),
29
  'rewrite' => false,
30
  'query_var' => false ) );
31
  }
@@ -69,6 +70,7 @@ class WPCF7_ContactForm {
69
  if ( $post && self::post_type == get_post_type( $post ) ) {
70
  $this->initial = false;
71
  $this->id = $post->ID;
 
72
  $this->title = $post->post_title;
73
  $this->locale = get_post_meta( $post->ID, '_locale', true );
74
 
@@ -202,6 +204,7 @@ class WPCF7_ContactForm {
202
  global $wpcf7;
203
 
204
  $class = 'wpcf7-response-output';
 
205
  $content = '';
206
 
207
  if ( $this->is_posted() ) { // Post response output for non-AJAX
@@ -215,6 +218,8 @@ class WPCF7_ContactForm {
215
  else
216
  $class .= ' wpcf7-mail-sent-ng';
217
 
 
 
218
  if ( ! empty( $wpcf7->result['message'] ) )
219
  $content = $wpcf7->result['message'];
220
 
@@ -222,10 +227,14 @@ class WPCF7_ContactForm {
222
  $class .= ' wpcf7-display-none';
223
  }
224
 
225
- $class = trim( $class );
 
 
 
 
226
 
227
- $output = sprintf( '<div class="%1$s">%2$s</div>',
228
- $class, esc_html( $content ) );
229
 
230
  return apply_filters( 'wpcf7_form_response_output',
231
  $output, $class, $content, $this );
@@ -245,7 +254,9 @@ class WPCF7_ContactForm {
245
  if ( empty( $ve ) )
246
  return '';
247
 
248
- $ve = '<span class="wpcf7-not-valid-tip-no-ajax">' . esc_html( $ve ) . '</span>';
 
 
249
  return apply_filters( 'wpcf7_validation_error', $ve, $name, $this );
250
  }
251
 
@@ -361,6 +372,7 @@ class WPCF7_ContactForm {
361
 
362
  function submit( $ajax = false ) {
363
  $result = array(
 
364
  'valid' => true,
365
  'invalid_reasons' => array(),
366
  'spam' => false,
@@ -374,18 +386,22 @@ class WPCF7_ContactForm {
374
  $validation = $this->validate();
375
 
376
  if ( ! $validation['valid'] ) { // Validation error occured
 
377
  $result['valid'] = false;
378
  $result['invalid_reasons'] = $validation['reason'];
379
  $result['message'] = $this->message( 'validation_error' );
380
 
381
  } elseif ( ! $this->accepted() ) { // Not accepted terms
 
382
  $result['message'] = $this->message( 'accept_terms' );
383
 
384
  } elseif ( $this->spam() ) { // Spam!
 
385
  $result['message'] = $this->message( 'spam' );
386
  $result['spam'] = true;
387
 
388
  } elseif ( $this->mail() ) {
 
389
  $result['mail_sent'] = true;
390
  $result['message'] = $this->message( 'mail_sent_ok' );
391
 
@@ -401,6 +417,7 @@ class WPCF7_ContactForm {
401
  }
402
 
403
  } else {
 
404
  $result['message'] = $this->message( 'mail_sent_ng' );
405
 
406
  do_action_ref_array( 'wpcf7_mail_failed', array( &$this ) );
@@ -418,6 +435,8 @@ class WPCF7_ContactForm {
418
  @unlink( $path );
419
  }
420
 
 
 
421
  return $result;
422
  }
423
 
@@ -564,7 +583,10 @@ class WPCF7_ContactForm {
564
  }
565
 
566
  function replace_mail_tags( $content, $html = false ) {
567
- $regex = '/(\[?)\[\s*([a-zA-Z_][0-9a-zA-Z:._-]*)\s*\](\]?)/';
 
 
 
568
 
569
  if ( $html )
570
  $callback = array( &$this, 'mail_callback_html' );
@@ -580,11 +602,17 @@ class WPCF7_ContactForm {
580
 
581
  function mail_callback( $matches, $html = false ) {
582
  // allow [[foo]] syntax for escaping a tag
583
- if ( $matches[1] == '[' && $matches[3] == ']' )
584
  return substr( $matches[0], 1, -1 );
585
 
586
  $tag = $matches[0];
587
  $tagname = $matches[2];
 
 
 
 
 
 
588
 
589
  $do_not_heat = false;
590
 
@@ -593,6 +621,13 @@ class WPCF7_ContactForm {
593
  $do_not_heat = true;
594
  }
595
 
 
 
 
 
 
 
 
596
  if ( isset( $this->posted_data[$tagname] ) ) {
597
 
598
  if ( $do_not_heat )
@@ -600,10 +635,16 @@ class WPCF7_ContactForm {
600
  else
601
  $submitted = $this->posted_data[$tagname];
602
 
603
- $replaced = wpcf7_flat_join( $submitted );
 
 
 
 
 
 
604
 
605
  if ( $html ) {
606
- $replaced = strip_tags( $replaced );
607
  $replaced = wptexturize( $replaced );
608
  }
609
 
@@ -621,6 +662,18 @@ class WPCF7_ContactForm {
621
  return $tag;
622
  }
623
 
 
 
 
 
 
 
 
 
 
 
 
 
624
  function mail_attachments( $template ) {
625
  $attachments = array();
626
 
@@ -814,22 +867,14 @@ function wpcf7_get_contact_form_default_pack( $args = '' ) {
814
  $locale = $args['locale'];
815
  $title = $args['title'];
816
 
817
- if ( $locale && $locale != get_locale() ) {
818
- $mo_orig = $l10n['wpcf7'];
819
- unset( $l10n['wpcf7'] );
820
-
821
- if ( 'en_US' != $locale ) {
822
- $mofile = wpcf7_plugin_path( 'languages/wpcf7-' . $locale . '.mo' );
823
- if ( ! load_textdomain( 'wpcf7', $mofile ) ) {
824
- $l10n['wpcf7'] = $mo_orig;
825
- unset( $mo_orig );
826
- }
827
- }
828
  }
829
 
830
  $contact_form = new WPCF7_ContactForm();
831
  $contact_form->initial = true;
832
- $contact_form->title = ( $title ? $title : __( 'Untitled', 'wpcf7' ) );
833
  $contact_form->locale = ( $locale ? $locale : get_locale() );
834
 
835
  $props = $contact_form->get_properties();
@@ -837,12 +882,12 @@ function wpcf7_get_contact_form_default_pack( $args = '' ) {
837
  foreach ( $props as $prop => $value )
838
  $contact_form->{$prop} = wpcf7_get_default_template( $prop );
839
 
840
- if ( isset( $mo_orig ) )
841
- $l10n['wpcf7'] = $mo_orig;
842
-
843
  $contact_form = apply_filters_ref_array( 'wpcf7_contact_form_default_pack',
844
  array( &$contact_form, $args ) );
845
 
 
 
 
846
  return $contact_form;
847
  }
848
 
9
  var $initial = false;
10
 
11
  var $id;
12
+ var $name;
13
  var $title;
14
 
15
  var $unit_tag;
25
  public static function register_post_type() {
26
  register_post_type( self::post_type, array(
27
  'labels' => array(
28
+ 'name' => __( 'Contact Forms', 'contact-form-7' ),
29
+ 'singular_name' => __( 'Contact Form', 'contact-form-7' ) ),
30
  'rewrite' => false,
31
  'query_var' => false ) );
32
  }
70
  if ( $post && self::post_type == get_post_type( $post ) ) {
71
  $this->initial = false;
72
  $this->id = $post->ID;
73
+ $this->name = $post->post_name;
74
  $this->title = $post->post_title;
75
  $this->locale = get_post_meta( $post->ID, '_locale', true );
76
 
204
  global $wpcf7;
205
 
206
  $class = 'wpcf7-response-output';
207
+ $role = '';
208
  $content = '';
209
 
210
  if ( $this->is_posted() ) { // Post response output for non-AJAX
218
  else
219
  $class .= ' wpcf7-mail-sent-ng';
220
 
221
+ $role = 'alert';
222
+
223
  if ( ! empty( $wpcf7->result['message'] ) )
224
  $content = $wpcf7->result['message'];
225
 
227
  $class .= ' wpcf7-display-none';
228
  }
229
 
230
+ $atts = array(
231
+ 'class' => trim( $class ),
232
+ 'role' => trim( $role ) );
233
+
234
+ $atts = wpcf7_format_atts( $atts );
235
 
236
+ $output = sprintf( '<div %1$s>%2$s</div>',
237
+ $atts, esc_html( $content ) );
238
 
239
  return apply_filters( 'wpcf7_form_response_output',
240
  $output, $class, $content, $this );
254
  if ( empty( $ve ) )
255
  return '';
256
 
257
+ $ve = '<span role="alert" class="wpcf7-not-valid-tip">'
258
+ . esc_html( $ve ) . '</span>';
259
+
260
  return apply_filters( 'wpcf7_validation_error', $ve, $name, $this );
261
  }
262
 
372
 
373
  function submit( $ajax = false ) {
374
  $result = array(
375
+ 'status' => 'init',
376
  'valid' => true,
377
  'invalid_reasons' => array(),
378
  'spam' => false,
386
  $validation = $this->validate();
387
 
388
  if ( ! $validation['valid'] ) { // Validation error occured
389
+ $result['status'] = 'validation_failed';
390
  $result['valid'] = false;
391
  $result['invalid_reasons'] = $validation['reason'];
392
  $result['message'] = $this->message( 'validation_error' );
393
 
394
  } elseif ( ! $this->accepted() ) { // Not accepted terms
395
+ $result['status'] = 'acceptance_missing';
396
  $result['message'] = $this->message( 'accept_terms' );
397
 
398
  } elseif ( $this->spam() ) { // Spam!
399
+ $result['status'] = 'spam';
400
  $result['message'] = $this->message( 'spam' );
401
  $result['spam'] = true;
402
 
403
  } elseif ( $this->mail() ) {
404
+ $result['status'] = 'mail_sent';
405
  $result['mail_sent'] = true;
406
  $result['message'] = $this->message( 'mail_sent_ok' );
407
 
417
  }
418
 
419
  } else {
420
+ $result['status'] = 'mail_failed';
421
  $result['message'] = $this->message( 'mail_sent_ng' );
422
 
423
  do_action_ref_array( 'wpcf7_mail_failed', array( &$this ) );
435
  @unlink( $path );
436
  }
437
 
438
+ do_action_ref_array( 'wpcf7_submit', array( &$this, $result ) );
439
+
440
  return $result;
441
  }
442
 
583
  }
584
 
585
  function replace_mail_tags( $content, $html = false ) {
586
+ $regex = '/(\[?)\[[\t ]*'
587
+ . '([a-zA-Z_][0-9a-zA-Z:._-]*)' // [2] = name
588
+ . '((?:[\t ]+"[^"]*"|[\t ]+\'[^\']*\')*)' // [3] = values
589
+ . '[\t ]*\](\]?)/';
590
 
591
  if ( $html )
592
  $callback = array( &$this, 'mail_callback_html' );
602
 
603
  function mail_callback( $matches, $html = false ) {
604
  // allow [[foo]] syntax for escaping a tag
605
+ if ( $matches[1] == '[' && $matches[4] == ']' )
606
  return substr( $matches[0], 1, -1 );
607
 
608
  $tag = $matches[0];
609
  $tagname = $matches[2];
610
+ $values = $matches[3];
611
+
612
+ if ( ! empty( $values ) ) {
613
+ preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches );
614
+ $values = wpcf7_strip_quote_deep( $matches[0] );
615
+ }
616
 
617
  $do_not_heat = false;
618
 
621
  $do_not_heat = true;
622
  }
623
 
624
+ $format = '';
625
+
626
+ if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) {
627
+ $tagname = trim( $matches[1] );
628
+ $format = $values[0];
629
+ }
630
+
631
  if ( isset( $this->posted_data[$tagname] ) ) {
632
 
633
  if ( $do_not_heat )
635
  else
636
  $submitted = $this->posted_data[$tagname];
637
 
638
+ $replaced = $submitted;
639
+
640
+ if ( ! empty( $format ) ) {
641
+ $replaced = $this->format( $replaced, $format );
642
+ }
643
+
644
+ $replaced = wpcf7_flat_join( $replaced );
645
 
646
  if ( $html ) {
647
+ $replaced = esc_html( $replaced );
648
  $replaced = wptexturize( $replaced );
649
  }
650
 
662
  return $tag;
663
  }
664
 
665
+ function format( $original, $format ) {
666
+ $original = (array) $original;
667
+
668
+ foreach ( $original as $key => $value ) {
669
+ if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value ) ) {
670
+ $original[$key] = mysql2date( $format, $value );
671
+ }
672
+ }
673
+
674
+ return $original;
675
+ }
676
+
677
  function mail_attachments( $template ) {
678
  $attachments = array();
679
 
867
  $locale = $args['locale'];
868
  $title = $args['title'];
869
 
870
+ if ( $locale ) {
871
+ $mo_orig = $l10n['contact-form-7'];
872
+ wpcf7_load_textdomain( $locale );
 
 
 
 
 
 
 
 
873
  }
874
 
875
  $contact_form = new WPCF7_ContactForm();
876
  $contact_form->initial = true;
877
+ $contact_form->title = ( $title ? $title : __( 'Untitled', 'contact-form-7' ) );
878
  $contact_form->locale = ( $locale ? $locale : get_locale() );
879
 
880
  $props = $contact_form->get_properties();
882
  foreach ( $props as $prop => $value )
883
  $contact_form->{$prop} = wpcf7_get_default_template( $prop );
884
 
 
 
 
885
  $contact_form = apply_filters_ref_array( 'wpcf7_contact_form_default_pack',
886
  array( &$contact_form, $args ) );
887
 
888
+ if ( isset( $mo_orig ) )
889
+ $l10n['contact-form-7'] = $mo_orig;
890
+
891
  return $contact_form;
892
  }
893
 
includes/controller.php CHANGED
@@ -161,7 +161,7 @@ function wpcf7_widget_text_filter( $content ) {
161
 
162
  /* Shortcodes */
163
 
164
- add_action( 'plugins_loaded', 'wpcf7_add_shortcodes', 1 );
165
 
166
  function wpcf7_add_shortcodes() {
167
  add_shortcode( 'contact-form-7', 'wpcf7_contact_form_tag_func' );
@@ -228,7 +228,7 @@ function wpcf7_enqueue_scripts() {
228
  wp_deregister_script( 'jquery-form' );
229
  wp_register_script( 'jquery-form',
230
  wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),
231
- array( 'jquery' ), '3.45.0-2013.10.17', true );
232
 
233
  $in_footer = true;
234
  if ( 'header' === WPCF7_LOAD_JS )
@@ -240,7 +240,7 @@ function wpcf7_enqueue_scripts() {
240
 
241
  $_wpcf7 = array(
242
  'loaderUrl' => wpcf7_ajax_loader(),
243
- 'sending' => __( 'Sending ...', 'wpcf7' ) );
244
 
245
  if ( defined( 'WP_CACHE' ) && WP_CACHE )
246
  $_wpcf7['cached'] = 1;
161
 
162
  /* Shortcodes */
163
 
164
+ add_action( 'plugins_loaded', 'wpcf7_add_shortcodes' );
165
 
166
  function wpcf7_add_shortcodes() {
167
  add_shortcode( 'contact-form-7', 'wpcf7_contact_form_tag_func' );
228
  wp_deregister_script( 'jquery-form' );
229
  wp_register_script( 'jquery-form',
230
  wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),
231
+ array( 'jquery' ), '3.46.0-2013.11.21', true );
232
 
233
  $in_footer = true;
234
  if ( 'header' === WPCF7_LOAD_JS )
240
 
241
  $_wpcf7 = array(
242
  'loaderUrl' => wpcf7_ajax_loader(),
243
+ 'sending' => __( 'Sending ...', 'contact-form-7' ) );
244
 
245
  if ( defined( 'WP_CACHE' ) && WP_CACHE )
246
  $_wpcf7['cached'] = 1;
includes/css/styles-rtl.css CHANGED
@@ -1,11 +1,7 @@
1
  span.wpcf7-not-valid-tip {
2
- left: auto;
3
- right: 20%;
4
- direction: rtl;
5
- }
6
- span.wpcf7-not-valid-tip-no-ajax {
7
  direction: rtl;
8
  }
 
9
  span.wpcf7-list-item {
10
  margin-left: 0;
11
  margin-right: 0.5em;
1
  span.wpcf7-not-valid-tip {
 
 
 
 
 
2
  direction: rtl;
3
  }
4
+
5
  span.wpcf7-list-item {
6
  margin-left: 0;
7
  margin-right: 0.5em;
includes/css/styles.css CHANGED
@@ -29,20 +29,8 @@ span.wpcf7-form-control-wrap {
29
  }
30
 
31
  span.wpcf7-not-valid-tip {
32
- position: absolute;
33
- top: 20%;
34
- left: 20%;
35
- z-index: 100;
36
- background: #fff;
37
- border: 1px solid #ff0000;
38
- font-size: 10pt;
39
- width: 280px;
40
- padding: 2px;
41
- }
42
-
43
- span.wpcf7-not-valid-tip-no-ajax {
44
  color: #f00;
45
- font-size: 10pt;
46
  display: block;
47
  }
48
 
29
  }
30
 
31
  span.wpcf7-not-valid-tip {
 
 
 
 
 
 
 
 
 
 
 
 
32
  color: #f00;
33
+ font-size: 1em;
34
  display: block;
35
  }
36
 
includes/functions.php CHANGED
@@ -18,42 +18,42 @@ function wpcf7_deprecated_function( $function, $version, $replacement = null ) {
18
 
19
  if ( WP_DEBUG && apply_filters( 'wpcf7_deprecated_function_trigger_error', true ) ) {
20
  if ( ! is_null( $replacement ) )
21
- trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use %3$s instead.', 'wpcf7' ), $function, $version, $replacement ) );
22
  else
23
- trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s with no alternative available.', 'wpcf7' ), $function, $version ) );
24
  }
25
  }
26
 
27
  function wpcf7_messages() {
28
  $messages = array(
29
  'mail_sent_ok' => array(
30
- 'description' => __( "Sender's message was sent successfully", 'wpcf7' ),
31
- 'default' => __( 'Your message was sent successfully. Thanks.', 'wpcf7' )
32
  ),
33
 
34
  'mail_sent_ng' => array(
35
- 'description' => __( "Sender's message was failed to send", 'wpcf7' ),
36
- 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'wpcf7' )
37
  ),
38
 
39
  'validation_error' => array(
40
- 'description' => __( "Validation errors occurred", 'wpcf7' ),
41
- 'default' => __( 'Validation errors occurred. Please confirm the fields and submit it again.', 'wpcf7' )
42
  ),
43
 
44
  'spam' => array(
45
- 'description' => __( "Submission was referred to as spam", 'wpcf7' ),
46
- 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'wpcf7' )
47
  ),
48
 
49
  'accept_terms' => array(
50
- 'description' => __( "There are terms that the sender must accept", 'wpcf7' ),
51
- 'default' => __( 'Please accept the terms to proceed.', 'wpcf7' )
52
  ),
53
 
54
  'invalid_required' => array(
55
- 'description' => __( "There is a field that the sender must fill in", 'wpcf7' ),
56
- 'default' => __( 'Please fill the required field.', 'wpcf7' )
57
  )
58
  );
59
 
@@ -77,15 +77,15 @@ function wpcf7_get_default_template( $prop = 'form' ) {
77
 
78
  function wpcf7_default_form_template() {
79
  $template =
80
- '<p>' . __( 'Your Name', 'wpcf7' ) . ' ' . __( '(required)', 'wpcf7' ) . '<br />' . "\n"
81
  . ' [text* your-name] </p>' . "\n\n"
82
- . '<p>' . __( 'Your Email', 'wpcf7' ) . ' ' . __( '(required)', 'wpcf7' ) . '<br />' . "\n"
83
  . ' [email* your-email] </p>' . "\n\n"
84
- . '<p>' . __( 'Subject', 'wpcf7' ) . '<br />' . "\n"
85
  . ' [text your-subject] </p>' . "\n\n"
86
- . '<p>' . __( 'Your Message', 'wpcf7' ) . '<br />' . "\n"
87
  . ' [textarea your-message] </p>' . "\n\n"
88
- . '<p>[submit "' . __( 'Send', 'wpcf7' ) . '"]</p>';
89
 
90
  return $template;
91
  }
@@ -93,10 +93,10 @@ function wpcf7_default_form_template() {
93
  function wpcf7_default_mail_template() {
94
  $subject = '[your-subject]';
95
  $sender = '[your-name] <[your-email]>';
96
- $body = sprintf( __( 'From: %s', 'wpcf7' ), '[your-name] <[your-email]>' ) . "\n"
97
- . sprintf( __( 'Subject: %s', 'wpcf7' ), '[your-subject]' ) . "\n\n"
98
- . __( 'Message Body:', 'wpcf7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
99
- . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'wpcf7' ),
100
  get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
101
  $recipient = get_option( 'admin_email' );
102
  $additional_headers = '';
@@ -109,8 +109,8 @@ function wpcf7_default_mail_2_template() {
109
  $active = false;
110
  $subject = '[your-subject]';
111
  $sender = '[your-name] <[your-email]>';
112
- $body = __( 'Message Body:', 'wpcf7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
113
- . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'wpcf7' ),
114
  get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
115
  $recipient = '[your-email]';
116
  $additional_headers = '';
@@ -161,68 +161,68 @@ function wp_is_writable( $path ) {
161
 
162
  function wpcf7_l10n() {
163
  $l10n = array(
164
- 'af' => __( 'Afrikaans', 'wpcf7' ),
165
- 'sq' => __( 'Albanian', 'wpcf7' ),
166
- 'ar' => __( 'Arabic', 'wpcf7' ),
167
- 'hy_AM' => __( 'Armenian', 'wpcf7' ),
168
- 'az_AZ' => __( 'Azerbaijani', 'wpcf7' ),
169
- 'bn_BD' => __( 'Bangla', 'wpcf7' ),
170
- 'eu' => __( 'Basque', 'wpcf7' ),
171
- 'be_BY' => __( 'Belarusian', 'wpcf7' ),
172
- 'bs' => __( 'Bosnian', 'wpcf7' ),
173
- 'pt_BR' => __( 'Brazilian Portuguese', 'wpcf7' ),
174
- 'bg_BG' => __( 'Bulgarian', 'wpcf7' ),
175
- 'ca' => __( 'Catalan', 'wpcf7' ),
176
- 'ckb' => __( 'Central Kurdish', 'wpcf7' ),
177
- 'zh_CN' => __( 'Chinese (Simplified)', 'wpcf7' ),
178
- 'zh_TW' => __( 'Chinese (Traditional)', 'wpcf7' ),
179
- 'hr' => __( 'Croatian', 'wpcf7' ),
180
- 'cs_CZ' => __( 'Czech', 'wpcf7' ),
181
- 'da_DK' => __( 'Danish', 'wpcf7' ),
182
- 'nl_NL' => __( 'Dutch', 'wpcf7' ),
183
- 'en_US' => __( 'English', 'wpcf7' ),
184
- 'eo_EO' => __( 'Esperanto', 'wpcf7' ),
185
- 'et' => __( 'Estonian', 'wpcf7' ),
186
- 'fi' => __( 'Finnish', 'wpcf7' ),
187
- 'fr_FR' => __( 'French', 'wpcf7' ),
188
- 'gl_ES' => __( 'Galician', 'wpcf7' ),
189
- 'gu_IN' => __( 'Gujarati', 'wpcf7' ),
190
- 'ka_GE' => __( 'Georgian', 'wpcf7' ),
191
- 'de_DE' => __( 'German', 'wpcf7' ),
192
- 'el' => __( 'Greek', 'wpcf7' ),
193
- 'he_IL' => __( 'Hebrew', 'wpcf7' ),
194
- 'hi_IN' => __( 'Hindi', 'wpcf7' ),
195
- 'hu_HU' => __( 'Hungarian', 'wpcf7' ),
196
- 'bn_IN' => __( 'Indian Bengali', 'wpcf7' ),
197
- 'id_ID' => __( 'Indonesian', 'wpcf7' ),
198
- 'ga_IE' => __( 'Irish', 'wpcf7' ),
199
- 'it_IT' => __( 'Italian', 'wpcf7' ),
200
- 'ja' => __( 'Japanese', 'wpcf7' ),
201
- 'ko_KR' => __( 'Korean', 'wpcf7' ),
202
- 'lv' => __( 'Latvian', 'wpcf7' ),
203
- 'lt_LT' => __( 'Lithuanian', 'wpcf7' ),
204
- 'mk_MK' => __( 'Macedonian', 'wpcf7' ),
205
- 'ms_MY' => __( 'Malay', 'wpcf7' ),
206
- 'ml_IN' => __( 'Malayalam', 'wpcf7' ),
207
- 'mt_MT' => __( 'Maltese', 'wpcf7' ),
208
- 'nb_NO' => __( 'Norwegian', 'wpcf7' ),
209
- 'fa_IR' => __( 'Persian', 'wpcf7' ),
210
- 'pl_PL' => __( 'Polish', 'wpcf7' ),
211
- 'pt_PT' => __( 'Portuguese', 'wpcf7' ),
212
- 'ru_RU' => __( 'Russian', 'wpcf7' ),
213
- 'ro_RO' => __( 'Romanian', 'wpcf7' ),
214
- 'sr_RS' => __( 'Serbian', 'wpcf7' ),
215
- 'si_LK' => __( 'Sinhala', 'wpcf7' ),
216
- 'sk_SK' => __( 'Slovak', 'wpcf7' ),
217
- 'sl_SI' => __( 'Slovene', 'wpcf7' ),
218
- 'es_ES' => __( 'Spanish', 'wpcf7' ),
219
- 'sv_SE' => __( 'Swedish', 'wpcf7' ),
220
- 'ta' => __( 'Tamil', 'wpcf7' ),
221
- 'th' => __( 'Thai', 'wpcf7' ),
222
- 'tl' => __( 'Tagalog', 'wpcf7' ),
223
- 'tr_TR' => __( 'Turkish', 'wpcf7' ),
224
- 'uk' => __( 'Ukrainian', 'wpcf7' ),
225
- 'vi' => __( 'Vietnamese', 'wpcf7' )
226
  );
227
 
228
  return $l10n;
@@ -331,4 +331,76 @@ function wpcf7_format_atts( $atts ) {
331
  return $html;
332
  }
333
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
334
  ?>
18
 
19
  if ( WP_DEBUG && apply_filters( 'wpcf7_deprecated_function_trigger_error', true ) ) {
20
  if ( ! is_null( $replacement ) )
21
+ trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use %3$s instead.', 'contact-form-7' ), $function, $version, $replacement ) );
22
  else
23
+ trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s with no alternative available.', 'contact-form-7' ), $function, $version ) );
24
  }
25
  }
26
 
27
  function wpcf7_messages() {
28
  $messages = array(
29
  'mail_sent_ok' => array(
30
+ 'description' => __( "Sender's message was sent successfully", 'contact-form-7' ),
31
+ 'default' => __( 'Your message was sent successfully. Thanks.', 'contact-form-7' )
32
  ),
33
 
34
  'mail_sent_ng' => array(
35
+ 'description' => __( "Sender's message was failed to send", 'contact-form-7' ),
36
+ 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'contact-form-7' )
37
  ),
38
 
39
  'validation_error' => array(
40
+ 'description' => __( "Validation errors occurred", 'contact-form-7' ),
41
+ 'default' => __( 'Validation errors occurred. Please confirm the fields and submit it again.', 'contact-form-7' )
42
  ),
43
 
44
  'spam' => array(
45
+ 'description' => __( "Submission was referred to as spam", 'contact-form-7' ),
46
+ 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'contact-form-7' )
47
  ),
48
 
49
  'accept_terms' => array(
50
+ 'description' => __( "There are terms that the sender must accept", 'contact-form-7' ),
51
+ 'default' => __( 'Please accept the terms to proceed.', 'contact-form-7' )
52
  ),
53
 
54
  'invalid_required' => array(
55
+ 'description' => __( "There is a field that the sender must fill in", 'contact-form-7' ),
56
+ 'default' => __( 'Please fill the required field.', 'contact-form-7' )
57
  )
58
  );
59
 
77
 
78
  function wpcf7_default_form_template() {
79
  $template =
80
+ '<p>' . __( 'Your Name', 'contact-form-7' ) . ' ' . __( '(required)', 'contact-form-7' ) . '<br />' . "\n"
81
  . ' [text* your-name] </p>' . "\n\n"
82
+ . '<p>' . __( 'Your Email', 'contact-form-7' ) . ' ' . __( '(required)', 'contact-form-7' ) . '<br />' . "\n"
83
  . ' [email* your-email] </p>' . "\n\n"
84
+ . '<p>' . __( 'Subject', 'contact-form-7' ) . '<br />' . "\n"
85
  . ' [text your-subject] </p>' . "\n\n"
86
+ . '<p>' . __( 'Your Message', 'contact-form-7' ) . '<br />' . "\n"
87
  . ' [textarea your-message] </p>' . "\n\n"
88
+ . '<p>[submit "' . __( 'Send', 'contact-form-7' ) . '"]</p>';
89
 
90
  return $template;
91
  }
93
  function wpcf7_default_mail_template() {
94
  $subject = '[your-subject]';
95
  $sender = '[your-name] <[your-email]>';
96
+ $body = sprintf( __( 'From: %s', 'contact-form-7' ), '[your-name] <[your-email]>' ) . "\n"
97
+ . sprintf( __( 'Subject: %s', 'contact-form-7' ), '[your-subject]' ) . "\n\n"
98
+ . __( 'Message Body:', 'contact-form-7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
99
+ . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
100
  get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
101
  $recipient = get_option( 'admin_email' );
102
  $additional_headers = '';
109
  $active = false;
110
  $subject = '[your-subject]';
111
  $sender = '[your-name] <[your-email]>';
112
+ $body = __( 'Message Body:', 'contact-form-7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
113
+ . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
114
  get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
115
  $recipient = '[your-email]';
116
  $additional_headers = '';
161
 
162
  function wpcf7_l10n() {
163
  $l10n = array(
164
+ 'af' => __( 'Afrikaans', 'contact-form-7' ),
165
+ 'sq' => __( 'Albanian', 'contact-form-7' ),
166
+ 'ar' => __( 'Arabic', 'contact-form-7' ),
167
+ 'hy_AM' => __( 'Armenian', 'contact-form-7' ),
168
+ 'az_AZ' => __( 'Azerbaijani', 'contact-form-7' ),
169
+ 'bn_BD' => __( 'Bangla', 'contact-form-7' ),
170
+ 'eu' => __( 'Basque', 'contact-form-7' ),
171
+ 'be_BY' => __( 'Belarusian', 'contact-form-7' ),
172
+ 'bs' => __( 'Bosnian', 'contact-form-7' ),
173
+ 'pt_BR' => __( 'Brazilian Portuguese', 'contact-form-7' ),
174
+ 'bg_BG' => __( 'Bulgarian', 'contact-form-7' ),
175
+ 'ca' => __( 'Catalan', 'contact-form-7' ),
176
+ 'ckb' => __( 'Central Kurdish', 'contact-form-7' ),
177
+ 'zh_CN' => __( 'Chinese (Simplified)', 'contact-form-7' ),
178
+ 'zh_TW' => __( 'Chinese (Traditional)', 'contact-form-7' ),
179
+ 'hr' => __( 'Croatian', 'contact-form-7' ),
180
+ 'cs_CZ' => __( 'Czech', 'contact-form-7' ),
181
+ 'da_DK' => __( 'Danish', 'contact-form-7' ),
182
+ 'nl_NL' => __( 'Dutch', 'contact-form-7' ),
183
+ 'en_US' => __( 'English', 'contact-form-7' ),
184
+ 'eo_EO' => __( 'Esperanto', 'contact-form-7' ),
185
+ 'et' => __( 'Estonian', 'contact-form-7' ),
186
+ 'fi' => __( 'Finnish', 'contact-form-7' ),
187
+ 'fr_FR' => __( 'French', 'contact-form-7' ),
188
+ 'gl_ES' => __( 'Galician', 'contact-form-7' ),
189
+ 'gu_IN' => __( 'Gujarati', 'contact-form-7' ),
190
+ 'ka_GE' => __( 'Georgian', 'contact-form-7' ),
191
+ 'de_DE' => __( 'German', 'contact-form-7' ),
192
+ 'el' => __( 'Greek', 'contact-form-7' ),
193
+ 'he_IL' => __( 'Hebrew', 'contact-form-7' ),
194
+ 'hi_IN' => __( 'Hindi', 'contact-form-7' ),
195
+ 'hu_HU' => __( 'Hungarian', 'contact-form-7' ),
196
+ 'bn_IN' => __( 'Indian Bengali', 'contact-form-7' ),
197
+ 'id_ID' => __( 'Indonesian', 'contact-form-7' ),
198
+ 'ga_IE' => __( 'Irish', 'contact-form-7' ),
199
+ 'it_IT' => __( 'Italian', 'contact-form-7' ),
200
+ 'ja' => __( 'Japanese', 'contact-form-7' ),
201
+ 'ko_KR' => __( 'Korean', 'contact-form-7' ),
202
+ 'lv' => __( 'Latvian', 'contact-form-7' ),
203
+ 'lt_LT' => __( 'Lithuanian', 'contact-form-7' ),
204
+ 'mk_MK' => __( 'Macedonian', 'contact-form-7' ),
205
+ 'ms_MY' => __( 'Malay', 'contact-form-7' ),
206
+ 'ml_IN' => __( 'Malayalam', 'contact-form-7' ),
207
+ 'mt_MT' => __( 'Maltese', 'contact-form-7' ),
208
+ 'nb_NO' => __( 'Norwegian', 'contact-form-7' ),
209
+ 'fa_IR' => __( 'Persian', 'contact-form-7' ),
210
+ 'pl_PL' => __( 'Polish', 'contact-form-7' ),
211
+ 'pt_PT' => __( 'Portuguese', 'contact-form-7' ),
212
+ 'ru_RU' => __( 'Russian', 'contact-form-7' ),
213
+ 'ro_RO' => __( 'Romanian', 'contact-form-7' ),
214
+ 'sr_RS' => __( 'Serbian', 'contact-form-7' ),
215
+ 'si_LK' => __( 'Sinhala', 'contact-form-7' ),
216
+ 'sk_SK' => __( 'Slovak', 'contact-form-7' ),
217
+ 'sl_SI' => __( 'Slovene', 'contact-form-7' ),
218
+ 'es_ES' => __( 'Spanish', 'contact-form-7' ),
219
+ 'sv_SE' => __( 'Swedish', 'contact-form-7' ),
220
+ 'ta' => __( 'Tamil', 'contact-form-7' ),
221
+ 'th' => __( 'Thai', 'contact-form-7' ),
222
+ 'tl' => __( 'Tagalog', 'contact-form-7' ),
223
+ 'tr_TR' => __( 'Turkish', 'contact-form-7' ),
224
+ 'uk' => __( 'Ukrainian', 'contact-form-7' ),
225
+ 'vi' => __( 'Vietnamese', 'contact-form-7' )
226
  );
227
 
228
  return $l10n;
331
  return $html;
332
  }
333
 
334
+ function wpcf7_load_textdomain( $locale = null ) {
335
+ global $l10n;
336
+
337
+ $domain = 'contact-form-7';
338
+
339
+ if ( get_locale() == $locale ) {
340
+ $locale = null;
341
+ }
342
+
343
+ if ( empty( $locale ) ) {
344
+ if ( is_textdomain_loaded( $domain ) ) {
345
+ return true;
346
+ } else {
347
+ return load_plugin_textdomain( $domain, false, $domain . '/languages' );
348
+ }
349
+ } else {
350
+ $mo_orig = $l10n[$domain];
351
+ unload_textdomain( $domain );
352
+
353
+ $mofile = $domain . '-' . $locale . '.mo';
354
+ $path = WP_PLUGIN_DIR . '/' . $domain . '/languages';
355
+
356
+ if ( $loaded = load_textdomain( $domain, $path . '/'. $mofile ) ) {
357
+ return $loaded;
358
+ } else {
359
+ $mofile = WP_LANG_DIR . '/plugins/' . $mofile;
360
+ return load_textdomain( $domain, $mofile );
361
+ }
362
+
363
+ $l10n[$domain] = $mo_orig;
364
+ }
365
+
366
+ return false;
367
+ }
368
+
369
+ function wpcf7_load_modules() {
370
+ $dir = WPCF7_PLUGIN_MODULES_DIR;
371
+
372
+ if ( empty( $dir ) || ! is_dir( $dir ) ) {
373
+ return false;
374
+ }
375
+
376
+ $mods = array(
377
+ 'acceptance', 'flamingo', 'special-mail-tags',
378
+ 'akismet', 'jetpack', 'submit', 'captcha', 'number',
379
+ 'text', 'checkbox', 'quiz', 'textarea', 'date',
380
+ 'response', 'file', 'select' );
381
+
382
+ foreach ( $mods as $mod ) {
383
+ $file = trailingslashit( $dir ) . $mod . '.php';
384
+
385
+ if ( file_exists( $file ) ) {
386
+ include_once $file;
387
+ }
388
+ }
389
+ }
390
+
391
+ function wpcf7_get_request_uri() {
392
+ global $wpcf7;
393
+
394
+ return (string) $wpcf7->request_uri;
395
+ }
396
+
397
+ function wpcf7_register_post_types() {
398
+ if ( class_exists( 'WPCF7_ContactForm' ) ) {
399
+ WPCF7_ContactForm::register_post_type();
400
+ return true;
401
+ } else {
402
+ return false;
403
+ }
404
+ }
405
+
406
  ?>
includes/js/jquery.form.js CHANGED
@@ -1,6 +1,6 @@
1
  /*!
2
  * jQuery Form Plugin
3
- * version: 3.45.0-2013.10.17
4
  * Requires jQuery v1.5 or later
5
  * Copyright (c) 2013 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
@@ -9,7 +9,19 @@
9
  * https://github.com/malsup/form#copyright-and-license
10
  */
11
  /*global ActiveXObject */
12
- ;(function($) {
 
 
 
 
 
 
 
 
 
 
 
 
13
  "use strict";
14
 
15
  /*
@@ -1201,4 +1213,5 @@ function log() {
1201
  }
1202
  }
1203
 
1204
- })( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
 
1
  /*!
2
  * jQuery Form Plugin
3
+ * version: 3.46.0-2013.11.21
4
  * Requires jQuery v1.5 or later
5
  * Copyright (c) 2013 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
9
  * https://github.com/malsup/form#copyright-and-license
10
  */
11
  /*global ActiveXObject */
12
+
13
+ // AMD support
14
+ (function (factory) {
15
+ if (typeof define === 'function' && define.amd) {
16
+ // using AMD; register as anon module
17
+ define(['jquery'], factory);
18
+ } else {
19
+ // no AMD; invoke directly
20
+ factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto );
21
+ }
22
+ }
23
+
24
+ (function($) {
25
  "use strict";
26
 
27
  /*
1213
  }
1214
  }
1215
 
1216
+ }));
1217
+
includes/js/jquery.form.min.js CHANGED
@@ -1,7 +1,7 @@
1
  /*
2
- * jQuery Form Plugin; v20131017
3
  * http://jquery.malsup.com/form/
4
  * Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
5
  * https://github.com/malsup/form#copyright-and-license
6
  */
7
- ;(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("<input type='file'/>").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;a.length>i;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;o.length>i;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(100*(a/n))),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var l=s.beforeSend;return s.beforeSend=function(e,r){r.data=t.formData?t.formData:n,l&&l.call(this,e,r)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(k),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action");w.setAttribute("target",d),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(D)},m.timeout));var o=[];try{if(m.extraData)for(var l in m.extraData)m.extraData.hasOwnProperty(l)&&(e.isPlainObject(m.extraData[l])&&m.extraData[l].hasOwnProperty("name")&&m.extraData[l].hasOwnProperty("value")?o.push(e('<input type="hidden" name="'+m.extraData[l].name+'">').val(m.extraData[l].value).appendTo(w)[0]):o.push(e('<input type="hidden" name="'+l+'">').val(m.extraData[l]).appendTo(w)[0]));m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(c){var p=document.createElement("form").submit;p.apply(w)}}finally{w.setAttribute("action",i),r?w.setAttribute("target",r):f.removeAttr("target"),e(o).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),S.reject(x,"timeout"),void 0;if(t==k&&x)return x.abort("server abort"),S.reject(x,"error","server abort"),void 0;if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),setTimeout(s,250),void 0;var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var l=(m.dataType||"").toLowerCase(),c=/(json|script|text)/.test(l);if(c||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(c){var d=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];d?x.responseText=d.textContent?d.textContent:d.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==l&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,l,m)}catch(b){i="parsererror",x.error=r=b||i}}catch(b){a("error caught: ",b),i="error",x.error=r=b||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&300>x.status||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),p&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),p&&e.event.trigger("ajaxError",[x,m,r])),p&&e.event.trigger("ajaxComplete",[x,m]),p&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var l,c,m,p,d,v,g,x,b,y,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;h.length>c;c++)l=e(h[c]),i?l.prop("disabled",!1):l.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,d="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),y=v.attr2("name"),y?d=y:v.attr2("name",d)):(v=e('<iframe name="'+d+'" src="'+m.iframeSrc+'" />'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),p&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},p=m.global,p&&0===e.active++&&e.event.trigger("ajaxStart"),p&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;b=w.clk,b&&(y=b.name,y&&!b.disabled&&(m.extraData=m.extraData||{},m.extraData[y]=b.value,"image"==b.type&&(m.extraData[y+".x"]=w.clk_x,m.extraData[y+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,l,c,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),l=t.url||this.attr2("action"),c="string"==typeof l?e.trim(l):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=t.traditional;void 0===p&&(p=e.ajaxSettings.traditional);var d,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,d=e.param(t.data,p)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,p);d&&(g=g?g+"&"+d:d),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(b,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var y=t.error;t.error=function(e,r,a){var n=t.context||this;y.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;h.length>E;E++)h[E]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i=this[0],o=t?i.getElementsByTagName("*"):i.elements;if(!o)return a;var s,u,l,c,f,m,p;for(s=0,m=o.length;m>s;s++)if(f=o[s],l=f.name,l&&!f.disabled)if(t&&i.clk&&"image"==f.type)i.clk==f&&(a.push({name:l,value:e(f).val(),type:f.type}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}));else if(c=e.fieldValue(f,!0),c&&c.constructor==Array)for(r&&r.push(f),u=0,p=c.length;p>u;u++)a.push({name:l,value:c[u]});else if(n.fileapi&&"file"==f.type){r&&r.push(f);var d=f.files;if(d.length)for(u=0;d.length>u;u++)a.push({name:l,value:d[u],type:f.type});else a.push({name:l,value:"",type:f.type})}else null!==c&&c!==void 0&&(r&&r.push(f),a.push({name:l,value:c,type:f.type,required:f.required}));if(!t&&i.clk){var h=e(i.clk),v=h[0];l=v.name,l&&!v.disabled&&"image"==v.type&&(a.push({name:l,value:h.val()}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&n!==void 0&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,l="select-one"==n,c=l?o+1:u.length,f=l?o:0;c>f;f++){var m=u[f];if(m.selected){var p=m.value;if(p||(p=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),l)return p;s.push(p)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1})("undefined"!=typeof jQuery?jQuery:window.Zepto);
1
  /*
2
+ * jQuery Form Plugin; v20131121
3
  * http://jquery.malsup.com/form/
4
  * Copyright (c) 2013 M. Alsup; Dual licensed: MIT/GPL
5
  * https://github.com/malsup/form#copyright-and-license
6
  */
7
+ ;(function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)})(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("<input type='file'/>").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;a.length>i;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;o.length>i;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(100*(a/n))),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var c=s.beforeSend;return s.beforeSend=function(e,r){r.data=t.formData?t.formData:n,c&&c.call(this,e,r)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(k),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action");w.setAttribute("target",p),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(D)},m.timeout));var o=[];try{if(m.extraData)for(var c in m.extraData)m.extraData.hasOwnProperty(c)&&(e.isPlainObject(m.extraData[c])&&m.extraData[c].hasOwnProperty("name")&&m.extraData[c].hasOwnProperty("value")?o.push(e('<input type="hidden" name="'+m.extraData[c].name+'">').val(m.extraData[c].value).appendTo(w)[0]):o.push(e('<input type="hidden" name="'+c+'">').val(m.extraData[c]).appendTo(w)[0]));m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(l){var d=document.createElement("form").submit;d.apply(w)}}finally{w.setAttribute("action",i),r?w.setAttribute("target",r):f.removeAttr("target"),e(o).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),S.reject(x,"timeout"),void 0;if(t==k&&x)return x.abort("server abort"),S.reject(x,"error","server abort"),void 0;if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),setTimeout(s,250),void 0;var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(b){i="parsererror",x.error=r=b||i}}catch(b){a("error caught: ",b),i="error",x.error=r=b||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&300>x.status||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,b,y,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;h.length>l;l++)c=e(h[l]),i?c.prop("disabled",!1):c.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,p="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),y=v.attr2("name"),y?p=y:v.attr2("name",p)):(v=e('<iframe name="'+p+'" src="'+m.iframeSrc+'" />'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;b=w.clk,b&&(y=b.name,y&&!b.disabled&&(m.extraData=m.extraData||{},m.extraData[y]=b.value,"image"==b.type&&(m.extraData[y+".x"]=w.clk_x,m.extraData[y+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(b,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var y=t.error;t.error=function(e,r,a){var n=t.context||this;y.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;h.length>E;E++)h[E]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i=this[0],o=t?i.getElementsByTagName("*"):i.elements;if(!o)return a;var s,u,c,l,f,m,d;for(s=0,m=o.length;m>s;s++)if(f=o[s],c=f.name,c&&!f.disabled)if(t&&i.clk&&"image"==f.type)i.clk==f&&(a.push({name:c,value:e(f).val(),type:f.type}),a.push({name:c+".x",value:i.clk_x},{name:c+".y",value:i.clk_y}));else if(l=e.fieldValue(f,!0),l&&l.constructor==Array)for(r&&r.push(f),u=0,d=l.length;d>u;u++)a.push({name:c,value:l[u]});else if(n.fileapi&&"file"==f.type){r&&r.push(f);var p=f.files;if(p.length)for(u=0;p.length>u;u++)a.push({name:c,value:p[u],type:f.type});else a.push({name:c,value:"",type:f.type})}else null!==l&&l!==void 0&&(r&&r.push(f),a.push({name:c,value:l,type:f.type,required:f.required}));if(!t&&i.clk){var h=e(i.clk),v=h[0];c=v.name,c&&!v.disabled&&"image"==v.type&&(a.push({name:c,value:h.val()}),a.push({name:c+".x",value:i.clk_x},{name:c+".y",value:i.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&n!==void 0&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1});
includes/js/scripts.js CHANGED
@@ -1,143 +1,140 @@
1
  (function($) {
2
 
3
- $(function() {
4
- try {
5
- if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
6
- _wpcf7 = {};
7
-
8
- _wpcf7 = $.extend({ cached: 0 }, _wpcf7);
9
-
10
- _wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
11
 
12
- $('div.wpcf7 > form').ajaxForm({
13
- beforeSubmit: function(formData, jqForm, options) {
14
- jqForm.wpcf7ClearResponseOutput();
15
- jqForm.find('img.ajax-loader').css({ visibility: 'visible' });
16
- return true;
17
- },
18
- beforeSerialize: function(jqForm, options) {
19
- jqForm.find('[placeholder].placeheld').each(function(i, n) {
20
- $(n).val('');
21
- });
22
- return true;
23
- },
24
- data: { '_wpcf7_is_ajax_call': 1 },
25
- dataType: 'json',
26
- success: function(data) {
27
- if (! $.isPlainObject(data) || $.isEmptyObject(data))
28
- return;
29
 
30
- var ro = $(data.into).find('div.wpcf7-response-output');
31
- $(data.into).wpcf7ClearResponseOutput();
 
 
32
 
33
- $(data.into).find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
34
- $(data.into).find('form.wpcf7-form').removeClass('invalid spam sent failed');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- if (data.captcha)
37
- $(data.into).wpcf7RefillCaptcha(data.captcha);
38
 
39
- if (data.quiz)
40
- $(data.into).wpcf7RefillQuiz(data.quiz);
41
 
42
- if (data.invalids) {
43
- $.each(data.invalids, function(i, n) {
44
- $(data.into).find(n.into).wpcf7NotValidTip(n.message);
45
- $(data.into).find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
46
- });
47
 
48
- ro.addClass('wpcf7-validation-errors');
49
- $(data.into).find('form.wpcf7-form').addClass('invalid');
 
50
 
51
- $(data.into).trigger('invalid.wpcf7');
52
 
53
- } else if (1 == data.spam) {
54
- ro.addClass('wpcf7-spam-blocked');
55
- $(data.into).find('form.wpcf7-form').addClass('spam');
56
 
57
- $(data.into).trigger('spam.wpcf7');
 
 
 
 
 
 
 
 
58
 
59
- } else if (1 == data.mailSent) {
60
- ro.addClass('wpcf7-mail-sent-ok');
61
- $(data.into).find('form.wpcf7-form').addClass('sent');
 
 
 
 
 
 
 
62
 
63
- if (data.onSentOk)
64
- $.each(data.onSentOk, function(i, n) { eval(n) });
 
65
 
66
- $(data.into).trigger('mailsent.wpcf7');
67
 
68
- } else {
69
- ro.addClass('wpcf7-mail-sent-ng');
70
- $(data.into).find('form.wpcf7-form').addClass('failed');
71
 
72
- $(data.into).trigger('mailfailed.wpcf7');
73
- }
74
 
75
- if (data.onSubmit)
76
- $.each(data.onSubmit, function(i, n) { eval(n) });
77
 
78
- $(data.into).trigger('submit.wpcf7');
 
79
 
80
- if (1 == data.mailSent)
81
- $(data.into).find('form').resetForm().clearForm();
 
 
 
 
82
 
83
- $(data.into).find('[placeholder].placeheld').each(function(i, n) {
84
- $(n).val($(n).attr('placeholder'));
85
- });
86
 
87
- $(data.into).wpcf7FillResponseOutput(data.message);
88
- },
89
- error: function(xhr, status, error, $form) {
90
- var e = $('<div class="ajax-error"></div>').text(error.message);
91
- $form.after(e);
92
- }
93
- });
94
 
95
- $('div.wpcf7 > form').wpcf7InitForm();
 
 
96
 
97
- } catch (e) {
98
- }
99
- });
100
 
101
- $.fn.wpcf7InitForm = function() {
102
- return this.each(function(i, n) {
103
- var $f = $(n);
104
 
105
- if (_wpcf7.cached)
106
- $f.wpcf7OnloadRefill();
107
 
108
- $f.wpcf7ToggleSubmit();
109
 
110
- $f.find('.wpcf7-submit').wpcf7AjaxLoader();
 
 
111
 
112
- $f.find('.wpcf7-acceptance').click(function() {
113
- $f.wpcf7ToggleSubmit();
114
- });
115
 
116
- $f.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox();
 
117
 
118
- $f.find('[placeholder]').wpcf7Placeholder();
119
 
120
- if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.date) {
121
- $f.find('input.wpcf7-date[type="date"]').each(function() {
122
- $(this).datepicker({
123
- dateFormat: 'yy-mm-dd',
124
- minDate: new Date($(this).attr('min')),
125
- maxDate: new Date($(this).attr('max'))
126
- });
127
- });
128
- }
129
 
130
- if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.number) {
131
- $f.find('input.wpcf7-number[type="number"]').each(function() {
132
- $(this).spinner({
133
- min: $(this).attr('min'),
134
- max: $(this).attr('max'),
135
- step: $(this).attr('step')
136
- });
137
- });
138
- }
139
  });
140
- };
 
 
 
141
 
142
  $.fn.wpcf7ExclusiveCheckbox = function() {
143
  return this.find('input:checkbox').click(function() {
@@ -205,16 +202,7 @@
205
  $.fn.wpcf7NotValidTip = function(message) {
206
  return this.each(function() {
207
  var into = $(this);
208
- into.append('<span class="wpcf7-not-valid-tip">' + message + '</span>');
209
- $('span.wpcf7-not-valid-tip').mouseover(function() {
210
- $(this).fadeOut('fast');
211
- });
212
- into.find(':input').mouseover(function() {
213
- into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
214
- });
215
- into.find(':input').focus(function() {
216
- into.find('.wpcf7-not-valid-tip').not(':hidden').fadeOut('fast');
217
- });
218
  });
219
  };
220
 
@@ -267,18 +255,12 @@
267
 
268
  $.fn.wpcf7ClearResponseOutput = function() {
269
  return this.each(function() {
270
- $(this).find('div.wpcf7-response-output').hide().empty().removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked');
271
  $(this).find('span.wpcf7-not-valid-tip').remove();
272
  $(this).find('img.ajax-loader').css({ visibility: 'hidden' });
273
  });
274
  };
275
 
276
- $.fn.wpcf7FillResponseOutput = function(message) {
277
- return this.each(function() {
278
- $(this).find('div.wpcf7-response-output').append(message).slideDown('fast');
279
- });
280
- };
281
-
282
  $.wpcf7SupportHtml5 = function() {
283
  var features = {};
284
  var input = document.createElement('input');
1
  (function($) {
2
 
3
+ if (typeof _wpcf7 == 'undefined' || _wpcf7 === null)
4
+ _wpcf7 = {};
 
 
 
 
 
 
5
 
6
+ _wpcf7 = $.extend({ cached: 0 }, _wpcf7);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
+ $(function() {
9
+ _wpcf7.supportHtml5 = $.wpcf7SupportHtml5();
10
+ $('div.wpcf7 > form').wpcf7InitForm();
11
+ });
12
 
13
+ $.fn.wpcf7InitForm = function() {
14
+ this.ajaxForm({
15
+ beforeSubmit: function(arr, $form, options) {
16
+ $form.wpcf7ClearResponseOutput();
17
+ $form.find('[aria-invalid]').attr('aria-invalid', 'false');
18
+ $form.find('img.ajax-loader').css({ visibility: 'visible' });
19
+ return true;
20
+ },
21
+ beforeSerialize: function($form, options) {
22
+ $form.find('[placeholder].placeheld').each(function(i, n) {
23
+ $(n).val('');
24
+ });
25
+ return true;
26
+ },
27
+ data: { '_wpcf7_is_ajax_call': 1 },
28
+ dataType: 'json',
29
+ success: $.wpcf7AjaxSuccess,
30
+ error: function(xhr, status, error, $form) {
31
+ var e = $('<div class="ajax-error"></div>').text(error.message);
32
+ $form.after(e);
33
+ }
34
+ });
35
 
36
+ if (_wpcf7.cached)
37
+ this.wpcf7OnloadRefill();
38
 
39
+ this.wpcf7ToggleSubmit();
 
40
 
41
+ this.find('.wpcf7-submit').wpcf7AjaxLoader();
 
 
 
 
42
 
43
+ this.find('.wpcf7-acceptance').click(function() {
44
+ $(this).closest('form').wpcf7ToggleSubmit();
45
+ });
46
 
47
+ this.find('.wpcf7-exclusive-checkbox').wpcf7ExclusiveCheckbox();
48
 
49
+ this.find('[placeholder]').wpcf7Placeholder();
 
 
50
 
51
+ if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.date) {
52
+ this.find('input.wpcf7-date[type="date"]').each(function() {
53
+ $(this).datepicker({
54
+ dateFormat: 'yy-mm-dd',
55
+ minDate: new Date($(this).attr('min')),
56
+ maxDate: new Date($(this).attr('max'))
57
+ });
58
+ });
59
+ }
60
 
61
+ if (_wpcf7.jqueryUi && ! _wpcf7.supportHtml5.number) {
62
+ this.find('input.wpcf7-number[type="number"]').each(function() {
63
+ $(this).spinner({
64
+ min: $(this).attr('min'),
65
+ max: $(this).attr('max'),
66
+ step: $(this).attr('step')
67
+ });
68
+ });
69
+ }
70
+ };
71
 
72
+ $.wpcf7AjaxSuccess = function(data, status, xhr, $form) {
73
+ if (! $.isPlainObject(data) || $.isEmptyObject(data))
74
+ return;
75
 
76
+ var $responseOutput = $form.find('div.wpcf7-response-output');
77
 
78
+ $form.wpcf7ClearResponseOutput();
 
 
79
 
80
+ $form.find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
81
+ $form.removeClass('invalid spam sent failed');
82
 
83
+ if (data.captcha)
84
+ $form.wpcf7RefillCaptcha(data.captcha);
85
 
86
+ if (data.quiz)
87
+ $form.wpcf7RefillQuiz(data.quiz);
88
 
89
+ if (data.invalids) {
90
+ $.each(data.invalids, function(i, n) {
91
+ $form.find(n.into).wpcf7NotValidTip(n.message);
92
+ $form.find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
93
+ $form.find(n.into).find('[aria-invalid]').attr('aria-invalid', 'true');
94
+ });
95
 
96
+ $responseOutput.addClass('wpcf7-validation-errors');
97
+ $form.addClass('invalid');
 
98
 
99
+ $(data.into).trigger('invalid<