Contact Form 7 - Version 3.9-beta

Version Description

Download this release

Release Info

Developer takayukister
Plugin Icon 128x128 Contact Form 7
Version 3.9-beta
Comparing to
See all releases

Code changes from version 3.8.1 to 3.9-beta

admin/admin-functions.php CHANGED
@@ -49,4 +49,116 @@ function wpcf7_tag_generators() {
49
  return $taggenerators;
50
  }
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  ?>
49
  return $taggenerators;
50
  }
51
 
52
+ function wpcf7_save_contact_form( $post_id = -1 ) {
53
+ if ( -1 != $post_id ) {
54
+ $contact_form = wpcf7_contact_form( $post_id );
55
+ }
56
+
57
+ if ( empty( $contact_form ) ) {
58
+ $contact_form = WPCF7_ContactForm::get_template();
59
+ }
60
+
61
+ if ( isset( $_POST['wpcf7-title'] ) ) {
62
+ $contact_form->set_title( $_POST['wpcf7-title'] );
63
+ }
64
+
65
+ if ( isset( $_POST['wpcf7-locale'] ) ) {
66
+ $locale = trim( $_POST['wpcf7-locale'] );
67
+
68
+ if ( wpcf7_is_valid_locale( $locale ) ) {
69
+ $contact_form->locale = $locale;
70
+ }
71
+ }
72
+
73
+ $properties = $contact_form->get_properties();
74
+
75
+ if ( isset( $_POST['wpcf7-form'] ) ) {
76
+ $properties['form'] = trim( $_POST['wpcf7-form'] );
77
+ }
78
+
79
+ $mail = $properties['mail'];
80
+
81
+ if ( isset( $_POST['wpcf7-mail-subject'] ) ) {
82
+ $mail['subject'] = trim( $_POST['wpcf7-mail-subject'] );
83
+ }
84
+
85
+ if ( isset( $_POST['wpcf7-mail-sender'] ) ) {
86
+ $mail['sender'] = trim( $_POST['wpcf7-mail-sender'] );
87
+ }
88
+
89
+ if ( isset( $_POST['wpcf7-mail-body'] ) ) {
90
+ $mail['body'] = trim( $_POST['wpcf7-mail-body'] );
91
+ }
92
+
93
+ if ( isset( $_POST['wpcf7-mail-recipient'] ) ) {
94
+ $mail['recipient'] = trim( $_POST['wpcf7-mail-recipient'] );
95
+ }
96
+
97
+ if ( isset( $_POST['wpcf7-mail-additional-headers'] ) ) {
98
+ $mail['additional_headers'] = trim( $_POST['wpcf7-mail-additional-headers'] );
99
+ }
100
+
101
+ if ( isset( $_POST['wpcf7-mail-attachments'] ) ) {
102
+ $mail['attachments'] = trim( $_POST['wpcf7-mail-attachments'] );
103
+ }
104
+
105
+ $mail['use_html'] = ! empty( $_POST['wpcf7-mail-use-html'] );
106
+ $mail['exclude_blank'] = ! empty( $_POST['wpcf7-mail-exclude-blank'] );
107
+
108
+ $properties['mail'] = $mail;
109
+
110
+ $mail_2 = $properties['mail_2'];
111
+
112
+ $mail_2['active'] = ! empty( $_POST['wpcf7-mail-2-active'] );
113
+
114
+ if ( isset( $_POST['wpcf7-mail-2-subject'] ) ) {
115
+ $mail_2['subject'] = trim( $_POST['wpcf7-mail-2-subject'] );
116
+ }
117
+
118
+ if ( isset( $_POST['wpcf7-mail-2-sender'] ) ) {
119
+ $mail_2['sender'] = trim( $_POST['wpcf7-mail-2-sender'] );
120
+ }
121
+
122
+ if ( isset( $_POST['wpcf7-mail-2-body'] ) ) {
123
+ $mail_2['body'] = trim( $_POST['wpcf7-mail-2-body'] );
124
+ }
125
+
126
+ if ( isset( $_POST['wpcf7-mail-2-recipient'] ) ) {
127
+ $mail_2['recipient'] = trim( $_POST['wpcf7-mail-2-recipient'] );
128
+ }
129
+
130
+ if ( isset( $_POST['wpcf7-mail-2-additional-headers'] ) ) {
131
+ $mail_2['additional_headers'] = trim(
132
+ $_POST['wpcf7-mail-2-additional-headers'] );
133
+ }
134
+
135
+ if ( isset( $_POST['wpcf7-mail-2-attachments'] ) ) {
136
+ $mail_2['attachments'] = trim( $_POST['wpcf7-mail-2-attachments'] );
137
+ }
138
+
139
+ $mail_2['use_html'] = ! empty( $_POST['wpcf7-mail-2-use-html'] );
140
+ $mail_2['exclude_blank'] = ! empty( $_POST['wpcf7-mail-2-exclude-blank'] );
141
+
142
+ $properties['mail_2'] = $mail_2;
143
+
144
+ foreach ( wpcf7_messages() as $key => $arr ) {
145
+ $field_name = 'wpcf7-message-' . strtr( $key, '_', '-' );
146
+
147
+ if ( isset( $_POST[$field_name] ) ) {
148
+ $properties['messages'][$key] = trim( $_POST[$field_name] );
149
+ }
150
+ }
151
+
152
+ if ( isset( $_POST['wpcf7-additional-settings'] ) ) {
153
+ $properties['additional_settings'] = trim(
154
+ $_POST['wpcf7-additional-settings'] );
155
+ }
156
+
157
+ $contact_form->set_properties( $properties );
158
+
159
+ do_action( 'wpcf7_save_contact_form', $contact_form );
160
+
161
+ return $contact_form->save();
162
+ }
163
+
164
  ?>
admin/admin.php CHANGED
@@ -5,17 +5,10 @@ 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
- $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' ),
@@ -58,65 +51,13 @@ function wpcf7_load_contact_form_admin() {
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();
63
- $contact_form->initial = true;
64
- }
65
-
66
- $contact_form->title = trim( $_POST['wpcf7-title'] );
67
- $contact_form->locale = trim( $_POST['wpcf7-locale'] );
68
-
69
- $form = trim( $_POST['wpcf7-form'] );
70
-
71
- $mail = array(
72
- 'subject' => trim( $_POST['wpcf7-mail-subject'] ),
73
- 'sender' => trim( $_POST['wpcf7-mail-sender'] ),
74
- 'body' => trim( $_POST['wpcf7-mail-body'] ),
75
- 'recipient' => trim( $_POST['wpcf7-mail-recipient'] ),
76
- 'additional_headers' => trim( $_POST['wpcf7-mail-additional-headers'] ),
77
- 'attachments' => trim( $_POST['wpcf7-mail-attachments'] ),
78
- 'use_html' =>
79
- isset( $_POST['wpcf7-mail-use-html'] ) && 1 == $_POST['wpcf7-mail-use-html']
80
- );
81
-
82
- $mail_2 = array(
83
- 'active' =>
84
- isset( $_POST['wpcf7-mail-2-active'] ) && 1 == $_POST['wpcf7-mail-2-active'],
85
- 'subject' => trim( $_POST['wpcf7-mail-2-subject'] ),
86
- 'sender' => trim( $_POST['wpcf7-mail-2-sender'] ),
87
- 'body' => trim( $_POST['wpcf7-mail-2-body'] ),
88
- 'recipient' => trim( $_POST['wpcf7-mail-2-recipient'] ),
89
- 'additional_headers' => trim( $_POST['wpcf7-mail-2-additional-headers'] ),
90
- 'attachments' => trim( $_POST['wpcf7-mail-2-attachments'] ),
91
- 'use_html' =>
92
- isset( $_POST['wpcf7-mail-2-use-html'] ) && 1 == $_POST['wpcf7-mail-2-use-html']
93
- );
94
-
95
- $messages = isset( $contact_form->messages ) ? $contact_form->messages : array();
96
-
97
- foreach ( wpcf7_messages() as $key => $arr ) {
98
- $field_name = 'wpcf7-message-' . strtr( $key, '_', '-' );
99
- if ( isset( $_POST[$field_name] ) )
100
- $messages[$key] = trim( $_POST[$field_name] );
101
- }
102
-
103
- $additional_settings = trim( $_POST['wpcf7-additional-settings'] );
104
 
105
- $props = apply_filters( 'wpcf7_contact_form_admin_posted_properties',
106
- compact( 'form', 'mail', 'mail_2', 'messages', 'additional_settings' ) );
107
-
108
- foreach ( (array) $props as $key => $prop )
109
- $contact_form->{$key} = $prop;
110
-
111
- $query = array();
112
- $query['message'] = ( $contact_form->initial ) ? 'created' : 'saved';
113
-
114
- $contact_form->save();
115
-
116
- $query['post'] = $contact_form->id;
117
 
118
  $redirect_to = add_query_arg( $query, menu_page_url( 'wpcf7', false ) );
119
-
120
  wp_safe_redirect( $redirect_to );
121
  exit();
122
  }
@@ -137,7 +78,7 @@ function wpcf7_load_contact_form_admin() {
137
  $new_contact_form = $contact_form->copy();
138
  $new_contact_form->save();
139
 
140
- $query['post'] = $new_contact_form->id;
141
  $query['message'] = 'created';
142
  }
143
 
@@ -162,12 +103,12 @@ function wpcf7_load_contact_form_admin() {
162
  $deleted = 0;
163
 
164
  foreach ( $posts as $post ) {
165
- $post = new WPCF7_ContactForm( $post );
166
 
167
  if ( empty( $post ) )
168
  continue;
169
 
170
- if ( ! current_user_can( 'wpcf7_delete_contact_form', $post->id ) )
171
  wp_die( __( 'You are not allowed to delete this item.', 'contact-form-7' ) );
172
 
173
  if ( ! $post->delete() )
@@ -192,14 +133,14 @@ function wpcf7_load_contact_form_admin() {
192
  $post = null;
193
 
194
  if ( 'wpcf7-new' == $plugin_page && isset( $_GET['locale'] ) ) {
195
- $post = wpcf7_get_contact_form_default_pack( array(
196
  'locale' => $_GET['locale'] ) );
197
  } elseif ( ! empty( $_GET['post'] ) ) {
198
- $post = wpcf7_contact_form( $_GET['post'] );
199
  }
200
 
201
- if ( $post && current_user_can( 'wpcf7_edit_contact_form', $post->id ) ) {
202
- wpcf7_add_meta_boxes( $post->id );
203
 
204
  } else {
205
  $current_screen = get_current_screen();
@@ -215,10 +156,6 @@ function wpcf7_load_contact_form_admin() {
215
  'default' => 20,
216
  'option' => 'cfseven_contact_forms_per_page' ) );
217
  }
218
-
219
- if ( $post ) {
220
- WPCF7_ContactForm::set_current( $post );
221
- }
222
  }
223
 
224
  add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_scripts' );
@@ -257,7 +194,7 @@ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
257
 
258
  function wpcf7_admin_management_page() {
259
  if ( $post = wpcf7_get_current_contact_form() ) {
260
- $post_id = $post->initial ? -1 : $post->id;
261
 
262
  require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php';
263
  require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php';
@@ -269,7 +206,6 @@ function wpcf7_admin_management_page() {
269
 
270
  ?>
271
  <div class="wrap">
272
- <?php screen_icon(); ?>
273
 
274
  <h2><?php
275
  echo esc_html( __( 'Contact Forms', 'contact-form-7' ) );
@@ -313,7 +249,6 @@ function wpcf7_admin_add_new_page() {
313
 
314
  ?>
315
  <div class="wrap">
316
- <?php screen_icon(); ?>
317
 
318
  <h2><?php echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) ); ?></h2>
319
 
5
  add_action( 'admin_menu', 'wpcf7_admin_menu', 9 );
6
 
7
  function wpcf7_admin_menu() {
 
 
 
 
 
 
 
8
  add_object_page( __( 'Contact Form 7', 'contact-form-7' ),
9
  __( 'Contact', 'contact-form-7' ),
10
  'wpcf7_read_contact_forms', 'wpcf7',
11
+ 'wpcf7_admin_management_page' );
12
 
13
  $edit = add_submenu_page( 'wpcf7',
14
  __( 'Edit Contact Form', 'contact-form-7' ),
51
  if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
52
  wp_die( __( 'You are not allowed to edit this item.', 'contact-form-7' ) );
53
 
54
+ $id = wpcf7_save_contact_form( $id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
+ $query = array(
57
+ 'message' => ( -1 == $_POST['post_ID'] ) ? 'created' : 'saved',
58
+ 'post' => $id );
 
 
 
 
 
 
 
 
 
59
 
60
  $redirect_to = add_query_arg( $query, menu_page_url( 'wpcf7', false ) );
 
61
  wp_safe_redirect( $redirect_to );
62
  exit();
63
  }
78
  $new_contact_form = $contact_form->copy();
79
  $new_contact_form->save();
80
 
81
+ $query['post'] = $new_contact_form->id();
82
  $query['message'] = 'created';
83
  }
84
 
103
  $deleted = 0;
104
 
105
  foreach ( $posts as $post ) {
106
+ $post = WPCF7_ContactForm::get_instance( $post );
107
 
108
  if ( empty( $post ) )
109
  continue;
110
 
111
+ if ( ! current_user_can( 'wpcf7_delete_contact_form', $post->id() ) )
112
  wp_die( __( 'You are not allowed to delete this item.', 'contact-form-7' ) );
113
 
114
  if ( ! $post->delete() )
133
  $post = null;
134
 
135
  if ( 'wpcf7-new' == $plugin_page && isset( $_GET['locale'] ) ) {
136
+ $post = WPCF7_ContactForm::get_template( array(
137
  'locale' => $_GET['locale'] ) );
138
  } elseif ( ! empty( $_GET['post'] ) ) {
139
+ $post = WPCF7_ContactForm::get_instance( $_GET['post'] );
140
  }
141
 
142
+ if ( $post && current_user_can( 'wpcf7_edit_contact_form', $post->id() ) ) {
143
+ wpcf7_add_meta_boxes( $post->id() );
144
 
145
  } else {
146
  $current_screen = get_current_screen();
156
  'default' => 20,
157
  'option' => 'cfseven_contact_forms_per_page' ) );
158
  }
 
 
 
 
159
  }
160
 
161
  add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_scripts' );
194
 
195
  function wpcf7_admin_management_page() {
196
  if ( $post = wpcf7_get_current_contact_form() ) {
197
+ $post_id = $post->initial() ? -1 : $post->id();
198
 
199
  require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php';
200
  require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php';
206
 
207
  ?>
208
  <div class="wrap">
 
209
 
210
  <h2><?php
211
  echo esc_html( __( 'Contact Forms', 'contact-form-7' ) );
249
 
250
  ?>
251
  <div class="wrap">
 
252
 
253
  <h2><?php echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) ); ?></h2>
254
 
admin/css/styles.css CHANGED
@@ -92,6 +92,20 @@ input#contact-form-anchor-text, input#contact-form-anchor-text-old {
92
  margin-left: 10px;
93
  }
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
95
  .postbox .mail-field, .postbox .message-field {
96
  margin-top: 6px;
97
  margin-bottom: 8px;
92
  margin-left: 10px;
93
  }
94
 
95
+ @media only screen and (max-width: 768px) {
96
+ .postbox .half, .postbox .half-left, .postbox .half-right {
97
+ width: 100%;
98
+ }
99
+
100
+ .postbox .half-right {
101
+ margin-top: 1em;
102
+ }
103
+
104
+ .postbox .half-right > * {
105
+ margin-left: inherit;
106
+ }
107
+ }
108
+
109
  .postbox .mail-field, .postbox .message-field {
110
  margin-top: 6px;
111
  margin-bottom: 8px;
admin/edit-contact-form.php CHANGED
@@ -6,10 +6,8 @@ if ( ! defined( 'ABSPATH' ) )
6
 
7
  ?><div class="wrap">
8
 
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' ) );
@@ -35,16 +33,16 @@ if ( $post ) :
35
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) )
36
  wp_nonce_field( 'wpcf7-save-contact-form_' . $post_id ); ?>
37
  <input type="hidden" id="post_ID" name="post_ID" value="<?php echo (int) $post_id; ?>" />
38
- <input type="hidden" id="wpcf7-id" name="wpcf7-id" value="<?php echo (int) get_post_meta( $post->id, '_old_cf7_unit_id', true ); ?>" />
39
  <input type="hidden" id="wpcf7-locale" name="wpcf7-locale" value="<?php echo esc_attr( $post->locale ); ?>" />
40
  <input type="hidden" id="hiddenaction" name="action" value="save" />
41
 
42
  <div id="poststuff" class="metabox-holder">
43
 
44
  <div id="titlediv">
45
- <input type="text" id="wpcf7-title" name="wpcf7-title" size="80" value="<?php echo esc_attr( $post->title ); ?>"<?php echo $disabled; ?> />
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
 
@@ -64,7 +62,7 @@ if ( $post ) :
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' ) ); ?>"
@@ -82,27 +80,27 @@ if ( $post ) :
82
 
83
  <?php
84
 
85
- do_action_ref_array( 'wpcf7_admin_after_general_settings', array( &$post ) );
86
 
87
  do_meta_boxes( null, 'form', $post );
88
 
89
- do_action_ref_array( 'wpcf7_admin_after_form', array( &$post ) );
90
 
91
  do_meta_boxes( null, 'mail', $post );
92
 
93
- do_action_ref_array( 'wpcf7_admin_after_mail', array( &$post ) );
94
 
95
  do_meta_boxes( null, 'mail_2', $post );
96
 
97
- do_action_ref_array( 'wpcf7_admin_after_mail_2', array( &$post ) );
98
 
99
  do_meta_boxes( null, 'messages', $post );
100
 
101
- do_action_ref_array( 'wpcf7_admin_after_messages', array( &$post ) );
102
 
103
  do_meta_boxes( null, 'additional_settings', $post );
104
 
105
- do_action_ref_array( 'wpcf7_admin_after_additional_settings', array( &$post ) );
106
 
107
  wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
108
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
@@ -116,4 +114,4 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
116
 
117
  </div>
118
 
119
- <?php do_action_ref_array( 'wpcf7_admin_footer', array( &$post ) ); ?>
6
 
7
  ?><div class="wrap">
8
 
 
 
9
  <h2><?php
10
+ if ( $post->initial() ) {
11
  echo esc_html( __( 'Add New Contact Form', 'contact-form-7' ) );
12
  } else {
13
  echo esc_html( __( 'Edit Contact Form', 'contact-form-7' ) );
33
  <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) )
34
  wp_nonce_field( 'wpcf7-save-contact-form_' . $post_id ); ?>
35
  <input type="hidden" id="post_ID" name="post_ID" value="<?php echo (int) $post_id; ?>" />
36
+ <input type="hidden" id="wpcf7-id" name="wpcf7-id" value="<?php echo (int) get_post_meta( $post->id(), '_old_cf7_unit_id', true ); ?>" />
37
  <input type="hidden" id="wpcf7-locale" name="wpcf7-locale" value="<?php echo esc_attr( $post->locale ); ?>" />
38
  <input type="hidden" id="hiddenaction" name="action" value="save" />
39
 
40
  <div id="poststuff" class="metabox-holder">
41
 
42
  <div id="titlediv">
43
+ <input type="text" id="wpcf7-title" name="wpcf7-title" size="80" value="<?php echo esc_attr( $post->title() ); ?>"<?php echo $disabled; ?> />
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.", 'contact-form-7' ) ); ?><br />
48
 
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', 'contact-form-7' ) ); ?>"
80
 
81
  <?php
82
 
83
+ do_action( 'wpcf7_admin_after_general_settings', $post );
84
 
85
  do_meta_boxes( null, 'form', $post );
86
 
87
+ do_action( 'wpcf7_admin_after_form', $post );
88
 
89
  do_meta_boxes( null, 'mail', $post );
90
 
91
+ do_action( 'wpcf7_admin_after_mail', $post );
92
 
93
  do_meta_boxes( null, 'mail_2', $post );
94
 
95
+ do_action( 'wpcf7_admin_after_mail_2', $post );
96
 
97
  do_meta_boxes( null, 'messages', $post );
98
 
99
+ do_action( 'wpcf7_admin_after_messages', $post );
100
 
101
  do_meta_boxes( null, 'additional_settings', $post );
102
 
103
+ do_action( 'wpcf7_admin_after_additional_settings', $post );
104
 
105
  wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
106
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
114
 
115
  </div>
116
 
117
+ <?php do_action( 'wpcf7_admin_footer', $post ); ?>
admin/images/menu-icon.png DELETED
Binary file
admin/images/screen-icon.png DELETED
Binary file
admin/includes/class-contact-forms-list-table.php CHANGED
@@ -93,20 +93,20 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
93
  return sprintf(
94
  '<input type="checkbox" name="%1$s[]" value="%2$s" />',
95
  $this->_args['singular'],
96
- $item->id );
97
  }
98
 
99
  function column_title( $item ) {
100
- $url = admin_url( 'admin.php?page=wpcf7&post=' . absint( $item->id ) );
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(
108
  add_query_arg( array( 'action' => 'copy' ), $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>' ) );
@@ -114,14 +114,15 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
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 );
121
  }
122
 
123
  function column_author( $item ) {
124
- $post = get_post( $item->id );
125
 
126
  if ( ! $post )
127
  return;
@@ -133,7 +134,8 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
133
 
134
  function column_shortcode( $item ) {
135
  $shortcodes = array(
136
- sprintf( '[contact-form-7 id="%1$d" title="%2$s"]', $item->id, $item->title ) );
 
137
 
138
  $output = '';
139
 
@@ -148,7 +150,7 @@ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
148
  }
149
 
150
  function column_date( $item ) {
151
- $post = get_post( $item->id );
152
 
153
  if ( ! $post )
154
  return;
93
  return sprintf(
94
  '<input type="checkbox" name="%1$s[]" value="%2$s" />',
95
  $this->_args['singular'],
96
+ $item->id() );
97
  }
98
 
99
  function column_title( $item ) {
100
+ $url = admin_url( 'admin.php?page=wpcf7&post=' . absint( $item->id() ) );
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(
108
  add_query_arg( array( 'action' => 'copy' ), $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>' ) );
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' ),
118
+ $item->title() ) ),
119
+ esc_html( $item->title() ) );
120
 
121
  return '<strong>' . $a . '</strong> ' . $this->row_actions( $actions );
122
  }
123
 
124
  function column_author( $item ) {
125
+ $post = get_post( $item->id() );
126
 
127
  if ( ! $post )
128
  return;
134
 
135
  function column_shortcode( $item ) {
136
  $shortcodes = array(
137
+ sprintf( '[contact-form-7 id="%1$d" title="%2$s"]',
138
+ $item->id(), $item->title() ) );
139
 
140
  $output = '';
141
 
150
  }
151
 
152
  function column_date( $item ) {
153
+ $post = get_post( $item->id() );
154
 
155
  if ( ! $post )
156
  return;
admin/includes/meta-boxes.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  function wpcf7_form_meta_box( $post ) {
6
  ?>
7
- <div class="half-left"><textarea id="wpcf7-form" name="wpcf7-form" cols="100" rows="24"><?php echo esc_textarea( $post->form ); ?></textarea></div>
8
 
9
  <div class="half-right"><div id="taggenerator"></div></div>
10
 
@@ -15,23 +15,22 @@ function wpcf7_form_meta_box( $post ) {
15
  /* Mail */
16
 
17
  function wpcf7_mail_meta_box( $post, $box ) {
18
- $defaults = array( 'id' => 'wpcf7-mail', 'name' => 'mail', 'use' => null );
 
19
 
20
- if ( ! isset( $box['args'] ) || ! is_array( $box['args'] ) )
21
- $args = array();
22
- else
23
- $args = $box['args'];
24
 
25
- extract( wp_parse_args( $args, $defaults ), EXTR_SKIP );
 
26
 
27
- $id = esc_attr( $id );
28
- $mail = $post->{$name};
29
-
30
- if ( ! empty( $use ) ) :
31
  ?>
32
  <div class="mail-field">
33
  <input type="checkbox" id="<?php echo $id; ?>-active" name="<?php echo $id; ?>-active" class="check-if-these-fields-are-active" value="1"<?php echo ( $mail['active'] ) ? ' checked="checked"' : ''; ?> />
34
- <label for="<?php echo $id; ?>-active"><?php echo esc_html( $use ); ?></label>
35
  <div class="pseudo-hr"></div>
36
  </div>
37
 
@@ -78,7 +77,12 @@ function wpcf7_mail_meta_box( $post, $box ) {
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>
84
 
@@ -94,7 +98,7 @@ function wpcf7_messages_meta_box( $post ) {
94
  ?>
95
  <div class="message-field">
96
  <label for="<?php echo $field_name; ?>"><em># <?php echo esc_html( $arr['description'] ); ?></em></label><br />
97
- <input type="text" id="<?php echo $field_name; ?>" name="<?php echo $field_name; ?>" class="wide" size="70" value="<?php echo esc_attr( $post->messages[$key] ); ?>" />
98
  </div>
99
  <?php
100
  endforeach;
@@ -102,7 +106,7 @@ function wpcf7_messages_meta_box( $post ) {
102
 
103
  function wpcf7_additional_settings_meta_box( $post ) {
104
  ?>
105
- <textarea id="wpcf7-additional-settings" name="wpcf7-additional-settings" cols="100" rows="8"><?php echo esc_textarea( $post->additional_settings ); ?></textarea>
106
  <?php
107
  }
108
 
4
 
5
  function wpcf7_form_meta_box( $post ) {
6
  ?>
7
+ <div class="half-left"><textarea id="wpcf7-form" name="wpcf7-form" cols="100" rows="24"><?php echo esc_textarea( $post->prop( 'form' ) ); ?></textarea></div>
8
 
9
  <div class="half-right"><div id="taggenerator"></div></div>
10
 
15
  /* Mail */
16
 
17
  function wpcf7_mail_meta_box( $post, $box ) {
18
+ $args = isset( $box['args'] ) && is_array( $box['args'] )
19
+ ? $box['args'] : array();
20
 
21
+ $args = wp_parse_args( $args, array(
22
+ 'id' => 'wpcf7-mail',
23
+ 'name' => 'mail',
24
+ 'use' => null ) );
25
 
26
+ $id = esc_attr( $args['id'] );
27
+ $mail = $post->prop( $args['name'] );
28
 
29
+ if ( ! empty( $args['use'] ) ) :
 
 
 
30
  ?>
31
  <div class="mail-field">
32
  <input type="checkbox" id="<?php echo $id; ?>-active" name="<?php echo $id; ?>-active" class="check-if-these-fields-are-active" value="1"<?php echo ( $mail['active'] ) ? ' checked="checked"' : ''; ?> />
33
+ <label for="<?php echo $id; ?>-active"><?php echo esc_html( $args['use'] ); ?></label>
34
  <div class="pseudo-hr"></div>
35
  </div>
36
 
77
  <div class="half-right">
78
  <div class="mail-field">
79
  <label for="<?php echo $id; ?>-body"><?php echo esc_html( __( 'Message body:', 'contact-form-7' ) ); ?></label><br />
80
+ <textarea id="<?php echo $id; ?>-body" name="<?php echo $id; ?>-body" cols="100" rows="18"><?php echo esc_textarea( $mail['body'] ); ?></textarea>
81
+ </div>
82
+
83
+ <div class="mail-field">
84
+ <input type="checkbox" id="<?php echo $id; ?>-exclude-blank" name="<?php echo $id; ?>-exclude-blank" value="1"<?php echo ( ! empty( $mail['exclude_blank'] ) ) ? ' checked="checked"' : ''; ?> />
85
+ <label for="<?php echo $id; ?>-exclude-blank"><?php echo esc_html( __( 'Exclude lines with blank mail-tags from output', 'contact-form-7' ) ); ?></label>
86
  </div>
87
  </div>
88
 
98
  ?>
99
  <div class="message-field">
100
  <label for="<?php echo $field_name; ?>"><em># <?php echo esc_html( $arr['description'] ); ?></em></label><br />
101
+ <input type="text" id="<?php echo $field_name; ?>" name="<?php echo $field_name; ?>" class="wide" size="70" value="<?php echo esc_attr( $post->message( $key, false ) ); ?>" />
102
  </div>
103
  <?php
104
  endforeach;
106
 
107
  function wpcf7_additional_settings_meta_box( $post ) {
108
  ?>
109
+ <textarea id="wpcf7-additional-settings" name="wpcf7-additional-settings" cols="100" rows="8"><?php echo esc_textarea( $post->prop( 'additional_settings' ) ); ?></textarea>
110
  <?php
111
  }
112
 
includes/classes.php DELETED
@@ -1,1084 +0,0 @@
1
- <?php
2
-
3
- class WPCF7_ContactForm {
4
-
5
- const post_type = 'wpcf7_contact_form';
6
-
7
- private static $found_items = 0;
8
- private static $current = null;
9
- private static $submission = array(); // result of submit() process
10
-
11
- public $initial = false;
12
- public $id;
13
- public $name;
14
- public $title;
15
- public $unit_tag;
16
- public $responses_count = 0;
17
- public $scanned_form_tags;
18
- public $posted_data;
19
- public $uploaded_files = array();
20
- public $skip_mail = false;
21
-
22
- public static function count() {
23
- return self::$found_items;
24
- }
25
-
26
- public static function set_current( self $obj ) {
27
- self::$current = $obj;
28
- }
29
-
30
- public static function get_current() {
31
- return self::$current;
32
- }
33
-
34
- public static function reset_current() {
35
- self::$current = null;
36
- }
37
-
38
- private static function add_submission_status( $id, $status ) {
39
- self::$submission[$id] = (array) $status;
40
- }
41
-
42
- private static function get_submission_status( $id ) {
43
- if ( isset( self::$submission[$id] ) ) {
44
- return (array) self::$submission[$id];
45
- }
46
- }
47
-
48
- private static function get_unit_tag( $id = 0 ) {
49
- static $global_count = 0;
50
-
51
- $global_count += 1;
52
-
53
- if ( in_the_loop() ) {
54
- $unit_tag = sprintf( 'wpcf7-f%1$d-p%2$d-o%3$d',
55
- absint( $id ), get_the_ID(), $global_count );
56
- } else {
57
- $unit_tag = sprintf( 'wpcf7-f%1$d-o%2$d',
58
- absint( $id ), $global_count );
59
- }
60
-
61
- return $unit_tag;
62
- }
63
-
64
- public static function register_post_type() {
65
- register_post_type( self::post_type, array(
66
- 'labels' => array(
67
- 'name' => __( 'Contact Forms', 'contact-form-7' ),
68
- 'singular_name' => __( 'Contact Form', 'contact-form-7' ) ),
69
- 'rewrite' => false,
70
- 'query_var' => false ) );
71
- }
72
-
73
- public static function find( $args = '' ) {
74
- $defaults = array(
75
- 'post_status' => 'any',
76
- 'posts_per_page' => -1,
77
- 'offset' => 0,
78
- 'orderby' => 'ID',
79
- 'order' => 'ASC' );
80
-
81
- $args = wp_parse_args( $args, $defaults );
82
-
83
- $args['post_type'] = self::post_type;
84
-
85
- $q = new WP_Query();
86
- $posts = $q->query( $args );
87
-
88
- self::$found_items = $q->found_posts;
89
-
90
- $objs = array();
91
-
92
- foreach ( (array) $posts as $post )
93
- $objs[] = new self( $post );
94
-
95
- return $objs;
96
- }
97
-
98
- public function __construct( $post = null ) {
99
- $this->initial = true;
100
-
101
- $this->form = '';
102
- $this->mail = array();
103
- $this->mail_2 = array();
104
- $this->messages = array();
105
- $this->additional_settings = '';
106
-
107
- $post = get_post( $post );
108
-
109
- if ( $post && self::post_type == get_post_type( $post ) ) {
110
- $this->initial = false;
111
- $this->id = $post->ID;
112
- $this->name = $post->post_name;
113
- $this->title = $post->post_title;
114
- $this->locale = get_post_meta( $post->ID, '_locale', true );
115
-
116
- $props = $this->get_properties();
117
-
118
- foreach ( $props as $prop => $value ) {
119
- if ( metadata_exists( 'post', $post->ID, '_' . $prop ) )
120
- $this->{$prop} = get_post_meta( $post->ID, '_' . $prop, true );
121
- else
122
- $this->{$prop} = get_post_meta( $post->ID, $prop, true );
123
- }
124
-
125
- $this->upgrade();
126
- }
127
-
128
- do_action_ref_array( 'wpcf7_contact_form', array( &$this ) );
129
- }
130
-
131
- public static function generate_default_package( $args = '' ) {
132
- global $l10n;
133
-
134
- $defaults = array( 'locale' => null, 'title' => '' );
135
- $args = wp_parse_args( $args, $defaults );
136
-
137
- $locale = $args['locale'];
138
- $title = $args['title'];
139
-
140
- if ( $locale ) {
141
- $mo_orig = $l10n['contact-form-7'];
142
- wpcf7_load_textdomain( $locale );
143
- }
144
-
145
- $contact_form = new self;
146
- $contact_form->initial = true;
147
- $contact_form->title =
148
- ( $title ? $title : __( 'Untitled', 'contact-form-7' ) );
149
- $contact_form->locale = ( $locale ? $locale : get_locale() );
150
-
151
- $props = $contact_form->get_properties();
152
-
153
- foreach ( $props as $prop => $value ) {
154
- $contact_form->{$prop} = wpcf7_get_default_template( $prop );
155
- }
156
-
157
- $contact_form = apply_filters( 'wpcf7_contact_form_default_pack',
158
- $contact_form, $args );
159
-
160
- if ( isset( $mo_orig ) ) {
161
- $l10n['contact-form-7'] = $mo_orig;
162
- }
163
-
164
- return $contact_form;
165
- }
166
-
167
- public function get_properties() {
168
- $prop_names = array( 'form', 'mail', 'mail_2', 'messages', 'additional_settings' );
169
-
170
- $properties = array();
171
-
172
- foreach ( $prop_names as $prop_name )
173
- $properties[$prop_name] = isset( $this->{$prop_name} ) ? $this->{$prop_name} : '';
174
-
175
- return apply_filters( 'wpcf7_contact_form_properties', $properties, $this );
176
- }
177
-
178
- // Return true if this form is the same one as currently POSTed.
179
- public function is_posted() {
180
- if ( ! isset( $_POST['_wpcf7_unit_tag'] ) || empty( $_POST['_wpcf7_unit_tag'] ) )
181
- return false;
182
-
183
- if ( $this->unit_tag == $_POST['_wpcf7_unit_tag'] )
184
- return true;
185
-
186
- return false;
187
- }
188
-
189
- public function clear_post() {
190
- $fes = $this->form_scan_shortcode();
191
-
192
- foreach ( $fes as $fe ) {
193
- if ( ! isset( $fe['name'] ) || empty( $fe['name'] ) )
194
- continue;
195
-
196
- $name = $fe['name'];
197
-
198
- if ( isset( $_POST[$name] ) )
199
- unset( $_POST[$name] );
200
- }
201
- }
202
-
203
- /* Generating Form HTML */
204
-
205
- public function form_html( $atts = array() ) {
206
- $atts = wp_parse_args( $atts, array(
207
- 'html_id' => '',
208
- 'html_name' => '',
209
- 'html_class' => '' ) );
210
-
211
- $this->unit_tag = self::get_unit_tag( $this->id );
212
-
213
- $html = '<div class="wpcf7" id="' . $this->unit_tag . '">' . "\n";
214
-
215
- $html .= $this->screen_reader_response() . "\n";
216
-
217
- $url = wpcf7_get_request_uri();
218
-
219
- if ( $frag = strstr( $url, '#' ) )
220
- $url = substr( $url, 0, -strlen( $frag ) );
221
-
222
- $url .= '#' . $this->unit_tag;
223
-
224
- $url = apply_filters( 'wpcf7_form_action_url', $url );
225
-
226
- $id_attr = apply_filters( 'wpcf7_form_id_attr',
227
- preg_replace( '/[^A-Za-z0-9:._-]/', '', $atts['html_id'] ) );
228
-
229
- $name_attr = apply_filters( 'wpcf7_form_name_attr',
230
- preg_replace( '/[^A-Za-z0-9:._-]/', '', $atts['html_name'] ) );
231
-
232
- $class = 'wpcf7-form';
233
-
234
- $result = self::get_submission_status( $this->id );
235
-
236
- if ( $this->is_posted() ) {
237
- if ( empty( $result['valid'] ) )
238
- $class .= ' invalid';
239
- elseif ( ! empty( $result['spam'] ) )
240
- $class .= ' spam';
241
- elseif ( ! empty( $result['mail_sent'] ) )
242
- $class .= ' sent';
243
- else
244
- $class .= ' failed';
245
- }
246
-
247
- if ( $atts['html_class'] ) {
248
- $class .= ' ' . $atts['html_class'];
249
- }
250
-
251
- if ( $this->in_demo_mode() ) {
252
- $class .= ' demo';
253
- }
254
-
255
- $class = explode( ' ', $class );
256
- $class = array_map( 'sanitize_html_class', $class );
257
- $class = array_filter( $class );
258
- $class = array_unique( $class );
259
- $class = implode( ' ', $class );
260
- $class = apply_filters( 'wpcf7_form_class_attr', $class );
261
-
262
- $enctype = apply_filters( 'wpcf7_form_enctype', '' );
263
-
264
- $novalidate = apply_filters( 'wpcf7_form_novalidate',
265
- wpcf7_support_html5() ? ' novalidate="novalidate"' : '' );
266
-
267
- $html .= '<form action="' . esc_url( $url ) . '" method="post"'
268
- . ( $id_attr ? ' id="' . esc_attr( $id_attr ) . '"' : '' )
269
- . ( $name_attr ? ' name="' . esc_attr( $name_attr ) . '"' : '' )
270
- . ' class="' . esc_attr( $class ) . '"'
271
- . $enctype . $novalidate . '>' . "\n";
272
-
273
- $html .= $this->form_hidden_fields();
274
- $html .= $this->form_elements();
275
-
276
- if ( ! $this->responses_count )
277
- $html .= $this->form_response_output();
278
-
279
- $html .= '</form>';
280
- $html .= '</div>';
281
-
282
- return $html;
283
- }
284
-
285
- public function form_hidden_fields() {
286
- $hidden_fields = array(
287
- '_wpcf7' => $this->id,
288
- '_wpcf7_version' => WPCF7_VERSION,
289
- '_wpcf7_locale' => $this->locale,
290
- '_wpcf7_unit_tag' => $this->unit_tag );
291
-
292
- if ( WPCF7_VERIFY_NONCE )
293
- $hidden_fields['_wpnonce'] = wpcf7_create_nonce( $this->id );
294
-
295
- $content = '';
296
-
297
- foreach ( $hidden_fields as $name => $value ) {
298
- $content .= '<input type="hidden"'
299
- . ' name="' . esc_attr( $name ) . '"'
300
- . ' value="' . esc_attr( $value ) . '" />' . "\n";
301
- }
302
-
303
- return '<div style="display: none;">' . "\n" . $content . '</div>' . "\n";
304
- }
305
-
306
- public function form_response_output() {
307
- $class = 'wpcf7-response-output';
308
- $role = '';
309
- $content = '';
310
-
311
- if ( $this->is_posted() ) { // Post response output for non-AJAX
312
-
313
- $result = self::get_submission_status( $this->id );
314
-
315
- if ( empty( $result['valid'] ) )
316
- $class .= ' wpcf7-validation-errors';
317
- elseif ( ! empty( $result['spam'] ) )
318
- $class .= ' wpcf7-spam-blocked';
319
- elseif ( ! empty( $result['mail_sent'] ) )
320
- $class .= ' wpcf7-mail-sent-ok';
321
- else
322
- $class .= ' wpcf7-mail-sent-ng';
323
-
324
- $role = 'alert';
325
-
326
- if ( ! empty( $result['message'] ) )
327
- $content = $result['message'];
328
-
329
- } else {
330
- $class .= ' wpcf7-display-none';
331
- }
332
-
333
- $atts = array(
334
- 'class' => trim( $class ),
335
- 'role' => trim( $role ) );
336
-
337
- $atts = wpcf7_format_atts( $atts );
338
-
339
- $output = sprintf( '<div %1$s>%2$s</div>',
340
- $atts, esc_html( $content ) );
341
-
342
- return apply_filters( 'wpcf7_form_response_output',
343
- $output, $class, $content, $this );
344
- }
345
-
346
- public function screen_reader_response() {
347
- $class = 'screen-reader-response';
348
- $role = '';
349
- $content = '';
350
-
351
- if ( $this->is_posted() ) { // Post response output for non-AJAX
352
- $role = 'alert';
353
- $result = self::get_submission_status( $this->id );
354
-
355
- if ( ! empty( $result['message'] ) ) {
356
- $content = esc_html( $result['message'] );
357
-
358
- if ( ! empty( $result['invalid_reasons'] ) ) {
359
- $content .= "\n" . '<ul>' . "\n";
360
-
361
- foreach ( (array) $result['invalid_reasons'] as $k => $v ) {
362
- if ( isset( $result['invalid_fields'][$k] )
363
- && wpcf7_is_name( $result['invalid_fields'][$k] ) ) {
364
- $link = sprintf( '<a href="#%1$s">%2$s</a>',
365
- $result['invalid_fields'][$k],
366
- esc_html( $v ) );
367
- $content .= sprintf( '<li>%s</li>', $link );
368
- } else {
369
- $content .= sprintf( '<li>%s</li>', esc_html( $v ) );
370
- }
371
-
372
- $content .= "\n";
373
- }
374
-
375
- $content .= '</ul>' . "\n";
376
- }
377
- }
378
- }
379
-
380
- $atts = array(
381
- 'class' => trim( $class ),
382
- 'role' => trim( $role ) );
383
-
384
- $atts = wpcf7_format_atts( $atts );
385
-
386
- $output = sprintf( '<div %1$s>%2$s</div>',
387
- $atts, $content );
388
-
389
- return $output;
390
- }
391
-
392
- public function validation_error( $name ) {
393
- if ( ! $this->is_posted() )
394
- return '';
395
-
396
- $result = self::get_submission_status( $this->id );
397
-
398
- if ( ! isset( $result['invalid_reasons'][$name] ) )
399
- return '';
400
-
401
- $ve = trim( $result['invalid_reasons'][$name] );
402
-
403
- if ( empty( $ve ) )
404
- return '';
405
-
406
- $ve = '<span role="alert" class="wpcf7-not-valid-tip">'
407
- . esc_html( $ve ) . '</span>';
408
-
409
- return apply_filters( 'wpcf7_validation_error', $ve, $name, $this );
410
- }
411
-
412
- /* Form Elements */
413
-
414
- public function form_do_shortcode() {
415
- $manager = WPCF7_ShortcodeManager::get_instance();
416
- $form = $this->form;
417
-
418
- if ( WPCF7_AUTOP ) {
419
- $form = $manager->normalize_shortcode( $form );
420
- $form = wpcf7_autop( $form );
421
- }
422
-
423
- $form = $manager->do_shortcode( $form );
424
- $this->scanned_form_tags = $manager->get_scanned_tags();
425
-
426
- return $form;
427
- }
428
-
429
- public function form_scan_shortcode( $cond = null ) {
430
- $manager = WPCF7_ShortcodeManager::get_instance();
431
-
432
- if ( ! empty( $this->scanned_form_tags ) ) {
433
- $scanned = $this->scanned_form_tags;
434
- } else {
435
- $scanned = $manager->scan_shortcode( $this->form );
436
- $this->scanned_form_tags = $scanned;
437
- }
438
-
439
- if ( empty( $scanned ) )
440
- return null;
441
-
442
- if ( ! is_array( $cond ) || empty( $cond ) )
443
- return $scanned;
444
-
445
- for ( $i = 0, $size = count( $scanned ); $i < $size; $i++ ) {
446
-
447
- if ( isset( $cond['type'] ) ) {
448
- if ( is_string( $cond['type'] ) && ! empty( $cond['type'] ) ) {
449
- if ( $scanned[$i]['type'] != $cond['type'] ) {
450
- unset( $scanned[$i] );
451
- continue;
452
- }
453
- } elseif ( is_array( $cond['type'] ) ) {
454
- if ( ! in_array( $scanned[$i]['type'], $cond['type'] ) ) {
455
- unset( $scanned[$i] );
456
- continue;
457
- }
458
- }
459
- }
460
-
461
- if ( isset( $cond['name'] ) ) {
462
- if ( is_string( $cond['name'] ) && ! empty( $cond['name'] ) ) {
463
- if ( $scanned[$i]['name'] != $cond['name'] ) {
464
- unset ( $scanned[$i] );
465
- continue;
466
- }
467
- } elseif ( is_array( $cond['name'] ) ) {
468
- if ( ! in_array( $scanned[$i]['name'], $cond['name'] ) ) {
469
- unset( $scanned[$i] );
470
- continue;
471
- }
472
- }
473
- }
474
- }
475
-
476
- return array_values( $scanned );
477
- }
478
-
479
- public function form_elements() {
480
- return apply_filters( 'wpcf7_form_elements', $this->form_do_shortcode() );
481
- }
482
-
483
- public function setup_posted_data() {
484
- $posted_data = (array) $_POST;
485
-
486
- $fes = $this->form_scan_shortcode();
487
-
488
- foreach ( $fes as $fe ) {
489
- if ( empty( $fe['name'] ) )
490
- continue;
491
-
492
- $name = $fe['name'];
493
- $value = '';
494
-
495
- if ( isset( $posted_data[$name] ) )
496
- $value = $posted_data[$name];
497
-
498
- $pipes = $fe['pipes'];
499
-
500
- if ( WPCF7_USE_PIPE && is_a( $pipes, 'WPCF7_Pipes' ) && ! $pipes->zero() ) {
501
- if ( is_array( $value) ) {
502
- $new_value = array();
503
-
504
- foreach ( $value as $v )
505
- $new_value[] = $pipes->do_pipe( wp_unslash( $v ) );
506
-
507
- $value = $new_value;
508
- } else {
509
- $value = $pipes->do_pipe( wp_unslash( $value ) );
510
- }
511
- }
512
-
513
- $posted_data[$name] = $value;
514
- }
515
-
516
- $this->posted_data = apply_filters( 'wpcf7_posted_data', $posted_data );
517
-
518
- return $this->posted_data;
519
- }
520
-
521
- public function submit( $ajax = false ) {
522
- $result = array(
523
- 'status' => 'init',
524
- 'valid' => true,
525
- 'invalid_reasons' => array(),
526
- 'invalid_fields' => array(),
527
- 'spam' => false,
528
- 'message' => '',
529
- 'mail_sent' => false,
530
- 'scripts_on_sent_ok' => null,
531
- 'scripts_on_submit' => null );
532
-
533
- $this->setup_posted_data();
534
-
535
- $validation = $this->validate();
536
-
537
- if ( ! $validation['valid'] ) { // Validation error occured
538
- $result['status'] = 'validation_failed';
539
- $result['valid'] = false;
540
- $result['invalid_reasons'] = $validation['reason'];
541
- $result['invalid_fields'] = $validation['idref'];
542
- $result['message'] = $this->message( 'validation_error' );
543
-
544
- } elseif ( ! $this->accepted() ) { // Not accepted terms
545
- $result['status'] = 'acceptance_missing';
546
- $result['message'] = $this->message( 'accept_terms' );
547
-
548
- } elseif ( $this->spam() ) { // Spam!
549
- $result['status'] = 'spam';
550
- $result['message'] = $this->message( 'spam' );
551
- $result['spam'] = true;
552
-
553
- } elseif ( $this->mail() ) {
554
- if ( $this->in_demo_mode() ) {
555
- $result['status'] = 'demo_mode';
556
- } else {
557
- $result['status'] = 'mail_sent';
558
- }
559
-
560
- $result['mail_sent'] = true;
561
- $result['message'] = $this->message( 'mail_sent_ok' );
562
-
563
- do_action_ref_array( 'wpcf7_mail_sent', array( &$this ) );
564
-
565
- if ( $ajax ) {
566
- $on_sent_ok = $this->additional_setting( 'on_sent_ok', false );
567
-
568
- if ( ! empty( $on_sent_ok ) )
569
- $result['scripts_on_sent_ok'] = array_map( 'wpcf7_strip_quote', $on_sent_ok );
570
- } else {
571
- $this->clear_post();
572
- }
573
-
574
- } else {
575
- $result['status'] = 'mail_failed';
576
- $result['message'] = $this->message( 'mail_sent_ng' );
577
-
578
- do_action_ref_array( 'wpcf7_mail_failed', array( &$this ) );
579
- }
580
-
581
- if ( $ajax ) {
582
- $on_submit = $this->additional_setting( 'on_submit', false );
583
-
584
- if ( ! empty( $on_submit ) )
585
- $result['scripts_on_submit'] = array_map( 'wpcf7_strip_quote', $on_submit );
586
- }
587
-
588
- // remove upload files
589
- foreach ( (array) $this->uploaded_files as $name => $path ) {
590
- @unlink( $path );
591
- }
592
-
593
- do_action_ref_array( 'wpcf7_submit', array( &$this, $result ) );
594
-
595
- self::add_submission_status( $this->id, $result );
596
-
597
- return $result;
598
- }
599
-
600
- /* Validate */
601
-
602
- public function validate() {
603
- $fes = $this->form_scan_shortcode();
604
-
605
- $result = array(
606
- 'valid' => true,
607
- 'reason' => array(),
608
- 'idref' => array() );
609
-
610
- foreach ( $fes as $fe ) {
611
- $result = apply_filters( 'wpcf7_validate_' . $fe['type'], $result, $fe );
612
- }
613
-
614
- $result = apply_filters( 'wpcf7_validate', $result );
615
-
616
- return $result;
617
- }
618
-
619
- public function accepted() {
620
- $accepted = true;
621
-
622
- return apply_filters( 'wpcf7_acceptance', $accepted );
623
- }
624
-
625
- public function spam() {
626
- $spam = false;
627
-
628
- if ( WPCF7_VERIFY_NONCE && ! $this->verify_nonce() )
629
- $spam = true;
630
-
631
- if ( $this->blacklist_check() )
632
- $spam = true;
633
-
634
- return apply_filters( 'wpcf7_spam', $spam );
635
- }
636
-
637
- public function verify_nonce() {
638
- return wpcf7_verify_nonce( $_POST['_wpnonce'], $this->id );
639
- }
640
-
641
- public function blacklist_check() {
642
- $target = wpcf7_array_flatten( $this->posted_data );
643
- $target[] = $_SERVER['REMOTE_ADDR'];
644
- $target[] = $_SERVER['HTTP_USER_AGENT'];
645
-
646
- $target = implode( "\n", $target );
647
-
648
- return wpcf7_blacklist_check( $target );
649
- }
650
-
651
- /* Mail */
652
-
653
- public function mail() {
654
- if ( $this->in_demo_mode() )
655
- $this->skip_mail = true;
656
-
657
- do_action_ref_array( 'wpcf7_before_send_mail', array( &$this ) );
658
-
659
- if ( $this->skip_mail )
660
- return true;
661
-
662
- $result = $this->compose_mail( $this->setup_mail_template( $this->mail, 'mail' ) );
663
-
664
- if ( $result ) {
665
- $additional_mail = array();
666
-
667
- if ( $this->mail_2['active'] )
668
- $additional_mail[] = $this->setup_mail_template( $this->mail_2, 'mail_2' );
669
-
670
- $additional_mail = apply_filters_ref_array( 'wpcf7_additional_mail',
671
- array( $additional_mail, &$this ) );
672
-
673
- foreach ( $additional_mail as $mail )
674
- $this->compose_mail( $mail );
675
-
676
- return true;
677
- }
678
-
679
- return false;
680
- }
681
-
682
- public function setup_mail_template( $mail_template, $name = '' ) {
683
- $defaults = array(
684
- 'subject' => '', 'sender' => '', 'body' => '',
685
- 'recipient' => '', 'additional_headers' => '',
686
- 'attachments' => '', 'use_html' => false );
687
-
688
- $mail_template = wp_parse_args( $mail_template, $defaults );
689
-
690
- $name = trim( $name );
691
-
692
- if ( ! empty( $name ) )
693
- $mail_template['name'] = $name;
694
-
695
- return $mail_template;
696
- }
697
-
698
- public function compose_mail( $mail_template, $send = true ) {
699
- $this->mail_template_in_process = $mail_template;
700
-
701
- $use_html = (bool) $mail_template['use_html'];
702
-
703
- $subject = $this->replace_mail_tags( $mail_template['subject'] );
704
- $sender = $this->replace_mail_tags( $mail_template['sender'] );
705
- $recipient = $this->replace_mail_tags( $mail_template['recipient'] );
706
- $additional_headers = $this->replace_mail_tags( $mail_template['additional_headers'] );
707
-
708
- if ( $use_html ) {
709
- $body = $this->replace_mail_tags( $mail_template['body'], true );
710
- $body = wpautop( $body );
711
- } else {
712
- $body = $this->replace_mail_tags( $mail_template['body'] );
713
- }
714
-
715
- $attachments = $this->mail_attachments( $mail_template['attachments'] );
716
-
717
- $components = compact(
718
- 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments' );
719
-
720
- $components = apply_filters_ref_array( 'wpcf7_mail_components',
721
- array( $components, &$this ) );
722
-
723
- extract( $components );
724
-
725
- $subject = wpcf7_strip_newline( $subject );
726
- $sender = wpcf7_strip_newline( $sender );
727
- $recipient = wpcf7_strip_newline( $recipient );
728
-
729
- $headers = "From: $sender\n";
730
-
731
- if ( $use_html )
732
- $headers .= "Content-Type: text/html\n";
733
-
734
- $additional_headers = trim( $additional_headers );
735
-
736
- if ( $additional_headers )
737
- $headers .= $additional_headers . "\n";
738
-
739
- if ( $send )
740
- return @wp_mail( $recipient, $subject, $body, $headers, $attachments );
741
-
742
- return compact( 'subject', 'sender', 'body', 'recipient', 'headers', 'attachments' );
743
- }
744
-
745
- public function replace_mail_tags( $content, $html = false ) {
746
- $regex = '/(\[?)\[[\t ]*'
747
- . '([a-zA-Z_][0-9a-zA-Z:._-]*)' // [2] = name
748
- . '((?:[\t ]+"[^"]*"|[\t ]+\'[^\']*\')*)' // [3] = values
749
- . '[\t ]*\](\]?)/';
750
-
751
- if ( $html )
752
- $callback = array( $this, 'mail_callback_html' );
753
- else
754
- $callback = array( $this, 'mail_callback' );
755
-
756
- return preg_replace_callback( $regex, $callback, $content );
757
- }
758
-
759
- private function mail_callback_html( $matches ) {
760
- return $this->mail_callback( $matches, true );
761
- }
762
-
763
- private function mail_callback( $matches, $html = false ) {
764
- // allow [[foo]] syntax for escaping a tag
765
- if ( $matches[1] == '[' && $matches[4] == ']' )
766
- return substr( $matches[0], 1, -1 );
767
-
768
- $tag = $matches[0];
769
- $tagname = $matches[2];
770
- $values = $matches[3];
771
-
772
- if ( ! empty( $values ) ) {
773
- preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches );
774
- $values = wpcf7_strip_quote_deep( $matches[0] );
775
- }
776
-
777
- $do_not_heat = false;
778
-
779
- if ( preg_match( '/^_raw_(.+)$/', $tagname, $matches ) ) {
780
- $tagname = trim( $matches[1] );
781
- $do_not_heat = true;
782
- }
783
-
784
- $format = '';
785
-
786
- if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) {
787
- $tagname = trim( $matches[1] );
788
- $format = $values[0];
789
- }
790
-
791
- if ( isset( $this->posted_data[$tagname] ) ) {
792
-
793
- if ( $do_not_heat )
794
- $submitted = isset( $_POST[$tagname] ) ? $_POST[$tagname] : '';
795
- else
796
- $submitted = $this->posted_data[$tagname];
797
-
798
- $replaced = $submitted;
799
-
800
- if ( ! empty( $format ) ) {
801
- $replaced = $this->format( $replaced, $format );
802
- }
803
-
804
- $replaced = wpcf7_flat_join( $replaced );
805
-
806
- if ( $html ) {
807
- $replaced = esc_html( $replaced );
808
- $replaced = wptexturize( $replaced );
809
- }
810
-
811
- $replaced = apply_filters( 'wpcf7_mail_tag_replaced', $replaced,
812
- $submitted, $html );
813
-
814
- return wp_unslash( $replaced );
815
- }
816
-
817
- $special = apply_filters( 'wpcf7_special_mail_tags', '', $tagname, $html );
818
-
819
- if ( ! empty( $special ) )
820
- return $special;
821
-
822
- return $tag;
823
- }
824
-
825
- public function format( $original, $format ) {
826
- $original = (array) $original;
827
-
828
- foreach ( $original as $key => $value ) {
829
- if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value ) ) {
830
- $original[$key] = mysql2date( $format, $value );
831
- }
832
- }
833
-
834
- return $original;
835
- }
836
-
837
- public function mail_attachments( $template ) {
838
- $attachments = array();
839
-
840
- foreach ( (array) $this->uploaded_files as $name => $path ) {
841
- if ( false !== strpos( $template, "[${name}]" ) && ! empty( $path ) )
842
- $attachments[] = $path;
843
- }
844
-
845
- foreach ( explode( "\n", $template ) as $line ) {
846
- $line = trim( $line );
847
-
848
- if ( '[' == substr( $line, 0, 1 ) )
849
- continue;
850
-
851
- $path = path_join( WP_CONTENT_DIR, $line );
852
-
853
- if ( @is_readable( $path ) && @is_file( $path ) )
854
- $attachments[] = $path;
855
- }
856
-
857
- return $attachments;
858
- }
859
-
860
- /* Message */
861
-
862
- public function message( $status ) {
863
- $messages = $this->messages;
864
- $message = isset( $messages[$status] ) ? $messages[$status] : '';
865
-
866
- $message = $this->replace_mail_tags( $message, true );
867
-
868
- return apply_filters( 'wpcf7_display_message', $message, $status );
869
- }
870
-
871
- /* Additional settings */
872
-
873
- public function additional_setting( $name, $max = 1 ) {
874
- $tmp_settings = (array) explode( "\n", $this->additional_settings );
875
-
876
- $count = 0;
877
- $values = array();
878
-
879
- foreach ( $tmp_settings as $setting ) {
880
- if ( preg_match('/^([a-zA-Z0-9_]+)[\t ]*:(.*)$/', $setting, $matches ) ) {
881
- if ( $matches[1] != $name )
882
- continue;
883
-
884
- if ( ! $max || $count < (int) $max ) {
885
- $values[] = trim( $matches[2] );
886
- $count += 1;
887
- }
888
- }
889
- }
890
-
891
- return $values;
892
- }
893
-
894
- public function is_true( $name ) {
895
- $settings = $this->additional_setting( $name, false );
896
-
897
- foreach ( $settings as $setting ) {
898
- if ( in_array( $setting, array( 'on', 'true', '1' ) ) )
899
- return true;
900
- }
901
-
902
- return false;
903
- }
904
-
905
- public function in_demo_mode() {
906
- return $this->is_true( 'demo_mode' );
907
- }
908
-
909
- /* Upgrade */
910
-
911
- public function upgrade() {
912
- if ( is_array( $this->mail ) ) {
913
- if ( ! isset( $this->mail['recipient'] ) )
914
- $this->mail['recipient'] = get_option( 'admin_email' );
915
- }
916
-
917
- if ( is_array( $this->messages ) ) {
918
- foreach ( wpcf7_messages() as $key => $arr ) {
919
- if ( ! isset( $this->messages[$key] ) )
920
- $this->messages[$key] = $arr['default'];
921
- }
922
- }
923
- }
924
-
925
- /* Save */
926
-
927
- public function save() {
928
- $props = $this->get_properties();
929
-
930
- $post_content = implode( "\n", wpcf7_array_flatten( $props ) );
931
-
932
- if ( $this->initial ) {
933
- $post_id = wp_insert_post( array(
934
- 'post_type' => self::post_type,
935
- 'post_status' => 'publish',
936
- 'post_title' => $this->title,
937
- 'post_content' => trim( $post_content ) ) );
938
- } else {
939
- $post_id = wp_update_post( array(
940
- 'ID' => (int) $this->id,
941
- 'post_status' => 'publish',
942
- 'post_title' => $this->title,
943
- 'post_content' => trim( $post_content ) ) );
944
- }
945
-
946
- if ( $post_id ) {
947
- foreach ( $props as $prop => $value )
948
- update_post_meta( $post_id, '_' . $prop, wpcf7_normalize_newline_deep( $value ) );
949
-
950
- if ( ! empty( $this->locale ) )
951
- update_post_meta( $post_id, '_locale', $this->locale );
952
-
953
- if ( $this->initial ) {
954
- $this->initial = false;
955
- $this->id = $post_id;
956
- do_action_ref_array( 'wpcf7_after_create', array( &$this ) );
957
- } else {
958
- do_action_ref_array( 'wpcf7_after_update', array( &$this ) );
959
- }
960
-
961
- do_action_ref_array( 'wpcf7_after_save', array( &$this ) );
962
- }
963
-
964
- return $post_id;
965
- }
966
-
967
- public function copy() {
968
- $new = new self;
969
- $new->initial = true;
970
- $new->title = $this->title . '_copy';
971
- $new->locale = $this->locale;
972
-
973
- $props = $this->get_properties();
974
-
975
- foreach ( $props as $prop => $value )
976
- $new->{$prop} = $value;
977
-
978
- $new = apply_filters_ref_array( 'wpcf7_copy', array( &$new, &$this ) );
979
-
980
- return $new;
981
- }
982
-
983
- public function delete() {
984
- if ( $this->initial )
985
- return;
986
-
987
- if ( wp_delete_post( $this->id, true ) ) {
988
- $this->initial = true;
989
- $this->id = null;
990
- return true;
991
- }
992
-
993
- return false;
994
- }
995
- }
996
-
997
- function wpcf7_contact_form( $id ) {
998
- $contact_form = new WPCF7_ContactForm( $id );
999
-
1000
- if ( $contact_form->initial )
1001
- return false;
1002
-
1003
- return $contact_form;
1004
- }
1005
-
1006
- function wpcf7_get_contact_form_by_old_id( $old_id ) {
1007
- global $wpdb;
1008
-
1009
- $q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'"
1010
- . $wpdb->prepare( " AND meta_value = %d", $old_id );
1011
-
1012
- if ( $new_id = $wpdb->get_var( $q ) )
1013
- return wpcf7_contact_form( $new_id );
1014
- }
1015
-
1016
- function wpcf7_get_contact_form_by_title( $title ) {
1017
- $page = get_page_by_title( $title, OBJECT, WPCF7_ContactForm::post_type );
1018
-
1019
- if ( $page )
1020
- return wpcf7_contact_form( $page->ID );
1021
-
1022
- return null;
1023
- }
1024
-
1025
- function wpcf7_get_contact_form_default_pack( $args = '' ) {
1026
- $contact_form = WPCF7_ContactForm::generate_default_package( $args );
1027
-
1028
- return $contact_form;
1029
- }
1030
-
1031
- function wpcf7_get_current_contact_form() {
1032
- if ( $current = WPCF7_ContactForm::get_current() ) {
1033
- return $current;
1034
- }
1035
- }
1036
-
1037
- function wpcf7_is_posted() {
1038
- if ( ! $contact_form = wpcf7_get_current_contact_form() )
1039
- return false;
1040
-
1041
- return $contact_form->is_posted();
1042
- }
1043
-
1044
- function wpcf7_get_validation_error( $name ) {
1045
- if ( ! $contact_form = wpcf7_get_current_contact_form() )
1046
- return '';
1047
-
1048
- return $contact_form->validation_error( $name );
1049
- }
1050
-
1051
- function wpcf7_get_message( $status ) {
1052
- if ( ! $contact_form = wpcf7_get_current_contact_form() )
1053
- return '';
1054
-
1055
- return $contact_form->message( $status );
1056
- }
1057
-
1058
- function wpcf7_scan_shortcode( $cond = null ) {
1059
- if ( ! $contact_form = wpcf7_get_current_contact_form() )
1060
- return null;
1061
-
1062
- return $contact_form->form_scan_shortcode( $cond );
1063
- }
1064
-
1065
- function wpcf7_form_controls_class( $type, $default = '' ) {
1066
- $type = trim( $type );
1067
- $default = array_filter( explode( ' ', $default ) );
1068
-
1069
- $classes = array_merge( array( 'wpcf7-form-control' ), $default );
1070
-
1071
- $typebase = rtrim( $type, '*' );
1072
- $required = ( '*' == substr( $type, -1 ) );
1073
-
1074
- $classes[] = 'wpcf7-' . $typebase;
1075
-
1076
- if ( $required )
1077
- $classes[] = 'wpcf7-validates-as-required';
1078
-
1079
- $classes = array_unique( $classes );
1080
-
1081
- return implode( ' ', $classes );
1082
- }
1083
-
1084
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/contact-form.php ADDED
@@ -0,0 +1,899 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPCF7_ContactForm {
4
+
5
+ const post_type = 'wpcf7_contact_form';
6
+
7
+ private static $found_items = 0;
8
+ private static $current = null;
9
+
10
+ private $id;
11
+ private $name;
12
+ private $title;
13
+ private $properties = array();
14
+ private $unit_tag;
15
+ private $responses_count = 0;
16
+ private $scanned_form_tags;
17
+
18
+ public static function count() {
19
+ return self::$found_items;
20
+ }
21
+
22
+ public static function get_current() {
23
+ return self::$current;
24
+ }
25
+
26
+ public static function register_post_type() {
27
+ register_post_type( self::post_type, array(
28
+ 'labels' => array(
29
+ 'name' => __( 'Contact Forms', 'contact-form-7' ),
30
+ 'singular_name' => __( 'Contact Form', 'contact-form-7' ) ),
31
+ 'rewrite' => false,
32
+ 'query_var' => false ) );
33
+ }
34
+
35
+ public static function find( $args = '' ) {
36
+ $defaults = array(
37
+ 'post_status' => 'any',
38
+ 'posts_per_page' => -1,
39
+ 'offset' => 0,
40
+ 'orderby' => 'ID',
41
+ 'order' => 'ASC' );
42
+
43
+ $args = wp_parse_args( $args, $defaults );
44
+
45
+ $args['post_type'] = self::post_type;
46
+
47
+ $q = new WP_Query();
48
+ $posts = $q->query( $args );
49
+
50
+ self::$found_items = $q->found_posts;
51
+
52
+ $objs = array();
53
+
54
+ foreach ( (array) $posts as $post )
55
+ $objs[] = new self( $post );
56
+
57
+ return $objs;
58
+ }
59
+
60
+ public static function get_template( $args = '' ) {
61
+ global $l10n;
62
+
63
+ $defaults = array( 'locale' => null, 'title' => '' );
64
+ $args = wp_parse_args( $args, $defaults );
65
+
66
+ $locale = $args['locale'];
67
+ $title = $args['title'];
68
+
69
+ if ( $locale ) {
70
+ $mo_orig = $l10n['contact-form-7'];
71
+ wpcf7_load_textdomain( $locale );
72
+ }
73
+
74
+ self::$current = $contact_form = new self;
75
+ $contact_form->title =
76
+ ( $title ? $title : __( 'Untitled', 'contact-form-7' ) );
77
+ $contact_form->locale = ( $locale ? $locale : get_locale() );
78
+
79
+ $properties = $contact_form->get_properties();
80
+
81
+ foreach ( $properties as $key => $value ) {
82
+ $properties[$key] = wpcf7_get_default_template( $key );
83
+ }
84
+
85
+ $contact_form->properties = $properties;
86
+
87
+ $contact_form = apply_filters( 'wpcf7_contact_form_default_pack',
88
+ $contact_form, $args );
89
+
90
+ if ( isset( $mo_orig ) ) {
91
+ $l10n['contact-form-7'] = $mo_orig;
92
+ }
93
+
94
+ return $contact_form;
95
+ }
96
+
97
+ public static function get_instance( $post ) {
98
+ $post = get_post( $post );
99
+
100
+ if ( ! $post || self::post_type != get_post_type( $post ) ) {
101
+ return false;
102
+ }
103
+
104
+ self::$current = $contact_form = new self( $post );
105
+
106
+ return $contact_form;
107
+ }
108
+
109
+ private static function get_unit_tag( $id = 0 ) {
110
+ static $global_count = 0;
111
+
112
+ $global_count += 1;
113
+
114
+ if ( in_the_loop() ) {
115
+ $unit_tag = sprintf( 'wpcf7-f%1$d-p%2$d-o%3$d',
116
+ absint( $id ), get_the_ID(), $global_count );
117
+ } else {
118
+ $unit_tag = sprintf( 'wpcf7-f%1$d-o%2$d',
119
+ absint( $id ), $global_count );
120
+ }
121
+
122
+ return $unit_tag;
123
+ }
124
+
125
+ private function __construct( $post = null ) {
126
+ $post = get_post( $post );
127
+
128
+ if ( $post && self::post_type == get_post_type( $post ) ) {
129
+ $this->id = $post->ID;
130
+ $this->name = $post->post_name;
131
+ $this->title = $post->post_title;
132
+ $this->locale = get_post_meta( $post->ID, '_locale', true );
133
+
134
+ $properties = $this->get_properties();
135
+
136
+ foreach ( $properties as $key => $value ) {
137
+ if ( metadata_exists( 'post', $post->ID, '_' . $key ) ) {
138
+ $properties[$key] = get_post_meta( $post->ID, '_' . $key, true );
139
+ } elseif ( metadata_exists( 'post', $post->ID, $key ) ) {
140
+ $properties[$key] = get_post_meta( $post->ID, $key, true );
141
+ }
142
+ }
143
+
144
+ $this->properties = $properties;
145
+ $this->upgrade();
146
+ }
147
+
148
+ do_action( 'wpcf7_contact_form', $this );
149
+ }
150
+
151
+ public function initial() {
152
+ return empty( $this->id );
153
+ }
154
+
155
+ public function prop( $name ) {
156
+ $props = $this->get_properties();
157
+ return isset( $props[$name] ) ? $props[$name] : null;
158
+ }
159
+
160
+ public function get_properties() {
161
+ $properties = (array) $this->properties;
162
+
163
+ $properties = wp_parse_args( $properties, array(
164
+ 'form' => '',
165
+ 'mail' => array(),
166
+ 'mail_2' => array(),
167
+ 'messages' => array(),
168
+ 'additional_settings' => '' ) );
169
+
170
+ $properties = (array) apply_filters( 'wpcf7_contact_form_properties',
171
+ $properties, $this );
172
+
173
+ return $properties;
174
+ }
175
+
176
+ public function set_properties( $properties ) {
177
+ $defaults = $this->get_properties();
178
+
179
+ $properties = wp_parse_args( $properties, $defaults );
180
+ $properties = array_intersect_key( $properties, $defaults );
181
+
182
+ $this->properties = $properties;
183
+ }
184
+
185
+ public function id() {
186
+ return $this->id;
187
+ }
188
+
189
+ public function name() {
190
+ return $this->name;
191
+ }
192
+
193
+ public function title() {
194
+ return $this->title;
195
+ }
196
+
197
+ public function set_title( $title ) {
198
+ $title = trim( $title );
199
+
200
+ if ( '' === $title ) {
201
+ $title = __( 'Untitled', 'contact-form-7' );
202
+ }
203
+
204
+ $this->title = $title;
205
+ }
206
+
207
+ // Return true if this form is the same one as currently POSTed.
208
+ public function is_posted() {
209
+ if ( ! WPCF7_Submission::get_instance() ) {
210
+ return false;
211
+ }
212
+
213
+ if ( empty( $_POST['_wpcf7_unit_tag'] ) ) {
214
+ return false;
215
+ }
216
+
217
+ return $this->unit_tag == $_POST['_wpcf7_unit_tag'];
218
+ }
219
+
220
+ /* Generating Form HTML */
221
+
222
+ public function form_html( $atts = array() ) {
223
+ $atts = wp_parse_args( $atts, array(
224
+ 'html_id' => '',
225
+ 'html_name' => '',
226
+ 'html_class' => '',
227
+ 'output' => 'form' ) );
228
+
229
+ if ( 'raw_form' == $atts['output'] ) {
230
+ return '<pre class="wpcf7-raw-form"><code>'
231
+ . esc_html( $this->prop( 'form' ) ) . '</code></pre>';
232
+ }
233
+
234
+ $this->unit_tag = self::get_unit_tag( $this->id );
235
+
236
+ $html = sprintf( '<div %s>', wpcf7_format_atts( array(
237
+ 'class' => 'wpcf7',
238
+ 'id' => $this->unit_tag,
239
+ ( get_option( 'html_type' ) == 'text/html' ) ? 'lang' : 'xml:lang'
240
+ => str_replace( '_', '-', $this->locale ),
241
+ 'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr' ) ) ) . "\n";
242
+
243
+ $html .= $this->screen_reader_response() . "\n";
244
+
245
+ $url = wpcf7_get_request_uri();
246
+
247
+ if ( $frag = strstr( $url, '#' ) )
248
+ $url = substr( $url, 0, -strlen( $frag ) );
249
+
250
+ $url .= '#' . $this->unit_tag;
251
+
252
+ $url = apply_filters( 'wpcf7_form_action_url', $url );
253
+
254
+ $id_attr = apply_filters( 'wpcf7_form_id_attr',
255
+ preg_replace( '/[^A-Za-z0-9:._-]/', '', $atts['html_id'] ) );
256
+
257
+ $name_attr = apply_filters( 'wpcf7_form_name_attr',
258
+ preg_replace( '/[^A-Za-z0-9:._-]/', '', $atts['html_name'] ) );
259
+
260
+ $class = 'wpcf7-form';
261
+
262
+ if ( $this->is_posted() ) {
263
+ $submission = WPCF7_Submission::get_instance();
264
+
265
+ if ( $submission->is( 'validation_failed' ) ) {
266
+ $class .= ' invalid';
267
+ } elseif ( $submission->is( 'spam' ) ) {
268
+ $class .= ' spam';
269
+ } elseif ( $submission->is( 'mail_sent' ) ) {
270
+ $class .= ' sent';
271
+ } elseif ( $submission->is( 'mail_failed' ) ) {
272
+ $class .= ' failed';
273
+ }
274
+ }
275
+
276
+ if ( $atts['html_class'] ) {
277
+ $class .= ' ' . $atts['html_class'];
278
+ }
279
+
280
+ if ( $this->in_demo_mode() ) {
281
+ $class .= ' demo';
282
+ }
283
+
284
+ $class = explode( ' ', $class );
285
+ $class = array_map( 'sanitize_html_class', $class );
286
+ $class = array_filter( $class );
287
+ $class = array_unique( $class );
288
+ $class = implode( ' ', $class );
289
+ $class = apply_filters( 'wpcf7_form_class_attr', $class );
290
+
291
+ $enctype = apply_filters( 'wpcf7_form_enctype', '' );
292
+
293
+ $novalidate = apply_filters( 'wpcf7_form_novalidate', wpcf7_support_html5() );
294
+
295
+ $html .= sprintf( '<form %s>',
296
+ wpcf7_format_atts( array(
297
+ 'action' => esc_url( $url ),
298
+ 'method' => 'post',
299
+ 'id' => $id_attr,
300
+ 'name' => $name_attr,
301
+ 'class' => $class,
302
+ 'enctype' => wpcf7_enctype_value( $enctype ),
303
+ 'novalidate' => $novalidate ? 'novalidate' : '' ) ) ) . "\n";
304
+
305
+ $html .= $this->form_hidden_fields();
306
+ $html .= $this->form_elements();
307
+
308
+ if ( ! $this->responses_count ) {
309
+ $html .= $this->form_response_output();
310
+ }
311
+
312
+ $html .= '</form>';
313
+ $html .= '</div>';
314
+
315
+ return $html;
316
+ }
317
+
318
+ private function form_hidden_fields() {
319
+ $hidden_fields = array(
320
+ '_wpcf7' => $this->id,
321
+ '_wpcf7_version' => WPCF7_VERSION,
322
+ '_wpcf7_locale' => $this->locale,
323
+ '_wpcf7_unit_tag' => $this->unit_tag );
324
+
325
+ if ( WPCF7_VERIFY_NONCE )
326
+ $hidden_fields['_wpnonce'] = wpcf7_create_nonce( $this->id );
327
+
328
+ $content = '';
329
+
330
+ foreach ( $hidden_fields as $name => $value ) {
331
+ $content .= '<input type="hidden"'
332
+ . ' name="' . esc_attr( $name ) . '"'
333
+ . ' value="' . esc_attr( $value ) . '" />' . "\n";
334
+ }
335
+
336
+ return '<div style="display: none;">' . "\n" . $content . '</div>' . "\n";
337
+ }
338
+
339
+ public function form_response_output() {
340
+ $class = 'wpcf7-response-output';
341
+ $role = '';
342
+ $content = '';
343
+
344
+ if ( $this->is_posted() ) { // Post response output for non-AJAX
345
+ $role = 'alert';
346
+
347
+ $submission = WPCF7_Submission::get_instance();
348
+ $content = $submission->get_response();
349
+
350
+ if ( $submission->is( 'validation_failed' ) ) {
351
+ $class .= ' wpcf7-validation-errors';
352
+ } elseif ( $submission->is( 'spam' ) ) {
353
+ $class .= ' wpcf7-spam-blocked';
354
+ } elseif ( $submission->is( 'mail_sent' ) ) {
355
+ $class .= ' wpcf7-mail-sent-ok';
356
+ } elseif ( $submission->is( 'mail_failed' ) ) {
357
+ $class .= ' wpcf7-mail-sent-ng';
358
+ }
359
+ } else {
360
+ $class .= ' wpcf7-display-none';
361
+ }
362
+
363
+ $atts = array(
364
+ 'class' => trim( $class ),
365
+ 'role' => trim( $role ) );
366
+
367
+ $atts = wpcf7_format_atts( $atts );
368
+
369
+ $output = sprintf( '<div %1$s>%2$s</div>',
370
+ $atts, esc_html( $content ) );
371
+
372
+ $output = apply_filters( 'wpcf7_form_response_output',
373
+ $output, $class, $content, $this );
374
+
375
+ $this->responses_count += 1;
376
+
377
+ return $output;
378
+ }
379
+
380
+ public function screen_reader_response() {
381
+ $class = 'screen-reader-response';
382
+ $role = '';
383
+ $content = '';
384
+
385
+ if ( $this->is_posted() ) { // Post response output for non-AJAX
386
+ $role = 'alert';
387
+
388
+ $submission = WPCF7_Submission::get_instance();
389
+
390
+ if ( $response = $submission->get_response() ) {
391
+ $content = esc_html( $response );
392
+ }
393
+
394
+ if ( $invalid_fields = $submission->get_invalid_fields() ) {
395
+ $content .= "\n" . '<ul>' . "\n";
396
+
397
+ foreach ( (array) $invalid_fields as $name => $field ) {
398
+ if ( $field['idref'] ) {
399
+ $link = sprintf( '<a href="#%1$s">%2$s</a>',
400
+ esc_attr( $field['idref'] ),
401
+ esc_html( $field['reason'] ) );
402
+ $content .= sprintf( '<li>%s</li>', $link );
403
+ } else {
404
+ $content .= sprintf( '<li>%s</li>',
405
+ esc_html( $field['reason'] ) );
406
+ }
407
+
408
+ $content .= "\n";
409
+ }
410
+
411
+ $content .= '</ul>' . "\n";
412
+ }
413
+ }
414
+
415
+ $atts = array(
416
+ 'class' => trim( $class ),
417
+ 'role' => trim( $role ) );
418
+
419
+ $atts = wpcf7_format_atts( $atts );
420
+
421
+ $output = sprintf( '<div %1$s>%2$s</div>',
422
+ $atts, $content );
423
+
424
+ return $output;
425
+ }
426
+
427
+ public function validation_error( $name ) {
428
+ $error = '';
429
+
430
+ if ( $this->is_posted() ) {
431
+ $submission = WPCF7_Submission::get_instance();
432
+
433
+ if ( $invalid_field = $submission->get_invalid_field( $name ) ) {
434
+ $error = trim( $invalid_field['reason'] );
435
+ }
436
+ }
437
+
438
+ if ( ! $error ) {
439
+ return $error;
440
+ }
441
+
442
+ $error = sprintf(
443
+ '<span role="alert" class="wpcf7-not-valid-tip">%s</span>',
444
+ esc_html( $error ) );
445
+
446
+ return apply_filters( 'wpcf7_validation_error', $error, $name, $this );
447
+ }
448
+
449
+ /* Form Elements */
450
+
451
+ public function form_do_shortcode() {
452
+ $manager = WPCF7_ShortcodeManager::get_instance();
453
+ $form = $this->prop( 'form' );
454
+
455
+ if ( WPCF7_AUTOP ) {
456
+ $form = $manager->normalize_shortcode( $form );
457
+ $form = wpcf7_autop( $form );
458
+ }
459
+
460
+ $form = $manager->do_shortcode( $form );
461
+ $this->scanned_form_tags = $manager->get_scanned_tags();
462
+
463
+ return $form;
464
+ }
465
+
466
+ public function form_scan_shortcode( $cond = null ) {
467
+ $manager = WPCF7_ShortcodeManager::get_instance();
468
+
469
+ if ( ! empty( $this->scanned_form_tags ) ) {
470
+ $scanned = $this->scanned_form_tags;
471
+ } else {
472
+ $scanned = $manager->scan_shortcode( $this->prop( 'form' ) );
473
+ $this->scanned_form_tags = $scanned;
474
+ }
475
+
476
+ if ( empty( $scanned ) )
477
+ return null;
478
+
479
+ if ( ! is_array( $cond ) || empty( $cond ) )
480
+ return $scanned;
481
+
482
+ for ( $i = 0, $size = count( $scanned ); $i < $size; $i++ ) {
483
+
484
+ if ( isset( $cond['type'] ) ) {
485
+ if ( is_string( $cond['type'] ) && ! empty( $cond['type'] ) ) {
486
+ if ( $scanned[$i]['type'] != $cond['type'] ) {
487
+ unset( $scanned[$i] );
488
+ continue;
489
+ }
490
+ } elseif ( is_array( $cond['type'] ) ) {
491
+ if ( ! in_array( $scanned[$i]['type'], $cond['type'] ) ) {
492
+ unset( $scanned[$i] );
493
+ continue;
494
+ }
495
+ }
496
+ }
497
+
498
+ if ( isset( $cond['name'] ) ) {
499
+ if ( is_string( $cond['name'] ) && ! empty( $cond['name'] ) ) {
500
+ if ( $scanned[$i]['name'] != $cond['name'] ) {
501
+ unset ( $scanned[$i] );
502
+ continue;
503
+ }
504
+ } elseif ( is_array( $cond['name'] ) ) {
505
+ if ( ! in_array( $scanned[$i]['name'], $cond['name'] ) ) {
506
+ unset( $scanned[$i] );
507
+ continue;
508
+ }
509
+ }
510
+ }
511
+ }
512
+
513
+ return array_values( $scanned );
514
+ }
515
+
516
+ public function form_elements() {
517
+ return apply_filters( 'wpcf7_form_elements', $this->form_do_shortcode() );
518
+ }
519
+
520
+ public function submit( $ajax = false ) {
521
+ $submission = WPCF7_Submission::get_instance( $this );
522
+
523
+ $result = array(
524
+ 'status' => $submission->get_status(),
525
+ 'message' => $submission->get_response() );
526
+
527
+ if ( $submission->is( 'validation_failed' ) ) {
528
+ $result['invalid_fields'] = $submission->get_invalid_fields();
529
+ }
530
+
531
+ if ( $submission->is( 'mail_sent' ) ) {
532
+ if ( $this->in_demo_mode() ) {
533
+ $result['status'] = 'demo_mode';
534
+ }
535
+
536
+ if ( $ajax ) {
537
+ $on_sent_ok = $this->additional_setting( 'on_sent_ok', false );
538
+
539
+ if ( ! empty( $on_sent_ok ) ) {
540
+ $result['scripts_on_sent_ok'] = array_map(
541
+ 'wpcf7_strip_quote', $on_sent_ok );
542
+ }
543
+ }
544
+ }
545
+
546
+ if ( $ajax ) {
547
+ $on_submit = $this->additional_setting( 'on_submit', false );
548
+
549
+ if ( ! empty( $on_submit ) ) {
550
+ $result['scripts_on_submit'] = array_map(
551
+ 'wpcf7_strip_quote', $on_submit );
552
+ }
553
+ }
554
+
555
+ do_action( 'wpcf7_submit', $this, $result );
556
+
557
+ return $result;
558
+ }
559
+
560
+ /* Message */
561
+
562
+ public function message( $status, $filter = true ) {
563
+ $messages = $this->prop( 'messages' );
564
+ $message = isset( $messages[$status] ) ? $messages[$status] : '';
565
+
566
+ if ( $filter ) {
567
+ $message = wpcf7_mail_replace_tags( $message, array( 'html' => true ) );
568
+ $message = apply_filters( 'wpcf7_display_message', $message, $status );
569
+ }
570
+
571
+ return $message;
572
+ }
573
+
574
+ /* Additional settings */
575
+
576
+ public function additional_setting( $name, $max = 1 ) {
577
+ $tmp_settings = (array) explode( "\n", $this->prop( 'additional_settings' ) );
578
+
579
+ $count = 0;
580
+ $values = array();
581
+
582
+ foreach ( $tmp_settings as $setting ) {
583
+ if ( preg_match('/^([a-zA-Z0-9_]+)[\t ]*:(.*)$/', $setting, $matches ) ) {
584
+ if ( $matches[1] != $name )
585
+ continue;
586
+
587
+ if ( ! $max || $count < (int) $max ) {
588
+ $values[] = trim( $matches[2] );
589
+ $count += 1;
590
+ }
591
+ }
592
+ }
593
+
594
+ return $values;
595
+ }
596
+
597
+ public function is_true( $name ) {
598
+ $settings = $this->additional_setting( $name, false );
599
+
600
+ foreach ( $settings as $setting ) {
601
+ if ( in_array( $setting, array( 'on', 'true', '1' ) ) )
602
+ return true;
603
+ }
604
+
605
+ return false;
606
+ }
607
+
608
+ public function in_demo_mode() {
609
+ return $this->is_true( 'demo_mode' );
610
+ }
611
+
612
+ /* Upgrade */
613
+
614
+ private function upgrade() {
615
+ $mail = $this->prop( 'mail' );
616
+
617
+ if ( is_array( $mail ) && ! isset( $mail['recipient'] ) ) {
618
+ $mail['recipient'] = get_option( 'admin_email' );
619
+ }
620
+
621
+ $this->properties['mail'] = $mail;
622
+
623
+ $messages = $this->prop( 'messages' );
624
+
625
+ if ( is_array( $messages ) ) {
626
+ foreach ( wpcf7_messages() as $key => $arr ) {
627
+ if ( ! isset( $messages[$key] ) ) {
628
+ $messages[$key] = $arr['default'];
629
+ }
630
+ }
631
+ }
632
+
633
+ $this->properties['messages'] = $messages;
634
+ }
635
+
636
+ /* Save */
637
+
638
+ public function save() {
639
+ $props = $this->get_properties();
640
+
641
+ $post_content = implode( "\n", wpcf7_array_flatten( $props ) );
642
+
643
+ if ( $this->initial() ) {
644
+ $post_id = wp_insert_post( array(
645
+ 'post_type' => self::post_type,
646
+ 'post_status' => 'publish',
647
+ 'post_title' => $this->title,
648
+ 'post_content' => trim( $post_content ) ) );
649
+ } else {
650
+ $post_id = wp_update_post( array(
651
+ 'ID' => (int) $this->id,
652
+ 'post_status' => 'publish',
653
+ 'post_title' => $this->title,
654
+ 'post_content' => trim( $post_content ) ) );
655
+ }
656
+
657
+ if ( $post_id ) {
658
+ foreach ( $props as $prop => $value ) {
659
+ update_post_meta( $post_id, '_' . $prop,
660
+ wpcf7_normalize_newline_deep( $value ) );
661
+ }
662
+
663
+ if ( wpcf7_is_valid_locale( $this->locale ) ) {
664
+ update_post_meta( $post_id, '_locale', $this->locale );
665
+ }
666
+
667
+ if ( $this->initial() ) {
668
+ $this->id = $post_id;
669
+ do_action( 'wpcf7_after_create', $this );
670
+ } else {
671
+ do_action( 'wpcf7_after_update', $this );
672
+ }
673
+
674
+ do_action( 'wpcf7_after_save', $this );
675
+ }
676
+
677
+ return $post_id;
678
+ }
679
+
680
+ public function copy() {
681
+ $new = new self;
682
+ $new->title = $this->title . '_copy';
683
+ $new->locale = $this->locale;
684
+ $new->properties = $this->properties;
685
+
686
+ return apply_filters( 'wpcf7_copy', $new, $this );
687
+ }
688
+
689
+ public function delete() {
690
+ if ( $this->initial() )
691
+ return;
692
+
693
+ if ( wp_delete_post( $this->id, true ) ) {
694
+ $this->id = 0;
695
+ return true;
696
+ }
697
+
698
+ return false;
699
+ }
700
+ }
701
+
702
+ function wpcf7_contact_form( $id ) {
703
+ return WPCF7_ContactForm::get_instance( $id );
704
+ }
705
+
706
+ function wpcf7_get_contact_form_by_old_id( $old_id ) {
707
+ global $wpdb;
708
+
709
+ $q = "SELECT post_id FROM $wpdb->postmeta WHERE meta_key = '_old_cf7_unit_id'"
710
+ . $wpdb->prepare( " AND meta_value = %d", $old_id );
711
+
712
+ if ( $new_id = $wpdb->get_var( $q ) )
713
+ return wpcf7_contact_form( $new_id );
714
+ }
715
+
716
+ function wpcf7_get_contact_form_by_title( $title ) {
717
+ $page = get_page_by_title( $title, OBJECT, WPCF7_ContactForm::post_type );
718
+
719
+ if ( $page )
720
+ return wpcf7_contact_form( $page->ID );
721
+
722
+ return null;
723
+ }
724
+
725
+ function wpcf7_get_current_contact_form() {
726
+ if ( $current = WPCF7_ContactForm::get_current() ) {
727
+ return $current;
728
+ }
729
+ }
730
+
731
+ function wpcf7_is_posted() {
732
+ if ( ! $contact_form = wpcf7_get_current_contact_form() )
733
+ return false;
734
+
735
+ return $contact_form->is_posted();
736
+ }
737
+
738
+ function wpcf7_get_hangover( $name, $default = null ) {
739
+ if ( ! wpcf7_is_posted() ) {
740
+ return $default;
741
+ }
742
+
743
+ $submission = WPCF7_Submission::get_instance();
744
+
745
+ if ( ! $submission || $submission->is( 'mail_sent' ) ) {
746
+ return $default;
747
+ }
748
+
749
+ return isset( $_POST[$name] ) ? wp_unslash( $_POST[$name] ) : $default;
750
+ }
751
+
752
+ function wpcf7_get_validation_error( $name ) {
753
+ if ( ! $contact_form = wpcf7_get_current_contact_form() )
754
+ return '';
755
+
756
+ return $contact_form->validation_error( $name );
757
+ }
758
+
759
+ function wpcf7_get_message( $status ) {
760
+ if ( ! $contact_form = wpcf7_get_current_contact_form() )
761
+ return '';
762
+
763
+ return $contact_form->message( $status );
764
+ }
765
+
766
+ function wpcf7_scan_shortcode( $cond = null ) {
767
+ if ( ! $contact_form = wpcf7_get_current_contact_form() )
768
+ return null;
769
+
770
+ return $contact_form->form_scan_shortcode( $cond );
771
+ }
772
+
773
+ function wpcf7_form_controls_class( $type, $default = '' ) {
774
+ $type = trim( $type );
775
+ $default = array_filter( explode( ' ', $default ) );
776
+
777
+ $classes = array_merge( array( 'wpcf7-form-control' ), $default );
778
+
779
+ $typebase = rtrim( $type, '*' );
780
+ $required = ( '*' == substr( $type, -1 ) );
781
+
782
+ $classes[] = 'wpcf7-' . $typebase;
783
+
784
+ if ( $required )
785
+ $classes[] = 'wpcf7-validates-as-required';
786
+
787
+ $classes = array_unique( $classes );
788
+
789
+ return implode( ' ', $classes );
790
+ }
791
+
792
+ function wpcf7_get_default_template( $prop = 'form' ) {
793
+ if ( 'form' == $prop )
794
+ $template = wpcf7_default_form_template();
795
+ elseif ( 'mail' == $prop )
796
+ $template = wpcf7_default_mail_template();
797
+ elseif ( 'mail_2' == $prop )
798
+ $template = wpcf7_default_mail_2_template();
799
+ elseif ( 'messages' == $prop )
800
+ $template = wpcf7_default_messages_template();
801
+ else
802
+ $template = null;
803
+
804
+ return apply_filters( 'wpcf7_default_template', $template, $prop );
805
+ }
806
+
807
+ function wpcf7_default_form_template() {
808
+ $template =
809
+ '<p>' . __( 'Your Name', 'contact-form-7' ) . ' ' . __( '(required)', 'contact-form-7' ) . '<br />' . "\n"
810
+ . ' [text* your-name] </p>' . "\n\n"
811
+ . '<p>' . __( 'Your Email', 'contact-form-7' ) . ' ' . __( '(required)', 'contact-form-7' ) . '<br />' . "\n"
812
+ . ' [email* your-email] </p>' . "\n\n"
813
+ . '<p>' . __( 'Subject', 'contact-form-7' ) . '<br />' . "\n"
814
+ . ' [text your-subject] </p>' . "\n\n"
815
+ . '<p>' . __( 'Your Message', 'contact-form-7' ) . '<br />' . "\n"
816
+ . ' [textarea your-message] </p>' . "\n\n"
817
+ . '<p>[submit "' . __( 'Send', 'contact-form-7' ) . '"]</p>';
818
+
819
+ return $template;
820
+ }
821
+
822
+ function wpcf7_default_mail_template() {
823
+ $subject = '[your-subject]';
824
+ $sender = '[your-name] <[your-email]>';
825
+ $body = sprintf( __( 'From: %s', 'contact-form-7' ), '[your-name] <[your-email]>' ) . "\n"
826
+ . sprintf( __( 'Subject: %s', 'contact-form-7' ), '[your-subject]' ) . "\n\n"
827
+ . __( 'Message Body:', 'contact-form-7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
828
+ . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
829
+ get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
830
+ $recipient = get_option( 'admin_email' );
831
+ $additional_headers = '';
832
+ $attachments = '';
833
+ $use_html = 0;
834
+ $exclude_blank = 0;
835
+ return compact( 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html', 'exclude_blank' );
836
+ }
837
+
838
+ function wpcf7_default_mail_2_template() {
839
+ $active = false;
840
+ $subject = '[your-subject]';
841
+ $sender = '[your-name] <[your-email]>';
842
+ $body = __( 'Message Body:', 'contact-form-7' ) . "\n" . '[your-message]' . "\n\n" . '--' . "\n"
843
+ . sprintf( __( 'This e-mail was sent from a contact form on %1$s (%2$s)', 'contact-form-7' ),
844
+ get_bloginfo( 'name' ), get_bloginfo( 'url' ) );
845
+ $recipient = '[your-email]';
846
+ $additional_headers = '';
847
+ $attachments = '';
848
+ $use_html = 0;
849
+ $exclude_blank = 0;
850
+ return compact( 'active', 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html', 'exclude_blank' );
851
+ }
852
+
853
+ function wpcf7_default_messages_template() {
854
+ $messages = array();
855
+
856
+ foreach ( wpcf7_messages() as $key => $arr ) {
857
+ $messages[$key] = $arr['default'];
858
+ }
859
+
860
+ return $messages;
861
+ }
862
+
863
+ function wpcf7_messages() {
864
+ $messages = array(
865
+ 'mail_sent_ok' => array(
866
+ 'description' => __( "Sender's message was sent successfully", 'contact-form-7' ),
867
+ 'default' => __( 'Your message was sent successfully. Thanks.', 'contact-form-7' )
868
+ ),
869
+
870
+ 'mail_sent_ng' => array(
871
+ 'description' => __( "Sender's message was failed to send", 'contact-form-7' ),
872
+ 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'contact-form-7' )
873
+ ),
874
+
875
+ 'validation_error' => array(
876
+ 'description' => __( "Validation errors occurred", 'contact-form-7' ),
877
+ 'default' => __( 'Validation errors occurred. Please confirm the fields and submit it again.', 'contact-form-7' )
878
+ ),
879
+
880
+ 'spam' => array(
881
+ 'description' => __( "Submission was referred to as spam", 'contact-form-7' ),
882
+ 'default' => __( 'Failed to send your message. Please try later or contact the administrator by another method.', 'contact-form-7' )
883
+ ),
884
+
885
+ 'accept_terms' => array(
886
+ 'description' => __( "There are terms that the sender must accept", 'contact-form-7' ),
887
+ 'default' => __( 'Please accept the terms to proceed.', 'contact-form-7' )
888
+ ),
889
+
890
+ 'invalid_required' => array(
891
+ 'description' => __( "There is a field that the sender must fill in", 'contact-form-7' ),
892
+ 'default' => __( 'Please fill the required field.', 'contact-form-7' )
893
+ )
894
+ );
895
+
896
+ return apply_filters( 'wpcf7_messages', $messages );
897
+ }
898
+
899
+ ?>
includes/controller.php CHANGED
@@ -17,12 +17,9 @@ function wpcf7_ajax_onload() {
17
  $echo = '';
18
  $items = array();
19
 
20
- if ( isset( $_GET['_wpcf7'] ) ) {
21
- if ( $contact_form = wpcf7_contact_form( (int) $_GET['_wpcf7'] ) ) {
22
- WPCF7_ContactForm::set_current( $contact_form );
23
- $items = apply_filters( 'wpcf7_ajax_onload', $items );
24
- WPCF7_ContactForm::reset_current();
25
- }
26
  }
27
 
28
  $echo = json_encode( $items );
@@ -46,8 +43,6 @@ function wpcf7_ajax_json_echo() {
46
  $unit_tag = wpcf7_sanitize_unit_tag( $_POST['_wpcf7_unit_tag'] );
47
 
48
  if ( $contact_form = wpcf7_contact_form( $id ) ) {
49
- WPCF7_ContactForm::set_current( $contact_form );
50
-
51
  $items = array(
52
  'mailSent' => false,
53
  'into' => '#' . $unit_tag,
@@ -55,44 +50,41 @@ function wpcf7_ajax_json_echo() {
55
 
56
  $result = $contact_form->submit( true );
57
 
58
- if ( ! empty( $result['message'] ) )
59
  $items['message'] = $result['message'];
 
60
 
61
- if ( $result['mail_sent'] )
62
  $items['mailSent'] = true;
 
63
 
64
- if ( ! $result['valid'] ) {
65
  $invalids = array();
66
 
67
- foreach ( $result['invalid_reasons'] as $name => $reason ) {
68
- $invalid = array(
69
  'into' => 'span.wpcf7-form-control-wrap.'
70
  . sanitize_html_class( $name ),
71
- 'message' => $reason );
72
-
73
- if ( isset( $result['invalid_fields'][$name] )
74
- && wpcf7_is_name( $result['invalid_fields'][$name] ) ) {
75
- $invalid['idref'] = $result['invalid_fields'][$name];
76
- }
77
-
78
- $invalids[] = $invalid;
79
  }
80
 
81
  $items['invalids'] = $invalids;
82
  }
83
 
84
- if ( $result['spam'] )
85
  $items['spam'] = true;
 
86
 
87
- if ( ! empty( $result['scripts_on_sent_ok'] ) )
88
  $items['onSentOk'] = $result['scripts_on_sent_ok'];
 
89
 
90
- if ( ! empty( $result['scripts_on_submit'] ) )
91
  $items['onSubmit'] = $result['scripts_on_submit'];
 
92
 
93
  $items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
94
-
95
- WPCF7_ContactForm::reset_current();
96
  }
97
  }
98
 
@@ -121,11 +113,7 @@ function wpcf7_submit_nonajax() {
121
  return;
122
 
123
  if ( $contact_form = wpcf7_contact_form( (int) $_POST['_wpcf7'] ) ) {
124
- WPCF7_ContactForm::set_current( $contact_form );
125
-
126
  $contact_form->submit();
127
-
128
- WPCF7_ContactForm::reset_current();
129
  }
130
  }
131
 
@@ -159,7 +147,8 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) {
159
  'title' => '',
160
  'html_id' => '',
161
  'html_name' => '',
162
- 'html_class' => '' ), $atts );
 
163
 
164
  $id = (int) $atts['id'];
165
  $title = trim( $atts['title'] );
@@ -178,29 +167,28 @@ function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) {
178
  if ( ! $contact_form )
179
  return '[contact-form-7 404 "Not Found"]';
180
 
181
- WPCF7_ContactForm::set_current( $contact_form );
182
-
183
- $html = $contact_form->form_html( $atts );
184
-
185
- WPCF7_ContactForm::reset_current();
186
-
187
- return $html;
188
  }
189
 
190
- if ( WPCF7_LOAD_JS )
191
- add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_scripts' );
192
 
193
  function wpcf7_enqueue_scripts() {
 
 
 
 
194
  // jquery.form.js originally bundled with WordPress is out of date and deprecated
195
  // so we need to deregister it and re-register the latest one
196
  wp_deregister_script( 'jquery-form' );
197
  wp_register_script( 'jquery-form',
198
  wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),
199
- array( 'jquery' ), '3.50.0-2014.02.05', true );
200
 
201
  $in_footer = true;
202
- if ( 'header' === WPCF7_LOAD_JS )
 
203
  $in_footer = false;
 
204
 
205
  wp_enqueue_script( 'contact-form-7',
206
  wpcf7_plugin_url( 'includes/js/scripts.js' ),
@@ -225,10 +213,13 @@ function wpcf7_script_is() {
225
  return wp_script_is( 'contact-form-7' );
226
  }
227
 
228
- if ( WPCF7_LOAD_CSS )
229
- add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_styles' );
230
 
231
  function wpcf7_enqueue_styles() {
 
 
 
 
232
  wp_enqueue_style( 'contact-form-7',
233
  wpcf7_plugin_url( 'includes/css/styles.css' ),
234
  array(), WPCF7_VERSION, 'all' );
@@ -254,12 +245,12 @@ function wpcf7_html5_fallback() {
254
  if ( ! wpcf7_support_html5_fallback() )
255
  return;
256
 
257
- if ( WPCF7_LOAD_JS ) {
258
  wp_enqueue_script( 'jquery-ui-datepicker' );
259
  wp_enqueue_script( 'jquery-ui-spinner' );
260
  }
261
 
262
- if ( WPCF7_LOAD_CSS ) {
263
  wp_enqueue_style( 'jquery-ui-smoothness',
264
  wpcf7_plugin_url( 'includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css' ), array(), '1.10.3', 'screen' );
265
  }
17
  $echo = '';
18
  $items = array();
19
 
20
+ if ( isset( $_GET['_wpcf7'] )
21
+ && $contact_form = wpcf7_contact_form( (int) $_GET['_wpcf7'] ) ) {
22
+ $items = apply_filters( 'wpcf7_ajax_onload', $items );
 
 
 
23
  }
24
 
25
  $echo = json_encode( $items );
43
  $unit_tag = wpcf7_sanitize_unit_tag( $_POST['_wpcf7_unit_tag'] );
44
 
45
  if ( $contact_form = wpcf7_contact_form( $id ) ) {
 
 
46
  $items = array(
47
  'mailSent' => false,
48
  'into' => '#' . $unit_tag,
50
 
51
  $result = $contact_form->submit( true );
52
 
53
+ if ( ! empty( $result['message'] ) ) {
54
  $items['message'] = $result['message'];
55
+ }
56
 
57
+ if ( 'mail_sent' == $result['status'] ) {
58
  $items['mailSent'] = true;
59
+ }
60
 
61
+ if ( 'validation_failed' == $result['status'] ) {
62
  $invalids = array();
63
 
64
+ foreach ( $result['invalid_fields'] as $name => $field ) {
65
+ $invalids[] = array(
66
  'into' => 'span.wpcf7-form-control-wrap.'
67
  . sanitize_html_class( $name ),
68
+ 'message' => $field['reason'],
69
+ 'idref' => $field['idref'] );
 
 
 
 
 
 
70
  }
71
 
72
  $items['invalids'] = $invalids;
73
  }
74
 
75
+ if ( 'spam' == $result['status'] ) {
76
  $items['spam'] = true;
77
+ }
78
 
79
+ if ( ! empty( $result['scripts_on_sent_ok'] ) ) {
80
  $items['onSentOk'] = $result['scripts_on_sent_ok'];
81
+ }
82
 
83
+ if ( ! empty( $result['scripts_on_submit'] ) ) {
84
  $items['onSubmit'] = $result['scripts_on_submit'];
85
+ }
86
 
87
  $items = apply_filters( 'wpcf7_ajax_json_echo', $items, $result );
 
 
88
  }
89
  }
90
 
113
  return;
114
 
115
  if ( $contact_form = wpcf7_contact_form( (int) $_POST['_wpcf7'] ) ) {
 
 
116
  $contact_form->submit();
 
 
117
  }
118
  }
119
 
147
  'title' => '',
148
  'html_id' => '',
149
  'html_name' => '',
150
+ 'html_class' => '',
151
+ 'output' => 'form' ), $atts );
152
 
153
  $id = (int) $atts['id'];
154
  $title = trim( $atts['title'] );
167
  if ( ! $contact_form )
168
  return '[contact-form-7 404 "Not Found"]';
169
 
170
+ return $contact_form->form_html( $atts );
 
 
 
 
 
 
171
  }
172
 
173
+ add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_scripts' );
 
174
 
175
  function wpcf7_enqueue_scripts() {
176
+ if ( ! wpcf7_load_js() ) {
177
+ return;
178
+ }
179
+
180
  // jquery.form.js originally bundled with WordPress is out of date and deprecated
181
  // so we need to deregister it and re-register the latest one
182
  wp_deregister_script( 'jquery-form' );
183
  wp_register_script( 'jquery-form',
184
  wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),
185
+ array( 'jquery' ), '3.51.0-2014.06.20', true );
186
 
187
  $in_footer = true;
188
+
189
+ if ( 'header' === wpcf7_load_js() ) {
190
  $in_footer = false;
191
+ }
192
 
193
  wp_enqueue_script( 'contact-form-7',
194
  wpcf7_plugin_url( 'includes/js/scripts.js' ),
213
  return wp_script_is( 'contact-form-7' );
214
  }
215
 
216
+ add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_styles' );
 
217
 
218
  function wpcf7_enqueue_styles() {
219
+ if ( ! wpcf7_load_css() ) {
220
+ return;
221
+ }
222
+
223
  wp_enqueue_style( 'contact-form-7',
224
  wpcf7_plugin_url( 'includes/css/styles.css' ),
225
  array(), WPCF7_VERSION, 'all' );
245
  if ( ! wpcf7_support_html5_fallback() )
246
  return;
247
 
248
+ if ( wpcf7_load_js() ) {
249
  wp_enqueue_script( 'jquery-ui-datepicker' );
250
  wp_enqueue_script( 'jquery-ui-spinner' );
251
  }
252
 
253
+ if ( wpcf7_load_css() ) {
254
  wp_enqueue_style( 'jquery-ui-smoothness',
255
  wpcf7_plugin_url( 'includes/js/jquery-ui/themes/smoothness/jquery-ui.min.css' ), array(), '1.10.3', 'screen' );
256
  }
includes/deprecated.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- /*
3
- * Deprecated functions come here to die.
4
- */
5
-
6
- function wpcf7_admin_url( $args = array() ) {
7
- wpcf7_deprecated_function( __FUNCTION__, '3.2', 'admin_url()' );
8
-
9
- $defaults = array( 'page' => 'wpcf7' );
10
- $args = wp_parse_args( $args, $defaults );
11
-
12
- $url = menu_page_url( $args['page'], false );
13
- unset( $args['page'] );
14
-
15
- $url = add_query_arg( $args, $url );
16
-
17
- return esc_url_raw( $url );
18
- }
19
-
20
- function wpcf7_contact_form_default_pack( $locale = null ) {
21
- wpcf7_deprecated_function( __FUNCTION__, '3.0', 'wpcf7_get_contact_form_default_pack()' );
22
-
23
- return wpcf7_get_contact_form_default_pack( array( 'locale' => $locale ) );
24
- }
25
-
26
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions.php CHANGED
@@ -13,122 +13,6 @@ function wpcf7_plugin_url( $path = '' ) {
13
  return $url;
14
  }
15
 
16
- function wpcf7_deprecated_function( $function, $version, $replacement = null ) {
17
- do_action( 'wpcf7_deprecated_function_run', $function, $replacement, $version );
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
-
60
- return apply_filters( 'wpcf7_messages', $messages );
61
- }
62
-
63
- function wpcf7_get_default_template( $prop = 'form' ) {
64
- if ( 'form' == $prop )
65
- $template = wpcf7_default_form_template();
66
- elseif ( 'mail' == $prop )
67
- $template = wpcf7_default_mail_template();
68
- elseif ( 'mail_2' == $prop )
69
- $template = wpcf7_default_mail_2_template();
70
- elseif ( 'messages' == $prop )
71
- $template = wpcf7_default_messages_template();
72
- else
73
- $template = null;
74
-
75
- return apply_filters( 'wpcf7_default_template', $template, $prop );
76
- }
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
- }
92
-
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 = '';
103
- $attachments = '';
104
- $use_html = 0;
105
- return compact( 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html' );
106
- }
107
-
108
- function wpcf7_default_mail_2_template() {
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 = '';
117
- $attachments = '';
118
- $use_html = 0;
119
- return compact( 'active', 'subject', 'sender', 'body', 'recipient', 'additional_headers', 'attachments', 'use_html' );
120
- }
121
-
122
- function wpcf7_default_messages_template() {
123
- $messages = array();
124
-
125
- foreach ( wpcf7_messages() as $key => $arr ) {
126
- $messages[$key] = $arr['default'];
127
- }
128
-
129
- return $messages;
130
- }
131
-
132
  function wpcf7_upload_dir( $type = false ) {
133
  $uploads = wp_upload_dir();
134
 
@@ -220,11 +104,22 @@ function wpcf7_l10n() {
220
  return $l10n;
221
  }
222
 
223
- function wpcf7_is_rtl() {
224
- if ( function_exists( 'is_rtl' ) )
225
- return is_rtl();
 
226
 
227
- return false;
 
 
 
 
 
 
 
 
 
 
228
  }
229
 
230
  function wpcf7_ajax_loader() {
@@ -298,6 +193,14 @@ function wpcf7_support_html5_fallback() {
298
  return (bool) apply_filters( 'wpcf7_support_html5_fallback', false );
299
  }
300
 
 
 
 
 
 
 
 
 
301
  function wpcf7_format_atts( $atts ) {
302
  $html = '';
303
 
@@ -306,7 +209,11 @@ function wpcf7_format_atts( $atts ) {
306
  foreach ( $prioritized_atts as $att ) {
307
  if ( isset( $atts[$att] ) ) {
308
  $value = trim( $atts[$att] );
309
- $html .= sprintf( ' %s="%s"', $att, esc_attr( $value ) );
 
 
 
 
310
  unset( $atts[$att] );
311
  }
312
  }
@@ -314,8 +221,9 @@ function wpcf7_format_atts( $atts ) {
314
  foreach ( $atts as $key => $value ) {
315
  $value = trim( $value );
316
 
317
- if ( '' !== $value )
318
  $html .= sprintf( ' %s="%s"', $key, esc_attr( $value ) );
 
319
  }
320
 
321
  $html = trim( $html );
@@ -366,7 +274,7 @@ function wpcf7_load_modules() {
366
  }
367
 
368
  $mods = array(
369
- 'acceptance', 'flamingo', 'special-mail-tags',
370
  'akismet', 'jetpack', 'submit', 'captcha', 'number',
371
  'text', 'checkbox', 'quiz', 'textarea', 'date',
372
  'response', 'file', 'select', 'listo' );
@@ -434,4 +342,29 @@ function wpcf7_version_grep( $version, array $input ) {
434
  return preg_grep( $pattern, $input );
435
  }
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
  ?>
13
  return $url;
14
  }
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  function wpcf7_upload_dir( $type = false ) {
17
  $uploads = wp_upload_dir();
18
 
104
  return $l10n;
105
  }
106
 
107
+ function wpcf7_is_valid_locale( $locale ) {
108
+ $l10n = wpcf7_l10n();
109
+ return isset( $l10n[$locale] );
110
+ }
111
 
112
+ function wpcf7_is_rtl( $locale = '' ) {
113
+ if ( empty( $locale ) ) {
114
+ return function_exists( 'is_rtl' ) ? is_rtl() : false;
115
+ }
116
+
117
+ $rtl_locales = array(
118
+ 'ar' => 'Arabic',
119
+ 'he_IL' => 'Hebrew',
120
+ 'fa_IR' => 'Persian' );
121
+
122
+ return isset( $rtl_locales[$locale] );
123
  }
124
 
125
  function wpcf7_ajax_loader() {
193
  return (bool) apply_filters( 'wpcf7_support_html5_fallback', false );
194
  }
195
 
196
+ function wpcf7_load_js() {
197
+ return apply_filters( 'wpcf7_load_js', WPCF7_LOAD_JS );
198
+ }
199
+
200
+ function wpcf7_load_css() {
201
+ return apply_filters( 'wpcf7_load_css', WPCF7_LOAD_CSS );
202
+ }
203
+
204
  function wpcf7_format_atts( $atts ) {
205
  $html = '';
206
 
209
  foreach ( $prioritized_atts as $att ) {
210
  if ( isset( $atts[$att] ) ) {
211
  $value = trim( $atts[$att] );
212
+
213
+ if ( '' !== $value ) {
214
+ $html .= sprintf( ' %s="%s"', $att, esc_attr( $value ) );
215
+ }
216
+
217
  unset( $atts[$att] );
218
  }
219
  }
221
  foreach ( $atts as $key => $value ) {
222
  $value = trim( $value );
223
 
224
+ if ( '' !== $value ) {
225
  $html .= sprintf( ' %s="%s"', $key, esc_attr( $value ) );
226
+ }
227
  }
228
 
229
  $html = trim( $html );
274
  }
275
 
276
  $mods = array(
277
+ 'acceptance', 'flamingo',
278
  'akismet', 'jetpack', 'submit', 'captcha', 'number',
279
  'text', 'checkbox', 'quiz', 'textarea', 'date',
280
  'response', 'file', 'select', 'listo' );
342
  return preg_grep( $pattern, $input );
343
  }
344
 
345
+ function wpcf7_enctype_value( $enctype ) {
346
+ $enctype = trim( $enctype );
347
+
348
+ if ( empty( $enctype ) ) {
349
+ return '';
350
+ }
351
+
352
+ $valid_enctypes = array(
353
+ 'application/x-www-form-urlencoded',
354
+ 'multipart/form-data',
355
+ 'text/plain' );
356
+
357
+ if ( in_array( $enctype, $valid_enctypes ) ) {
358
+ return $enctype;
359
+ }
360
+
361
+ $pattern = '%^enctype="(' . implode( '|', $valid_enctypes ) . ')"$%';
362
+
363
+ if ( preg_match( $pattern, $enctype, $matches ) ) {
364
+ return $matches[1]; // for back-compat
365
+ }
366
+
367
+ return '';
368
+ }
369
+
370
  ?>
includes/js/jquery.form.js CHANGED
@@ -1,8 +1,8 @@
1
  /*!
2
  * jQuery Form Plugin
3
- * version: 3.50.0-2014.02.05
4
  * Requires jQuery v1.5 or later
5
- * Copyright (c) 2013 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
7
  * Project repository: https://github.com/malsup/form
8
  * Dual licensed under the MIT and GPL licenses.
@@ -956,7 +956,7 @@ $.fn.formToArray = function(semantic, elements) {
956
 
957
  // #386; account for inputs outside the form which use the 'form' attribute
958
  if ( formId ) {
959
- els2 = $(':input[form=' + formId + ']').get();
960
  if ( els2.length ) {
961
  els = (els || []).concat(els2);
962
  }
@@ -1188,13 +1188,13 @@ $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
1188
  else if (tag == 'select') {
1189
  this.selectedIndex = -1;
1190
  }
1191
- else if (t == "file") {
1192
- if (/MSIE/.test(navigator.userAgent)) {
1193
- $(this).replaceWith($(this).clone(true));
1194
- } else {
1195
- $(this).val('');
1196
- }
1197
- }
1198
  else if (includeHidden) {
1199
  // includeHidden can be the value true, or it can be a selector string
1200
  // indicating a special test; for example:
@@ -1275,4 +1275,3 @@ function log() {
1275
  }
1276
 
1277
  }));
1278
-
1
  /*!
2
  * jQuery Form Plugin
3
+ * version: 3.51.0-2014.06.20
4
  * Requires jQuery v1.5 or later
5
+ * Copyright (c) 2014 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
7
  * Project repository: https://github.com/malsup/form
8
  * Dual licensed under the MIT and GPL licenses.
956
 
957
  // #386; account for inputs outside the form which use the 'form' attribute
958
  if ( formId ) {
959
+ els2 = $(':input[form="' + formId + '"]').get(); // hat tip @thet
960
  if ( els2.length ) {
961
  els = (els || []).concat(els2);
962
  }
1188
  else if (tag == 'select') {
1189
  this.selectedIndex = -1;
1190
  }
1191
+ else if (t == "file") {
1192
+ if (/MSIE/.test(navigator.userAgent)) {
1193
+ $(this).replaceWith($(this).clone(true));
1194
+ } else {
1195
+ $(this).val('');
1196
+ }
1197
+ }
1198
  else if (includeHidden) {
1199
  // includeHidden can be the value true, or it can be a selector string
1200
  // indicating a special test; for example:
1275
  }
1276
 
1277
  }));
 
includes/js/jquery.form.min.js CHANGED
@@ -1,11 +1,11 @@
1
  /*!
2
  * jQuery Form Plugin
3
- * version: 3.50.0-2014.02.05
4
  * Requires jQuery v1.5 or later
5
- * Copyright (c) 2013 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
7
  * Project repository: https://github.com/malsup/form
8
  * Dual licensed under the MIT and GPL licenses.
9
  * https://github.com/malsup/form#copyright-and-license
10
  */
11
- (function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a((typeof(jQuery)!="undefined")?jQuery:window.Zepto)}}(function(f){var c={};c.fileapi=f("<input type='file'/>").get(0).files!==undefined;c.formdata=window.FormData!==undefined;var e=!!f.fn.prop;f.fn.attr2=function(){if(!e){return this.attr.apply(this,arguments)}var g=this.prop.apply(this,arguments);if((g&&g.jquery)||typeof g==="string"){return g}return this.attr.apply(this,arguments)};f.fn.ajaxSubmit=function(j){if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}var i,C,m,o=this;if(typeof j=="function"){j={success:j}}else{if(j===undefined){j={}}}i=j.type||this.attr2("method");C=j.url||this.attr2("action");m=(typeof C==="string")?f.trim(C):"";m=m||window.location.href||"";if(m){m=(m.match(/^([^#]+)/)||[])[1]}j=f.extend(true,{url:m,success:f.ajaxSettings.success,type:i||f.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},j);var u={};this.trigger("form-pre-serialize",[this,j,u]);if(u.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(j.beforeSerialize&&j.beforeSerialize(this,j)===false){d("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var n=j.traditional;if(n===undefined){n=f.ajaxSettings.traditional}var s=[];var E,F=this.formToArray(j.semantic,s);if(j.data){j.extraData=j.data;E=f.param(j.data,n)}if(j.beforeSubmit&&j.beforeSubmit(F,this,j)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[F,this,j,u]);if(u.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var y=f.param(F,n);if(E){y=(y?(y+"&"+E):E)}if(j.type.toUpperCase()=="GET"){j.url+=(j.url.indexOf("?")>=0?"&":"?")+y;j.data=null}else{j.data=y}var H=[];if(j.resetForm){H.push(function(){o.resetForm()})}if(j.clearForm){H.push(function(){o.clearForm(j.includeHidden)})}if(!j.dataType&&j.target){var l=j.success||function(){};H.push(function(q){var k=j.replaceTarget?"replaceWith":"html";f(j.target)[k](q).each(l,arguments)})}else{if(j.success){H.push(j.success)}}j.success=function(K,q,L){var J=j.context||this;for(var I=0,k=H.length;I<k;I++){H[I].apply(J,[K,q,L||o,o])}};if(j.error){var z=j.error;j.error=function(J,k,q){var I=j.context||this;z.apply(I,[J,k,q,o])}}if(j.complete){var h=j.complete;j.complete=function(I,k){var q=j.context||this;h.apply(q,[I,k,o])}}var D=f("input[type=file]:enabled",this).filter(function(){return f(this).val()!==""});var p=D.length>0;var B="multipart/form-data";var x=(o.attr("enctype")==B||o.attr("encoding")==B);var w=c.fileapi&&c.formdata;d("fileAPI :"+w);var r=(p||x)&&!w;var v;if(j.iframe!==false&&(j.iframe||r)){if(j.closeKeepAlive){f.get(j.closeKeepAlive,function(){v=G(F)})}else{v=G(F)}}else{if((p||x)&&w){v=t(F)}else{v=f.ajax(j)}}o.removeData("jqxhr").data("jqxhr",v);for(var A=0;A<s.length;A++){s[A]=null}this.trigger("form-submit-notify",[this,j]);return this;function g(K){var L=f.param(K,j.traditional).split("&");var q=L.length;var k=[];var J,I;for(J=0;J<q;J++){L[J]=L[J].replace(/\+/g," ");I=L[J].split("=");k.push([decodeURIComponent(I[0]),decodeURIComponent(I[1])])}return k}function t(q){var k=new FormData();for(var I=0;I<q.length;I++){k.append(q[I].name,q[I].value)}if(j.extraData){var L=g(j.extraData);for(I=0;I<L.length;I++){if(L[I]){k.append(L[I][0],L[I][1])}}}j.data=null;var K=f.extend(true,{},f.ajaxSettings,j,{contentType:false,processData:false,cache:false,type:i||"POST"});if(j.uploadProgress){K.xhr=function(){var M=f.ajaxSettings.xhr();if(M.upload){M.upload.addEventListener("progress",function(Q){var P=0;var N=Q.loaded||Q.position;var O=Q.total;if(Q.lengthComputable){P=Math.ceil(N/O*100)}j.uploadProgress(Q,N,O,P)},false)}return M}}K.data=null;var J=K.beforeSend;K.beforeSend=function(N,M){if(j.formData){M.data=j.formData}else{M.data=k}if(J){J.call(this,N,M)}};return f.ajax(K)}function G(af){var L=o[0],K,ab,V,ad,Y,N,Q,O,P,Z,ac,T;var ai=f.Deferred();ai.abort=function(aj){O.abort(aj)};if(af){for(ab=0;ab<s.length;ab++){K=f(s[ab]);if(e){K.prop("disabled",false)}else{K.removeAttr("disabled")}}}V=f.extend(true,{},f.ajaxSettings,j);V.context=V.context||V;Y="jqFormIO"+(new Date().getTime());if(V.iframeTarget){N=f(V.iframeTarget);Z=N.attr2("name");if(!Z){N.attr2("name",Y)}else{Y=Z}}else{N=f('<iframe name="'+Y+'" src="'+V.iframeSrc+'" />');N.css({position:"absolute",top:"-1000px",left:"-1000px"})}Q=N[0];O={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(aj){var ak=(aj==="timeout"?"timeout":"aborted");d("aborting upload... "+ak);this.aborted=1;try{if(Q.contentWindow.document.execCommand){Q.contentWindow.document.execCommand("Stop")}}catch(al){}N.attr("src",V.iframeSrc);O.error=ak;if(V.error){V.error.call(V.context,O,ak,aj)}if(ad){f.event.trigger("ajaxError",[O,V,ak])}if(V.complete){V.complete.call(V.context,O,ak)}}};ad=V.global;if(ad&&0===f.active++){f.event.trigger("ajaxStart")}if(ad){f.event.trigger("ajaxSend",[O,V])}if(V.beforeSend&&V.beforeSend.call(V.context,O,V)===false){if(V.global){f.active--}ai.reject();return ai}if(O.aborted){ai.reject();return ai}P=L.clk;if(P){Z=P.name;if(Z&&!P.disabled){V.extraData=V.extraData||{};V.extraData[Z]=P.value;if(P.type=="image"){V.extraData[Z+".x"]=L.clk_x;V.extraData[Z+".y"]=L.clk_y}}}var U=1;var R=2;function S(al){var ak=null;try{if(al.contentWindow){ak=al.contentWindow.document}}catch(aj){d("cannot get iframe.contentWindow document: "+aj)}if(ak){return ak}try{ak=al.contentDocument?al.contentDocument:al.document}catch(aj){d("cannot get iframe.contentDocument: "+aj);ak=al.document}return ak}var J=f("meta[name=csrf-token]").attr("content");var I=f("meta[name=csrf-param]").attr("content");if(I&&J){V.extraData=V.extraData||{};V.extraData[I]=J}function aa(){var ar=o.attr2("target"),an=o.attr2("action"),al="multipart/form-data",ao=o.attr("enctype")||o.attr("encoding")||al;L.setAttribute("target",Y);if(!i||/post/i.test(i)){L.setAttribute("method","POST")}if(an!=V.url){L.setAttribute("action",V.url)}if(!V.skipEncodingOverride&&(!i||/post/i.test(i))){o.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(V.timeout){T=setTimeout(function(){ac=true;X(U)},V.timeout)}function ap(){try{var at=S(Q).readyState;d("state = "+at);if(at&&at.toLowerCase()=="uninitialized"){setTimeout(ap,50)}}catch(au){d("Server abort: ",au," (",au.name,")");X(R);if(T){clearTimeout(T)}T=undefined}}var aq=[];try{if(V.extraData){for(var ak in V.extraData){if(V.extraData.hasOwnProperty(ak)){if(f.isPlainObject(V.extraData[ak])&&V.extraData[ak].hasOwnProperty("name")&&V.extraData[ak].hasOwnProperty("value")){aq.push(f('<input type="hidden" name="'+V.extraData[ak].name+'">').val(V.extraData[ak].value).appendTo(L)[0])}else{aq.push(f('<input type="hidden" name="'+ak+'">').val(V.extraData[ak]).appendTo(L)[0])}}}}if(!V.iframeTarget){N.appendTo("body")}if(Q.attachEvent){Q.attachEvent("onload",X)}else{Q.addEventListener("load",X,false)}setTimeout(ap,15);try{L.submit()}catch(am){var aj=document.createElement("form").submit;aj.apply(L)}}finally{L.setAttribute("action",an);L.setAttribute("enctype",ao);if(ar){L.setAttribute("target",ar)}else{o.removeAttr("target")}f(aq).remove()}}if(V.forceSync){aa()}else{setTimeout(aa,10)}var ag,ah,ae=50,M;function X(ap){if(O.aborted||M){return}ah=S(Q);if(!ah){d("cannot access response document");ap=R}if(ap===U&&O){O.abort("timeout");ai.reject(O,"timeout");return}else{if(ap==R&&O){O.abort("server abort");ai.reject(O,"error","server abort");return}}if(!ah||ah.location.href==V.iframeSrc){if(!ac){return}}if(Q.detachEvent){Q.detachEvent("onload",X)}else{Q.removeEventListener("load",X,false)}var an="success",ar;try{if(ac){throw"timeout"}var am=V.dataType=="xml"||ah.XMLDocument||f.isXMLDoc(ah);d("isXml="+am);if(!am&&window.opera&&(ah.body===null||!ah.body.innerHTML)){if(--ae){d("requeing onLoad callback, DOM not available");setTimeout(X,250);return}}var at=ah.body?ah.body:ah.documentElement;O.responseText=at?at.innerHTML:null;O.responseXML=ah.XMLDocument?ah.XMLDocument:ah;if(am){V.dataType="xml"}O.getResponseHeader=function(aw){var av={"content-type":V.dataType};return av[aw.toLowerCase()]};if(at){O.status=Number(at.getAttribute("status"))||O.status;O.statusText=at.getAttribute("statusText")||O.statusText}var aj=(V.dataType||"").toLowerCase();var aq=/(json|script|text)/.test(aj);if(aq||V.textarea){var ao=ah.getElementsByTagName("textarea")[0];if(ao){O.responseText=ao.value;O.status=Number(ao.getAttribute("status"))||O.status;O.statusText=ao.getAttribute("statusText")||O.statusText}else{if(aq){var ak=ah.getElementsByTagName("pre")[0];var au=ah.getElementsByTagName("body")[0];if(ak){O.responseText=ak.textContent?ak.textContent:ak.innerText}else{if(au){O.responseText=au.textContent?au.textContent:au.innerText}}}}}else{if(aj=="xml"&&!O.responseXML&&O.responseText){O.responseXML=W(O.responseText)}}try{ag=k(O,aj,V)}catch(al){an="parsererror";O.error=ar=(al||an)}}catch(al){d("error caught: ",al);an="error";O.error=ar=(al||an)}if(O.aborted){d("upload aborted");an=null}if(O.status){an=(O.status>=200&&O.status<300||O.status===304)?"success":"error"}if(an==="success"){if(V.success){V.success.call(V.context,ag,"success",O)}ai.resolve(O.responseText,"success",O);if(ad){f.event.trigger("ajaxSuccess",[O,V])}}else{if(an){if(ar===undefined){ar=O.statusText}if(V.error){V.error.call(V.context,O,an,ar)}ai.reject(O,"error",ar);if(ad){f.event.trigger("ajaxError",[O,V,ar])}}}if(ad){f.event.trigger("ajaxComplete",[O,V])}if(ad&&!--f.active){f.event.trigger("ajaxStop")}if(V.complete){V.complete.call(V.context,O,an)}M=true;if(V.timeout){clearTimeout(T)}setTimeout(function(){if(!V.iframeTarget){N.remove()}else{N.attr("src",V.iframeSrc)}O.responseXML=null},100)}var W=f.parseXML||function(aj,ak){if(window.ActiveXObject){ak=new ActiveXObject("Microsoft.XMLDOM");ak.async="false";ak.loadXML(aj)}else{ak=(new DOMParser()).parseFromString(aj,"text/xml")}return(ak&&ak.documentElement&&ak.documentElement.nodeName!="parsererror")?ak:null};var q=f.parseJSON||function(aj){return window["eval"]("("+aj+")")};var k=function(ao,am,al){var ak=ao.getResponseHeader("content-type")||"",aj=am==="xml"||!am&&ak.indexOf("xml")>=0,an=aj?ao.responseXML:ao.responseText;if(aj&&an.documentElement.nodeName==="parsererror"){if(f.error){f.error("parsererror")}}if(al&&al.dataFilter){an=al.dataFilter(an,am)}if(typeof an==="string"){if(am==="json"||!am&&ak.indexOf("json")>=0){an=q(an)}else{if(am==="script"||!am&&ak.indexOf("javascript")>=0){f.globalEval(an)}}}return an};return ai}};f.fn.ajaxForm=function(g){g=g||{};g.delegation=g.delegation&&f.isFunction(f.fn.on);if(!g.delegation&&this.length===0){var h={s:this.selector,c:this.context};if(!f.isReady&&h.s){d("DOM not ready, queuing ajaxForm");f(function(){f(h.s,h.c).ajaxForm(g)});return this}d("terminating; zero elements found by selector"+(f.isReady?"":" (DOM not ready)"));return this}if(g.delegation){f(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,a).on("submit.form-plugin",this.selector,g,b).on("click.form-plugin",this.selector,g,a);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",g,b).bind("click.form-plugin",g,a)};function b(h){var g=h.data;if(!h.isDefaultPrevented()){h.preventDefault();f(h.target).ajaxSubmit(g)}}function a(k){var j=k.target;var h=f(j);if(!(h.is("[type=submit],[type=image]"))){var g=h.closest("[type=submit]");if(g.length===0){return}j=g[0]}var i=this;i.clk=j;if(j.type=="image"){if(k.offsetX!==undefined){i.clk_x=k.offsetX;i.clk_y=k.offsetY}else{if(typeof f.fn.offset=="function"){var l=h.offset();i.clk_x=k.pageX-l.left;i.clk_y=k.pageY-l.top}else{i.clk_x=k.pageX-j.offsetLeft;i.clk_y=k.pageY-j.offsetTop}}}setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}f.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};f.fn.formToArray=function(x,g){var w=[];if(this.length===0){return w}var l=this[0];var z=this.attr("id");var q=x?l.getElementsByTagName("*"):l.elements;var A;if(q&&!/MSIE [678]/.test(navigator.userAgent)){q=f(q).get()}if(z){A=f(":input[form="+z+"]").get();if(A.length){q=(q||[]).concat(A)}}if(!q||!q.length){return w}var r,p,o,y,m,t,k;for(r=0,t=q.length;r<t;r++){m=q[r];o=m.name;if(!o||m.disabled){continue}if(x&&l.clk&&m.type=="image"){if(l.clk==m){w.push({name:o,value:f(m).val(),type:m.type});w.push({name:o+".x",value:l.clk_x},{name:o+".y",value:l.clk_y})}continue}y=f.fieldValue(m,true);if(y&&y.constructor==Array){if(g){g.push(m)}for(p=0,k=y.length;p<k;p++){w.push({name:o,value:y[p]})}}else{if(c.fileapi&&m.type=="file"){if(g){g.push(m)}var h=m.files;if(h.length){for(p=0;p<h.length;p++){w.push({name:o,value:h[p],type:m.type})}}else{w.push({name:o,value:"",type:m.type})}}else{if(y!==null&&typeof y!="undefined"){if(g){g.push(m)}w.push({name:o,value:y,type:m.type,required:m.required})}}}}if(!x&&l.clk){var s=f(l.clk),u=s[0];o=u.name;if(o&&!u.disabled&&u.type=="image"){w.push({name:o,value:s.val()});w.push({name:o+".x",value:l.clk_x},{name:o+".y",value:l.clk_y})}}return w};f.fn.formSerialize=function(g){return f.param(this.formToArray(g))};f.fn.fieldSerialize=function(h){var g=[];this.each(function(){var m=this.name;if(!m){return}var k=f.fieldValue(this,h);if(k&&k.constructor==Array){for(var l=0,j=k.length;l<j;l++){g.push({name:m,value:k[l]})}}else{if(k!==null&&typeof k!="undefined"){g.push({name:this.name,value:k})}}});return f.param(g)};f.fn.fieldValue=function(m){for(var l=[],j=0,g=this.length;j<g;j++){var k=this[j];var h=f.fieldValue(k,m);if(h===null||typeof h=="undefined"||(h.constructor==Array&&!h.length)){continue}if(h.constructor==Array){f.merge(l,h)}else{l.push(h)}}return l};f.fieldValue=function(g,o){var j=g.name,u=g.type,w=g.tagName.toLowerCase();if(o===undefined){o=true}if(o&&(!j||g.disabled||u=="reset"||u=="button"||(u=="checkbox"||u=="radio")&&!g.checked||(u=="submit"||u=="image")&&g.form&&g.form.clk!=g||w=="select"&&g.selectedIndex==-1)){return null}if(w=="select"){var p=g.selectedIndex;if(p<0){return null}var r=[],h=g.options;var l=(u=="select-one");var q=(l?p+1:h.length);for(var k=(l?p:0);k<q;k++){var m=h[k];if(m.selected){var s=m.value;if(!s){s=(m.attributes&&m.attributes.value&&!(m.attributes.value.specified))?m.text:m.value}if(l){return s}r.push(s)}}return r}return f(g).val()};f.fn.clearForm=function(g){return this.each(function(){f("input,select,textarea",this).clearFields(g)})};f.fn.clearFields=f.fn.clearInputs=function(g){var h=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var j=this.type,i=this.tagName.toLowerCase();if(h.test(j)||i=="textarea"){this.value=""}else{if(j=="checkbox"||j=="radio"){this.checked=false}else{if(i=="select"){this.selectedIndex=-1}else{if(j=="file"){if(/MSIE/.test(navigator.userAgent)){f(this).replaceWith(f(this).clone(true))}else{f(this).val("")}}else{if(g){if((g===true&&/hidden/.test(j))||(typeof g=="string"&&f(this).is(g))){this.value=""}}}}}}})};f.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};f.fn.enable=function(g){if(g===undefined){g=true}return this.each(function(){this.disabled=!g})};f.fn.selected=function(g){if(g===undefined){g=true}return this.each(function(){var h=this.type;if(h=="checkbox"||h=="radio"){this.checked=g}else{if(this.tagName.toLowerCase()=="option"){var i=f(this).parent("select");if(g&&i[0]&&i[0].type=="select-one"){i.find("option").selected(false)}this.selected=g}}})};f.fn.ajaxSubmit.debug=false;function d(){if(!f.fn.ajaxSubmit.debug){return}var g="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(g)}else{if(window.opera&&window.opera.postError){window.opera.postError(g)}}}}));
1
  /*!
2
  * jQuery Form Plugin
3
+ * version: 3.51.0-2014.06.20
4
  * Requires jQuery v1.5 or later
5
+ * Copyright (c) 2014 M. Alsup
6
  * Examples and documentation at: http://malsup.com/jquery/form/
7
  * Project repository: https://github.com/malsup/form
8
  * Dual licensed under the MIT and GPL licenses.
9
  * https://github.com/malsup/form#copyright-and-license
10
  */
11
+ !function(e){"use strict";"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;i<a.length;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;i<o.length;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(a/n*100)),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"),o="multipart/form-data",c=f.attr("enctype")||f.attr("encoding")||o;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 l=[];try{if(m.extraData)for(var d in m.extraData)m.extraData.hasOwnProperty(d)&&l.push(e.isPlainObject(m.extraData[d])&&m.extraData[d].hasOwnProperty("name")&&m.extraData[d].hasOwnProperty("value")?e('<input type="hidden" name="'+m.extraData[d].name+'">').val(m.extraData[d].value).appendTo(w)[0]:e('<input type="hidden" name="'+d+'">').val(m.extraData[d]).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(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).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"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");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"),void setTimeout(s,250);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(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||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,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l<h.length;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),b=v.attr2("name"),b?p=b: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;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".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 y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,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 b=t.error;t.error=function(e,r,a){var n=t.context||this;b.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;E<h.length;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,o=this[0],s=this.attr("id"),u=t?o.getElementsByTagName("*"):o.elements;if(u&&!/MSIE [678]/.test(navigator.userAgent)&&(u=e(u).get()),s&&(i=e(':input[form="'+s+'"]').get(),i.length&&(u=(u||[]).concat(i))),!u||!u.length)return a;var c,l,f,m,d,p,h;for(c=0,p=u.length;p>c;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;l<v.length;l++)a.push({name:f,value:v[l],type:d.type});else a.push({name:f,value:"",type:d.type})}else null!==m&&"undefined"!=typeof m&&(r&&r.push(d),a.push({name:f,value:m,type:d.type,required:d.required}));if(!t&&o.clk){var g=e(o.clk),x=g[0];f=x.name,f&&!x.disabled&&"image"==x.type&&(a.push({name:f,value:g.val()}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.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&&"undefined"!=typeof n&&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||"undefined"==typeof 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/mail.php ADDED
@@ -0,0 +1,378 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPCF7_Mail {
4
+
5
+ private static $current = null;
6
+
7
+ private $name = '';
8
+ private $template = array();
9
+
10
+ public static function send( $template, $name = '' ) {
11
+ $instance = new self;
12
+ $instance->name = trim( $name );
13
+ $instance->setup_template( $template );
14
+
15
+ self::$current = $instance;
16
+
17
+ return $instance->compose();
18
+ }
19
+
20
+ private function __construct() {}
21
+
22
+ public static function get_current() {
23
+ return self::$current;
24
+ }
25
+
26
+ private function setup_template( $template ) {
27
+ $defaults = array(
28
+ 'subject' => '', 'sender' => '', 'body' => '',
29
+ 'recipient' => '', 'additional_headers' => '',
30
+ 'attachments' => '', 'use_html' => false,
31
+ 'exclude_blank' => false );
32
+
33
+ $this->template = wp_parse_args( $template, $defaults );
34
+ }
35
+
36
+ private function compose( $send = true ) {
37
+ $template = $this->template;
38
+
39
+ $use_html = (bool) $template['use_html'];
40
+
41
+ $subject = $this->replace_tags( $template['subject'] );
42
+ $sender = $this->replace_tags( $template['sender'] );
43
+ $recipient = $this->replace_tags( $template['recipient'] );
44
+ $additional_headers = $this->replace_tags( $template['additional_headers'] );
45
+
46
+ if ( $use_html ) {
47
+ $body = $this->replace_tags( $template['body'], true );
48
+ $body = wpautop( $body );
49
+ } else {
50
+ $body = $this->replace_tags( $template['body'] );
51
+ }
52
+
53
+ $attachments = $this->attachments( $template['attachments'] );
54
+
55
+ $components = compact( 'subject', 'sender', 'body',
56
+ 'recipient', 'additional_headers', 'attachments' );
57
+
58
+ $components = apply_filters( 'wpcf7_mail_components',
59
+ $components, wpcf7_get_current_contact_form() );
60
+
61
+ extract( $components );
62
+
63
+ $subject = wpcf7_strip_newline( $subject );
64
+ $sender = wpcf7_strip_newline( $sender );
65
+ $recipient = wpcf7_strip_newline( $recipient );
66
+
67
+ $headers = "From: $sender\n";
68
+
69
+ if ( $use_html ) {
70
+ $headers .= "Content-Type: text/html\n";
71
+ }
72
+
73
+ $additional_headers = trim( $additional_headers );
74
+
75
+ if ( $additional_headers ) {
76
+ $headers .= $additional_headers . "\n";
77
+ }
78
+
79
+ if ( $send ) {
80
+ return @wp_mail( $recipient, $subject, $body, $headers, $attachments );
81
+ }
82
+
83
+ $components = compact( 'subject', 'sender', 'body',
84
+ 'recipient', 'headers', 'attachments' );
85
+
86
+ return $components;
87
+ }
88
+
89
+ public function replace_tags( $content, $html = false ) {
90
+ $args = array(
91
+ 'html' => $html,
92
+ 'exclude_blank' => $this->template['exclude_blank'] );
93
+
94
+ return wpcf7_mail_replace_tags( $content, $args );
95
+ }
96
+
97
+ private function attachments( $template ) {
98
+ $attachments = array();
99
+
100
+ if ( $submission = WPCF7_Submission::get_instance() ) {
101
+ $uploaded_files = $submission->uploaded_files();
102
+
103
+ foreach ( (array) $uploaded_files as $name => $path ) {
104
+ if ( false !== strpos( $template, "[${name}]" )
105
+ && ! empty( $path ) ) {
106
+ $attachments[] = $path;
107
+ }
108
+ }
109
+ }
110
+
111
+ foreach ( explode( "\n", $template ) as $line ) {
112
+ $line = trim( $line );
113
+
114
+ if ( '[' == substr( $line, 0, 1 ) ) {
115
+ continue;
116
+ }
117
+
118
+ $path = path_join( WP_CONTENT_DIR, $line );
119
+
120
+ if ( @is_readable( $path ) && @is_file( $path ) ) {
121
+ $attachments[] = $path;
122
+ }
123
+ }
124
+
125
+ return $attachments;
126
+ }
127
+ }
128
+
129
+ function wpcf7_mail_replace_tags( $content, $args = '' ) {
130
+ $args = wp_parse_args( $args, array(
131
+ 'html' => false,
132
+ 'exclude_blank' => false ) );
133
+
134
+ if ( is_array( $content ) ) {
135
+ foreach ( $content as $key => $value ) {
136
+ $content[$key] = wpcf7_mail_replace_tags( $value, $args );
137
+ }
138
+
139
+ return $content;
140
+ }
141
+
142
+ $content = explode( "\n", $content );
143
+
144
+ foreach ( $content as $num => $line ) {
145
+ $line = new WPCF7_MailTaggedText( $line, $args );
146
+ $replaced = $line->replace_tags();
147
+
148
+ if ( $args['exclude_blank'] ) {
149
+ $replaced_tags = $line->get_replaced_tags();
150
+
151
+ if ( empty( $replaced_tags ) || array_filter( $replaced_tags ) ) {
152
+ $content[$num] = $replaced;
153
+ } else {
154
+ unset( $content[$num] ); // Remove a line.
155
+ }
156
+ } else {
157
+ $content[$num] = $replaced;
158
+ }
159
+ }
160
+
161
+ $content = implode( "\n", $content );
162
+
163
+ return $content;
164
+ }
165
+
166
+ class WPCF7_MailTaggedText {
167
+
168
+ private $html = false;
169
+ private $content = '';
170
+ private $replaced_tags = array();
171
+
172
+ public function __construct( $content, $args = '' ) {
173
+ $args = wp_parse_args( $args, array( 'html' => false ) );
174
+
175
+ $this->html = (bool) $args['html'];
176
+ $this->content = $content;
177
+ }
178
+
179
+ public function get_replaced_tags() {
180
+ return $this->replaced_tags;
181
+ }
182
+
183
+ public function replace_tags() {
184
+ $regex = '/(\[?)\[[\t ]*'
185
+ . '([a-zA-Z_][0-9a-zA-Z:._-]*)' // [2] = name
186
+ . '((?:[\t ]+"[^"]*"|[\t ]+\'[^\']*\')*)' // [3] = values
187
+ . '[\t ]*\](\]?)/';
188
+
189
+ if ( $this->html ) {
190
+ $callback = array( $this, 'replace_tags_callback_html' );
191
+ } else {
192
+ $callback = array( $this, 'replace_tags_callback' );
193
+ }
194
+
195
+ return preg_replace_callback( $regex, $callback, $this->content );
196
+ }
197
+
198
+ private function replace_tags_callback_html( $matches ) {
199
+ return $this->replace_tags_callback( $matches, true );
200
+ }
201
+
202
+ private function replace_tags_callback( $matches, $html = false ) {
203
+ // allow [[foo]] syntax for escaping a tag
204
+ if ( $matches[1] == '[' && $matches[4] == ']' ) {
205
+ return substr( $matches[0], 1, -1 );
206
+ }
207
+
208
+ $tag = $matches[0];
209
+ $tagname = $matches[2];
210
+ $values = $matches[3];
211
+
212
+ if ( ! empty( $values ) ) {
213
+ preg_match_all( '/"[^"]*"|\'[^\']*\'/', $values, $matches );
214
+ $values = wpcf7_strip_quote_deep( $matches[0] );
215
+ }
216
+
217
+ $do_not_heat = false;
218
+
219
+ if ( preg_match( '/^_raw_(.+)$/', $tagname, $matches ) ) {
220
+ $tagname = trim( $matches[1] );
221
+ $do_not_heat = true;
222
+ }
223
+
224
+ $format = '';
225
+
226
+ if ( preg_match( '/^_format_(.+)$/', $tagname, $matches ) ) {
227
+ $tagname = trim( $matches[1] );
228
+ $format = $values[0];
229
+ }
230
+
231
+ $submission = WPCF7_Submission::get_instance();
232
+ $submitted = $submission ? $submission->get_posted_data( $tagname ) : null;
233
+
234
+ if ( null !== $submitted ) {
235
+
236
+ if ( $do_not_heat ) {
237
+ $submitted = isset( $_POST[$tagname] ) ? $_POST[$tagname] : '';
238
+ }
239
+
240
+ $replaced = $submitted;
241
+
242
+ if ( ! empty( $format ) ) {
243
+ $replaced = $this->format( $replaced, $format );
244
+ }
245
+
246
+ $replaced = wpcf7_flat_join( $replaced );
247
+
248
+ if ( $html ) {
249
+ $replaced = esc_html( $replaced );
250
+ $replaced = wptexturize( $replaced );
251
+ }
252
+
253
+ $replaced = apply_filters( 'wpcf7_mail_tag_replaced',
254
+ $replaced, $submitted, $html );
255
+
256
+ $replaced = wp_unslash( trim( $replaced ) );
257
+
258
+ $this->replaced_tags[$tag] = $replaced;
259
+ return $replaced;
260
+ }
261
+
262
+ $special = apply_filters( 'wpcf7_special_mail_tags', '', $tagname, $html );
263
+
264
+ if ( ! empty( $special ) ) {
265
+ $this->replaced_tags[$tag] = $special;
266
+ return $special;
267
+ }
268
+
269
+ return $tag;
270
+ }
271
+
272
+ public function format( $original, $format ) {
273
+ $original = (array) $original;
274
+
275
+ foreach ( $original as $key => $value ) {
276
+ if ( preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $value ) ) {
277
+ $original[$key] = mysql2date( $format, $value );
278
+ }
279
+ }
280
+
281
+ return $original;
282
+ }
283
+ }
284
+
285
+ /* Special Mail Tags */
286
+
287
+ add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag', 10, 3 );
288
+
289
+ function wpcf7_special_mail_tag( $output, $name, $html ) {
290
+ $name = preg_replace( '/^wpcf7\./', '_', $name ); // for back-compat
291
+
292
+ $submission = WPCF7_Submission::get_instance();
293
+
294
+ if ( ! $submission ) {
295
+ return $output;
296
+ }
297
+
298
+ if ( '_remote_ip' == $name ) {
299
+ if ( $remote_ip = $submission->get_meta( 'remote_ip' ) ) {
300
+ return $remote_ip;
301
+ } else {
302
+ return '';
303
+ }
304
+ }
305
+
306
+ if ( '_user_agent' == $name ) {
307
+ if ( $user_agent = $submission->get_meta( 'user_agent' ) ) {
308
+ return $html ? esc_html( $user_agent ) : $user_agent;
309
+ } else {
310
+ return '';
311
+ }
312
+ }
313
+
314
+ if ( '_url' == $name ) {
315
+ if ( $url = $submission->get_meta( 'url' ) ) {
316
+ return esc_url( $url );
317
+ } else {
318
+ return '';
319
+ }
320
+ }
321
+
322
+ if ( '_date' == $name || '_time' == $name ) {
323
+ if ( $timestamp = $submission->get_meta( 'timestamp' ) ) {
324
+ if ( '_date' == $name ) {
325
+ return date_i18n( get_option( 'date_format' ), $timestamp );
326
+ }
327
+
328
+ if ( '_time' == $name ) {
329
+ return date_i18n( get_option( 'time_format' ), $timestamp );
330
+ }
331
+ }
332
+
333
+ return '';
334
+ }
335
+
336
+ if ( '_post_' == substr( $name, 0, 6 ) ) {
337
+ $unit_tag = $submission->get_meta( 'unit_tag' );
338
+
339
+ if ( $unit_tag
340
+ && preg_match( '/^wpcf7-f(\d+)-p(\d+)-o(\d+)$/', $unit_tag, $matches ) ) {
341
+ $post_id = absint( $matches[2] );
342
+
343
+ if ( $post = get_post( $post_id ) ) {
344
+ if ( '_post_id' == $name ) {
345
+ return (string) $post->ID;
346
+ }
347
+
348
+ if ( '_post_name' == $name ) {
349
+ return $post->post_name;
350
+ }
351
+
352
+ if ( '_post_title' == $name ) {
353
+ return $html ? esc_html( $post->post_title ) : $post->post_title;
354
+ }
355
+
356
+ if ( '_post_url' == $name ) {
357
+ return get_permalink( $post->ID );
358
+ }
359
+
360
+ $user = new WP_User( $post->post_author );
361
+
362
+ if ( '_post_author' == $name ) {
363
+ return $user->display_name;
364
+ }
365
+
366
+ if ( '_post_author_email' == $name ) {
367
+ return $user->user_email;
368
+ }
369
+ }
370
+ }
371
+
372
+ return '';
373
+ }
374
+
375
+ return $output;
376
+ }
377
+
378
+ ?>
includes/submission.php ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class WPCF7_Submission {
4
+
5
+ private static $instance;
6
+
7
+ private $contact_form;
8
+ private $status = 'init';
9
+ private $posted_data = array();
10
+ private $uploaded_files = array();
11
+ private $skip_mail = false;
12
+ private $response = '';
13
+ private $invalid_fields = array();
14
+ private $meta = array();
15
+
16
+ private function __construct() {}
17
+
18
+ public static function get_instance( WPCF7_ContactForm $contact_form = null ) {
19
+ if ( empty( self::$instance ) ) {
20
+ if ( null == $contact_form ) {
21
+ return null;
22
+ }
23
+
24
+ self::$instance = new self;
25
+ self::$instance->contact_form = $contact_form;
26
+ self::$instance->skip_mail = $contact_form->in_demo_mode();
27
+ self::$instance->setup_posted_data();
28
+ self::$instance->submit();
29
+ } elseif ( null != $contact_form ) {
30
+ return null;
31
+ }
32
+
33
+ return self::$instance;
34
+ }
35
+
36
+ public function get_status() {
37
+ return $this->status;
38
+ }
39
+
40
+ public function is( $status ) {
41
+ return $this->status == $status;
42
+ }
43
+
44
+ public function get_response() {
45
+ return $this->response;
46
+ }
47
+
48
+ public function get_invalid_field( $name ) {
49
+ if ( isset( $this->invalid_fields[$name] ) ) {
50
+ return $this->invalid_fields[$name];
51
+ } else {
52
+ return false;
53
+ }
54
+ }
55
+
56
+ public function get_invalid_fields() {
57
+ return $this->invalid_fields;
58
+ }
59
+
60
+ public function get_posted_data( $name = '' ) {
61
+ if ( ! empty( $name ) ) {
62
+ if ( isset( $this->posted_data[$name] ) ) {
63
+ return $this->posted_data[$name];
64
+ } else {
65
+ return null;
66
+ }
67
+ }
68
+
69
+ return $this->posted_data;
70
+ }
71
+
72
+ private function setup_posted_data() {
73
+ $posted_data = (array) $_POST;
74
+
75
+ $tags = $this->contact_form->form_scan_shortcode();
76
+
77
+ foreach ( (array) $tags as $tag ) {
78
+ if ( empty( $tag['name'] ) ) {
79
+ continue;
80
+ }
81
+
82
+ $name = $tag['name'];
83
+ $value = '';
84
+
85
+ if ( isset( $posted_data[$name] ) ) {
86
+ $value = $posted_data[$name];
87
+ }
88
+
89
+ $pipes = $tag['pipes'];
90
+
91
+ if ( WPCF7_USE_PIPE
92
+ && is_a( $pipes, 'WPCF7_Pipes' )
93
+ && ! $pipes->zero() ) {
94
+ if ( is_array( $value) ) {
95
+ $new_value = array();
96
+
97
+ foreach ( $value as $v ) {
98
+ $new_value[] = $pipes->do_pipe( wp_unslash( $v ) );
99
+ }
100
+
101
+ $value = $new_value;
102
+ } else {
103
+ $value = $pipes->do_pipe( wp_unslash( $value ) );
104
+ }
105
+ }
106
+
107
+ $posted_data[$name] = $value;
108
+ }
109
+
110
+ $this->posted_data = apply_filters( 'wpcf7_posted_data', $posted_data );
111
+
112
+ return $this->posted_data;
113
+ }
114
+
115
+ private function submit() {
116
+ if ( ! $this->is( 'init' ) ) {
117
+ return $this->status;
118
+ }
119
+
120
+ $this->meta = array(
121
+ 'remote_ip' => preg_replace( '/[^0-9a-f.:, ]/', '',
122
+ $_SERVER['REMOTE_ADDR'] ),
123
+ 'user_agent' => substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 ),
124
+ 'url' => preg_replace( '%(?<!:|/)/.*$%', '',
125
+ untrailingslashit( home_url() ) ) . wpcf7_get_request_uri(),
126
+ 'timestamp' => current_time( 'timestamp' ),
127
+ 'unit_tag' => isset( $_POST['_wpcf7_unit_tag'] )
128
+ ? $_POST['_wpcf7_unit_tag'] : '' );
129
+
130
+ $contact_form = $this->contact_form;
131
+
132
+ if ( ! $this->validate() ) { // Validation error occured
133
+ $this->status = 'validation_failed';
134
+ $this->response = $contact_form->message( 'validation_error' );
135
+
136
+ } elseif ( ! $this->accepted() ) { // Not accepted terms
137
+ $this->status = 'acceptance_missing';
138
+ $this->response = $contact_form->message( 'accept_terms' );
139
+
140
+ } elseif ( $this->spam() ) { // Spam!
141
+ $this->status = 'spam';
142
+ $this->response = $contact_form->message( 'spam' );
143
+
144
+ } elseif ( $this->mail() ) {
145
+ $this->status = 'mail_sent';
146
+ $this->response = $contact_form->message( 'mail_sent_ok' );
147
+
148
+ do_action( 'wpcf7_mail_sent', $contact_form );
149
+
150
+ } else {
151
+ $this->status = 'mail_failed';
152
+ $this->response = $contact_form->message( 'mail_sent_ng' );
153
+
154
+ do_action( 'wpcf7_mail_failed', $contact_form );
155
+ }
156
+
157
+ $this->remove_uploaded_files();
158
+
159
+ return $this->status;
160
+ }
161
+
162
+ private function validate() {
163
+ if ( $this->invalid_fields ) {
164
+ return false;
165
+ }
166
+
167
+ $result = array(
168
+ 'valid' => true,
169
+ 'reason' => array(),
170
+ 'idref' => array() );
171
+
172
+ $tags = $this->contact_form->form_scan_shortcode();
173
+
174
+ foreach ( $tags as $tag ) {
175
+ $result = apply_filters( 'wpcf7_validate_' . $tag['type'],
176
+ $result, $tag );
177
+ }
178
+
179
+ $result = apply_filters( 'wpcf7_validate', $result );
180
+
181
+ if ( $result['valid'] ) {
182
+ return true;
183
+ } else {
184
+ foreach ( (array) $result['reason'] as $name => $reason ) {
185
+ $field = array( 'reason' => $reason );
186
+
187
+ if ( isset( $result['idref'][$name] )
188
+ && wpcf7_is_name( $result['idref'][$name] ) ) {
189
+ $field['idref'] = $result['idref'][$name];
190
+ } else {
191
+ $field['idref'] = null;
192
+ }
193
+
194
+ $this->invalid_fields[$name] = $field;
195
+ }
196
+
197
+ return false;
198
+ }
199
+ }
200
+
201
+ private function accepted() {
202
+ return apply_filters( 'wpcf7_acceptance', true );
203
+ }
204
+
205
+ private function spam() {
206
+ $spam = false;
207
+
208
+ if ( WPCF7_VERIFY_NONCE && ! $this->verify_nonce() ) {
209
+ $spam = true;
210
+ }
211
+
212
+ if ( $this->blacklist_check() ) {
213
+ $spam = true;
214
+ }
215
+
216
+ return apply_filters( 'wpcf7_spam', $spam );
217
+ }
218
+
219
+ private function verify_nonce() {
220
+ return wpcf7_verify_nonce( $_POST['_wpnonce'], $this->contact_form->id() );
221
+ }
222
+
223
+ private function blacklist_check() {
224
+ $target = wpcf7_array_flatten( $this->posted_data );
225
+ $target[] = $_SERVER['REMOTE_ADDR'];
226
+ $target[] = $_SERVER['HTTP_USER_AGENT'];
227
+
228
+ $target = implode( "\n", $target );
229
+
230
+ return wpcf7_blacklist_check( $target );
231
+ }
232
+
233
+ /* Mail */
234
+
235
+ private function mail() {
236
+ $contact_form = $this->contact_form;
237
+
238
+ do_action( 'wpcf7_before_send_mail', $contact_form );
239
+
240
+ if ( $this->skip_mail || ! empty( $contact_form->skip_mail ) ) {
241
+ return true;
242
+ }
243
+
244
+ $result = WPCF7_Mail::send( $contact_form->prop( 'mail' ), 'mail' );
245
+
246
+ if ( $result ) {
247
+ $additional_mail = array();
248
+
249
+ if ( ( $mail_2 = $contact_form->prop( 'mail_2' ) ) && $mail_2['active'] ) {
250
+ $additional_mail['mail_2'] = $mail_2;
251
+ }
252
+
253
+ $additional_mail = apply_filters( 'wpcf7_additional_mail',
254
+ $additional_mail, $contact_form );
255
+
256
+ foreach ( $additional_mail as $name => $template ) {
257
+ WPCF7_Mail::send( $template, $name );
258
+ }
259
+
260
+ return true;
261
+ }
262
+
263
+ return false;
264
+ }
265
+
266
+ public function uploaded_files() {
267
+ return $this->uploaded_files;
268
+ }
269
+
270
+ public function add_uploaded_file( $name, $file_path ) {
271
+ $this->uploaded_files[$name] = $file_path;
272
+
273
+ if ( empty( $this->posted_data[$name] ) ) {
274
+ $this->posted_data[$name] = basename( $file_path );
275
+ }
276
+ }
277
+
278
+ public function remove_uploaded_files() {
279
+ foreach ( (array) $this->uploaded_files as $name => $path ) {
280
+ @unlink( $path );
281
+ }
282
+ }
283
+
284
+ public function get_meta( $name ) {
285
+ if ( isset( $this->meta[$name] ) ) {
286
+ return $this->meta[$name];
287
+ }
288
+ }
289
+ }
290
+
291
+ ?>
includes/upgrade.php CHANGED
@@ -64,11 +64,11 @@ function wpcf7_prepend_underscore( $new_ver, $old_ver ) {
64
  $props = $post->get_properties();
65
 
66
  foreach ( $props as $prop => $value ) {
67
- if ( metadata_exists( 'post', $post->id, '_' . $prop ) )
68
  continue;
69
 
70
- update_post_meta( $post->id, '_' . $prop, $value );
71
- delete_post_meta( $post->id, $prop );
72
  }
73
  }
74
  }
64
  $props = $post->get_properties();
65
 
66
  foreach ( $props as $prop => $value ) {
67
+ if ( metadata_exists( 'post', $post->id(), '_' . $prop ) )
68
  continue;
69
 
70
+ update_post_meta( $post->id(), '_' . $prop, $value );
71
+ delete_post_meta( $post->id(), $prop );
72
  }
73
  }
74
  }
languages/contact-form-7-fa_IR.mo CHANGED
Binary file
languages/contact-form-7-ja.mo CHANGED
Binary file
languages/contact-form-7.pot CHANGED
@@ -2,8 +2,8 @@ msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Contact Form 7\n"
4
  "Report-Msgid-Bugs-To: \n"
5
- "POT-Creation-Date: 2014-02-04 04:26+0900\n"
6
- "PO-Revision-Date: 2014-02-04 04:26+0900\n"
7
  "Last-Translator: Takayuki Miyoshi <takayukister@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
@@ -20,268 +20,269 @@ msgstr ""
20
  msgid "Just another contact form plugin. Simple but flexible."
21
  msgstr ""
22
 
23
- #: contact-form-7/settings.php:70
24
  #, php-format
25
  msgid "Contact form %d"
26
  msgstr ""
27
 
28
- #: contact-form-7/admin/admin.php:15 contact-form-7/modules/flamingo.php:123
29
  msgid "Contact Form 7"
30
  msgstr ""
31
 
32
- #: contact-form-7/admin/admin.php:16
33
  msgid "Contact"
34
  msgstr ""
35
 
36
- #: contact-form-7/admin/admin.php:21
37
- #: contact-form-7/admin/edit-contact-form.php:15
38
  msgid "Edit Contact Form"
39
  msgstr ""
40
 
41
- #: contact-form-7/admin/admin.php:22 contact-form-7/admin/admin.php:214
42
- #: contact-form-7/admin/admin.php:275 contact-form-7/includes/classes.php:67
 
43
  msgid "Contact Forms"
44
  msgstr ""
45
 
46
- #: contact-form-7/admin/admin.php:29 contact-form-7/admin/admin.php:318
47
- #: contact-form-7/admin/edit-contact-form.php:13
48
  msgid "Add New Contact Form"
49
  msgstr ""
50
 
51
- #: contact-form-7/admin/admin.php:30 contact-form-7/admin/admin.php:277
52
- #: contact-form-7/admin/admin.php:323 contact-form-7/admin/admin.php:335
53
- #: contact-form-7/admin/edit-contact-form.php:17
54
  msgid "Add New"
55
  msgstr ""
56
 
57
- #: contact-form-7/admin/admin.php:59 contact-form-7/admin/admin.php:132
58
  msgid "You are not allowed to edit this item."
59
  msgstr ""
60
 
61
- #: contact-form-7/admin/admin.php:171
62
  msgid "You are not allowed to delete this item."
63
  msgstr ""
64
 
65
- #: contact-form-7/admin/admin.php:174
66
  msgid "Error in deleting."
67
  msgstr ""
68
 
69
- #: contact-form-7/admin/admin.php:253
70
  msgid "Generate Tag"
71
  msgstr ""
72
 
73
- #: contact-form-7/admin/admin.php:281
74
  #, php-format
75
  msgid "Search results for &#8220;%s&#8221;"
76
  msgstr ""
77
 
78
- #: contact-form-7/admin/admin.php:290
79
  msgid "Search Contact Forms"
80
  msgstr ""
81
 
82
- #: contact-form-7/admin/admin.php:322
83
  #, php-format
84
  msgid "Use the default language (%s)"
85
  msgstr ""
86
 
87
- #: contact-form-7/admin/admin.php:326
88
  msgid "Or"
89
  msgstr ""
90
 
91
- #: contact-form-7/admin/admin.php:330
92
  msgid "(select language)"
93
  msgstr ""
94
 
95
- #: contact-form-7/admin/admin.php:342
96
  msgid "Form"
97
  msgstr ""
98
 
99
- #: contact-form-7/admin/admin.php:345
100
  msgid "Mail"
101
  msgstr ""
102
 
103
- #: contact-form-7/admin/admin.php:348
104
  msgid "Mail (2)"
105
  msgstr ""
106
 
107
- #: contact-form-7/admin/admin.php:353
108
  msgid "Use mail (2)"
109
  msgstr ""
110
 
111
- #: contact-form-7/admin/admin.php:355
112
  msgid "Messages"
113
  msgstr ""
114
 
115
- #: contact-form-7/admin/admin.php:358
116
  msgid "Additional Settings"
117
  msgstr ""
118
 
119
- #: contact-form-7/admin/admin.php:373
120
  msgid "Contact form created."
121
  msgstr ""
122
 
123
- #: contact-form-7/admin/admin.php:375
124
  msgid "Contact form saved."
125
  msgstr ""
126
 
127
- #: contact-form-7/admin/admin.php:377
128
  msgid "Contact form deleted."
129
  msgstr ""
130
 
131
- #: contact-form-7/admin/admin.php:394
132
  msgid "Settings"
133
  msgstr ""
134
 
135
- #: contact-form-7/admin/admin.php:405
136
  msgid "http://contactform7.com/docs/"
137
  msgstr ""
138
 
139
- #: contact-form-7/admin/admin.php:406
140
  msgid "Docs"
141
  msgstr ""
142
 
143
- #: contact-form-7/admin/admin.php:407
144
  msgid "http://contactform7.com/faq/"
145
  msgstr ""
146
 
147
- #: contact-form-7/admin/admin.php:408
148
  msgid "FAQ"
149
  msgstr ""
150
 
151
- #: contact-form-7/admin/admin.php:409
152
  msgid "http://contactform7.com/support/"
153
  msgstr ""
154
 
155
- #: contact-form-7/admin/admin.php:410
156
  msgid "Support"
157
  msgstr ""
158
 
159
- #: contact-form-7/admin/admin.php:411 contact-form-7/admin/admin.php:466
160
  msgid "http://contactform7.com/donate/"
161
  msgstr ""
162
 
163
- #: contact-form-7/admin/admin.php:412 contact-form-7/admin/admin.php:466
164
  msgid "Donate"
165
  msgstr ""
166
 
167
- #: contact-form-7/admin/admin.php:434
168
  #, php-format
169
  msgid ""
170
  "<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> "
171
  "Please <a href=\"%3$s\">update WordPress</a> first."
172
  msgstr ""
173
 
174
- #: contact-form-7/admin/admin.php:459
175
  msgid "Dismiss"
176
  msgstr ""
177
 
178
- #: contact-form-7/admin/admin.php:464
179
  msgid "Contact Form 7 Needs Your Support"
180
  msgstr ""
181
 
182
- #: contact-form-7/admin/admin.php:465
183
  msgid ""
184
  "It is hard to continue development and support for this plugin without "
185
  "contributions from users like you. If you enjoy using Contact Form 7 and "
186
  "find it useful, please consider making a donation."
187
  msgstr ""
188
 
189
- #: contact-form-7/admin/admin.php:470
190
  msgid "Get Started"
191
  msgstr ""
192
 
193
- #: contact-form-7/admin/admin.php:472
194
  msgid "http://contactform7.com/getting-started-with-contact-form-7/"
195
  msgstr ""
196
 
197
- #: contact-form-7/admin/admin.php:472
198
  msgid "Getting Started with Contact Form 7"
199
  msgstr ""
200
 
201
- #: contact-form-7/admin/admin.php:473
202
  msgid "http://contactform7.com/admin-screen/"
203
  msgstr ""
204
 
205
- #: contact-form-7/admin/admin.php:473
206
  msgid "Admin Screen"
207
  msgstr ""
208
 
209
- #: contact-form-7/admin/admin.php:474
210
  msgid "http://contactform7.com/tag-syntax/"
211
  msgstr ""
212
 
213
- #: contact-form-7/admin/admin.php:474
214
  msgid "How Tags Work"
215
  msgstr ""
216
 
217
- #: contact-form-7/admin/admin.php:475
218
  msgid "http://contactform7.com/setting-up-mail/"
219
  msgstr ""
220
 
221
- #: contact-form-7/admin/admin.php:475
222
  msgid "Setting Up Mail"
223
  msgstr ""
224
 
225
- #: contact-form-7/admin/admin.php:480
226
  msgid "Did You Know?"
227
  msgstr ""
228
 
229
- #: contact-form-7/admin/admin.php:482
230
  msgid "http://contactform7.com/spam-filtering-with-akismet/"
231
  msgstr ""
232
 
233
- #: contact-form-7/admin/admin.php:482
234
  msgid "Spam Filtering with Akismet"
235
  msgstr ""
236
 
237
- #: contact-form-7/admin/admin.php:483
238
  msgid "http://contactform7.com/save-submitted-messages-with-flamingo/"
239
  msgstr ""
240
 
241
- #: contact-form-7/admin/admin.php:483
242
  msgid "Save Messages with Flamingo"
243
  msgstr ""
244
 
245
- #: contact-form-7/admin/admin.php:484
246
  msgid "http://contactform7.com/selectable-recipient-with-pipes/"
247
  msgstr ""
248
 
249
- #: contact-form-7/admin/admin.php:484
250
  msgid "Selectable Recipient with Pipes"
251
  msgstr ""
252
 
253
- #: contact-form-7/admin/admin.php:485
254
  msgid ""
255
  "http://contactform7.com/tracking-form-submissions-with-google-analytics/"
256
  msgstr ""
257
 
258
- #: contact-form-7/admin/admin.php:485
259
  msgid "Tracking with Google Analytics"
260
  msgstr ""
261
 
262
- #: contact-form-7/admin/edit-contact-form.php:49
263
  msgid ""
264
  "Copy this code and paste it into your post, page or text widget content."
265
  msgstr ""
266
 
267
- #: contact-form-7/admin/edit-contact-form.php:55
268
  msgid "Old code is also available."
269
  msgstr ""
270
 
271
- #: contact-form-7/admin/edit-contact-form.php:63
272
  msgid "Save"
273
  msgstr ""
274
 
275
- #: contact-form-7/admin/edit-contact-form.php:70
276
  msgid "Duplicate"
277
  msgstr ""
278
 
279
- #: contact-form-7/admin/edit-contact-form.php:75
280
  #: contact-form-7/admin/includes/class-contact-forms-list-table.php:83
281
  msgid "Delete"
282
  msgstr ""
283
 
284
- #: contact-form-7/admin/edit-contact-form.php:77
285
  msgid ""
286
  "You are about to delete this contact form.\n"
287
  " 'Cancel' to stop, 'OK' to delete."
@@ -300,7 +301,7 @@ msgid "Author"
300
  msgstr ""
301
 
302
  #: contact-form-7/admin/includes/class-contact-forms-list-table.php:14
303
- #: contact-form-7/modules/date.php:144
304
  msgid "Date"
305
  msgstr ""
306
 
@@ -317,489 +318,480 @@ msgstr ""
317
  msgid "Edit &#8220;%s&#8221;"
318
  msgstr ""
319
 
320
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:156
321
  msgid "Y/m/d g:i:s A"
322
  msgstr ""
323
 
324
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:163
325
  #, php-format
326
  msgid "%s ago"
327
  msgstr ""
328
 
329
- #: contact-form-7/admin/includes/class-contact-forms-list-table.php:165
330
  msgid "Y/m/d"
331
  msgstr ""
332
 
333
- #: contact-form-7/admin/includes/meta-boxes.php:44
334
  msgid "To:"
335
  msgstr ""
336
 
337
- #: contact-form-7/admin/includes/meta-boxes.php:49
338
  msgid "From:"
339
  msgstr ""
340
 
341
- #: contact-form-7/admin/includes/meta-boxes.php:54
342
  msgid "Subject:"
343
  msgstr ""
344
 
345
- #: contact-form-7/admin/includes/meta-boxes.php:61
346
  msgid "Additional headers:"
347
  msgstr ""
348
 
349
- #: contact-form-7/admin/includes/meta-boxes.php:66
350
  msgid "File attachments:"
351
  msgstr ""
352
 
353
- #: contact-form-7/admin/includes/meta-boxes.php:74
354
  msgid "Use HTML content type"
355
  msgstr ""
356
 
357
- #: contact-form-7/admin/includes/meta-boxes.php:80
358
  msgid "Message body:"
359
  msgstr ""
360
 
361
- #: contact-form-7/includes/classes.php:68
 
 
 
 
362
  msgid "Contact Form"
363
  msgstr ""
364
 
365
- #: contact-form-7/includes/classes.php:148
 
366
  msgid "Untitled"
367
  msgstr ""
368
 
369
- #: contact-form-7/includes/controller.php:202
370
- msgid "Sending ..."
371
  msgstr ""
372
 
373
- #: contact-form-7/includes/functions.php:21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  #, php-format
375
- msgid ""
376
- "%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s! Use "
377
- "%3$s instead."
378
  msgstr ""
379
 
380
- #: contact-form-7/includes/functions.php:23
381
  #, php-format
382
- msgid ""
383
- "%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s with "
384
- "no alternative available."
 
 
 
 
 
 
 
 
 
385
  msgstr ""
386
 
387
- #: contact-form-7/includes/functions.php:30
388
  msgid "Sender's message was sent successfully"
389
  msgstr ""
390
 
391
- #: contact-form-7/includes/functions.php:31
392
  msgid "Your message was sent successfully. Thanks."
393
  msgstr ""
394
 
395
- #: contact-form-7/includes/functions.php:35
396
  msgid "Sender's message was failed to send"
397
  msgstr ""
398
 
399
- #: contact-form-7/includes/functions.php:36
400
- #: contact-form-7/includes/functions.php:46
401
  msgid ""
402
  "Failed to send your message. Please try later or contact the administrator "
403
  "by another method."
404
  msgstr ""
405
 
406
- #: contact-form-7/includes/functions.php:40
407
  msgid "Validation errors occurred"
408
  msgstr ""
409
 
410
- #: contact-form-7/includes/functions.php:41
411
  msgid ""
412
  "Validation errors occurred. Please confirm the fields and submit it again."
413
  msgstr ""
414
 
415
- #: contact-form-7/includes/functions.php:45
416
  msgid "Submission was referred to as spam"
417
  msgstr ""
418
 
419
- #: contact-form-7/includes/functions.php:50
420
  msgid "There are terms that the sender must accept"
421
  msgstr ""
422
 
423
- #: contact-form-7/includes/functions.php:51
424
  msgid "Please accept the terms to proceed."
425
  msgstr ""
426
 
427
- #: contact-form-7/includes/functions.php:55
428
  msgid "There is a field that the sender must fill in"
429
  msgstr ""
430
 
431
- #: contact-form-7/includes/functions.php:56
432
  msgid "Please fill the required field."
433
  msgstr ""
434
 
435
- #: contact-form-7/includes/functions.php:80
436
- msgid "Your Name"
437
- msgstr ""
438
-
439
- #: contact-form-7/includes/functions.php:80
440
- #: contact-form-7/includes/functions.php:82
441
- msgid "(required)"
442
- msgstr ""
443
-
444
- #: contact-form-7/includes/functions.php:82
445
- msgid "Your Email"
446
- msgstr ""
447
-
448
- #: contact-form-7/includes/functions.php:84
449
- msgid "Subject"
450
- msgstr ""
451
-
452
- #: contact-form-7/includes/functions.php:86
453
- msgid "Your Message"
454
- msgstr ""
455
-
456
- #: contact-form-7/includes/functions.php:88
457
- #: contact-form-7/modules/submit.php:28
458
- msgid "Send"
459
- msgstr ""
460
-
461
- #: contact-form-7/includes/functions.php:96
462
- #, php-format
463
- msgid "From: %s"
464
- msgstr ""
465
-
466
- #: contact-form-7/includes/functions.php:97
467
- #, php-format
468
- msgid "Subject: %s"
469
- msgstr ""
470
-
471
- #: contact-form-7/includes/functions.php:98
472
- #: contact-form-7/includes/functions.php:112
473
- msgid "Message Body:"
474
- msgstr ""
475
-
476
- #: contact-form-7/includes/functions.php:99
477
- #: contact-form-7/includes/functions.php:113
478
- #, php-format
479
- msgid "This e-mail was sent from a contact form on %1$s (%2$s)"
480
  msgstr ""
481
 
482
- #: contact-form-7/includes/functions.php:155
483
  msgid "Afrikaans"
484
  msgstr ""
485
 
486
- #: contact-form-7/includes/functions.php:156
487
  msgid "Albanian"
488
  msgstr ""
489
 
490
- #: contact-form-7/includes/functions.php:157
491
  msgid "Arabic"
492
  msgstr ""
493
 
494
- #: contact-form-7/includes/functions.php:158
495
  msgid "Armenian"
496
  msgstr ""
497
 
498
- #: contact-form-7/includes/functions.php:159
499
  msgid "Azerbaijani"
500
  msgstr ""
501
 
502
- #: contact-form-7/includes/functions.php:160
503
  msgid "Bangla"
504
  msgstr ""
505
 
506
- #: contact-form-7/includes/functions.php:161
507
  msgid "Basque"
508
  msgstr ""
509
 
510
- #: contact-form-7/includes/functions.php:162
511
  msgid "Belarusian"
512
  msgstr ""
513
 
514
- #: contact-form-7/includes/functions.php:163
515
  msgid "Bosnian"
516
  msgstr ""
517
 
518
- #: contact-form-7/includes/functions.php:164
519
  msgid "Brazilian Portuguese"
520
  msgstr ""
521
 
522
- #: contact-form-7/includes/functions.php:165
523
  msgid "Bulgarian"
524
  msgstr ""
525
 
526
- #: contact-form-7/includes/functions.php:166
527
  msgid "Catalan"
528
  msgstr ""
529
 
530
- #: contact-form-7/includes/functions.php:167
531
  msgid "Central Kurdish"
532
  msgstr ""
533
 
534
- #: contact-form-7/includes/functions.php:168
535
  msgid "Chinese (Simplified)"
536
  msgstr ""
537
 
538
- #: contact-form-7/includes/functions.php:169
539
  msgid "Chinese (Traditional)"
540
  msgstr ""
541
 
542
- #: contact-form-7/includes/functions.php:170
543
  msgid "Croatian"
544
  msgstr ""
545
 
546
- #: contact-form-7/includes/functions.php:171
547
  msgid "Czech"
548
  msgstr ""
549
 
550
- #: contact-form-7/includes/functions.php:172
551
  msgid "Danish"
552
  msgstr ""
553
 
554
- #: contact-form-7/includes/functions.php:173
555
  msgid "Dutch"
556
  msgstr ""
557
 
558
- #: contact-form-7/includes/functions.php:174
559
  msgid "English"
560
  msgstr ""
561
 
562
- #: contact-form-7/includes/functions.php:175
563
  msgid "Esperanto"
564
  msgstr ""
565
 
566
- #: contact-form-7/includes/functions.php:176
567
  msgid "Estonian"
568
  msgstr ""
569
 
570
- #: contact-form-7/includes/functions.php:177
571
  msgid "Finnish"
572
  msgstr ""
573
 
574
- #: contact-form-7/includes/functions.php:178
575
  msgid "French"
576
  msgstr ""
577
 
578
- #: contact-form-7/includes/functions.php:179
579
  msgid "Galician"
580
  msgstr ""
581
 
582
- #: contact-form-7/includes/functions.php:180
583
  msgid "Gujarati"
584
  msgstr ""
585
 
586
- #: contact-form-7/includes/functions.php:181
587
  msgid "Georgian"
588
  msgstr ""
589
 
590
- #: contact-form-7/includes/functions.php:182
591
  msgid "German"
592
  msgstr ""
593
 
594
- #: contact-form-7/includes/functions.php:183
595
  msgid "Greek"
596
  msgstr ""
597
 
598
- #: contact-form-7/includes/functions.php:184
599
  msgid "Haitian"
600
  msgstr ""
601
 
602
- #: contact-form-7/includes/functions.php:185
603
  msgid "Hebrew"
604
  msgstr ""
605
 
606
- #: contact-form-7/includes/functions.php:186
607
  msgid "Hindi"
608
  msgstr ""
609
 
610
- #: contact-form-7/includes/functions.php:187
611
  msgid "Hungarian"
612
  msgstr ""
613
 
614
- #: contact-form-7/includes/functions.php:188
615
  msgid "Indian Bengali"
616
  msgstr ""
617
 
618
- #: contact-form-7/includes/functions.php:189
619
  msgid "Indonesian"
620
  msgstr ""
621
 
622
- #: contact-form-7/includes/functions.php:190
623
  msgid "Irish"
624
  msgstr ""
625
 
626
- #: contact-form-7/includes/functions.php:191
627
  msgid "Italian"
628
  msgstr ""
629
 
630
- #: contact-form-7/includes/functions.php:192
631
  msgid "Japanese"
632
  msgstr ""
633
 
634
- #: contact-form-7/includes/functions.php:193
635
  msgid "Korean"
636
  msgstr ""
637
 
638
- #: contact-form-7/includes/functions.php:194
639
  msgid "Latvian"
640
  msgstr ""
641
 
642
- #: contact-form-7/includes/functions.php:195
643
  msgid "Lithuanian"
644
  msgstr ""
645
 
646
- #: contact-form-7/includes/functions.php:196
647
  msgid "Macedonian"
648
  msgstr ""
649
 
650
- #: contact-form-7/includes/functions.php:197
651
  msgid "Malay"
652
  msgstr ""
653
 
654
- #: contact-form-7/includes/functions.php:198
655
  msgid "Malayalam"
656
  msgstr ""
657
 
658
- #: contact-form-7/includes/functions.php:199
659
  msgid "Maltese"
660
  msgstr ""
661
 
662
- #: contact-form-7/includes/functions.php:200
663
  msgid "Norwegian"
664
  msgstr ""
665
 
666
- #: contact-form-7/includes/functions.php:201
667
  msgid "Persian"
668
  msgstr ""
669
 
670
- #: contact-form-7/includes/functions.php:202
671
  msgid "Polish"
672
  msgstr ""
673
 
674
- #: contact-form-7/includes/functions.php:203
675
  msgid "Portuguese"
676
  msgstr ""
677
 
678
- #: contact-form-7/includes/functions.php:204
679
  msgid "Russian"
680
  msgstr ""
681
 
682
- #: contact-form-7/includes/functions.php:205
683
  msgid "Romanian"
684
  msgstr ""
685
 
686
- #: contact-form-7/includes/functions.php:206
687
  msgid "Serbian"
688
  msgstr ""
689
 
690
- #: contact-form-7/includes/functions.php:207
691
  msgid "Sinhala"
692
  msgstr ""
693
 
694
- #: contact-form-7/includes/functions.php:208
695
  msgid "Slovak"
696
  msgstr ""
697
 
698
- #: contact-form-7/includes/functions.php:209
699
  msgid "Slovene"
700
  msgstr ""
701
 
702
- #: contact-form-7/includes/functions.php:210
703
  msgid "Spanish"
704
  msgstr ""
705
 
706
- #: contact-form-7/includes/functions.php:211
707
  msgid "Swedish"
708
  msgstr ""
709
 
710
- #: contact-form-7/includes/functions.php:212
711
  msgid "Tamil"
712
  msgstr ""
713
 
714
- #: contact-form-7/includes/functions.php:213
715
  msgid "Thai"
716
  msgstr ""
717
 
718
- #: contact-form-7/includes/functions.php:214
719
  msgid "Tagalog"
720
  msgstr ""
721
 
722
- #: contact-form-7/includes/functions.php:215
723
  msgid "Turkish"
724
  msgstr ""
725
 
726
- #: contact-form-7/includes/functions.php:216
727
  msgid "Ukrainian"
728
  msgstr ""
729
 
730
- #: contact-form-7/includes/functions.php:217
731
  msgid "Vietnamese"
732
  msgstr ""
733
 
734
- #: contact-form-7/modules/acceptance.php:133
735
  msgid "Acceptance"
736
  msgstr ""
737
 
738
- #: contact-form-7/modules/acceptance.php:142
739
- #: contact-form-7/modules/captcha.php:206
740
- #: contact-form-7/modules/checkbox.php:270 contact-form-7/modules/date.php:161
741
- #: contact-form-7/modules/file.php:236 contact-form-7/modules/number.php:171
742
- #: contact-form-7/modules/quiz.php:166 contact-form-7/modules/select.php:152
743
- #: contact-form-7/modules/text.php:214 contact-form-7/modules/textarea.php:112
744
  msgid "Name"
745
  msgstr ""
746
 
747
- #: contact-form-7/modules/acceptance.php:147
748
- #: contact-form-7/modules/acceptance.php:150
749
- #: contact-form-7/modules/captcha.php:213
750
- #: contact-form-7/modules/captcha.php:216
751
- #: contact-form-7/modules/captcha.php:221
752
- #: contact-form-7/modules/captcha.php:224
753
  #: contact-form-7/modules/captcha.php:228
754
- #: contact-form-7/modules/captcha.php:239
755
- #: contact-form-7/modules/captcha.php:242
756
- #: contact-form-7/modules/captcha.php:247
757
- #: contact-form-7/modules/captcha.php:250
758
- #: contact-form-7/modules/checkbox.php:275
759
- #: contact-form-7/modules/checkbox.php:278 contact-form-7/modules/date.php:166
760
- #: contact-form-7/modules/date.php:169 contact-form-7/modules/date.php:174
761
- #: contact-form-7/modules/date.php:177 contact-form-7/modules/date.php:182
762
- #: contact-form-7/modules/date.php:187 contact-form-7/modules/file.php:241
763
- #: contact-form-7/modules/file.php:244 contact-form-7/modules/file.php:249
764
- #: contact-form-7/modules/file.php:252 contact-form-7/modules/number.php:176
765
- #: contact-form-7/modules/number.php:179 contact-form-7/modules/number.php:184
766
- #: contact-form-7/modules/number.php:187 contact-form-7/modules/number.php:192
767
- #: contact-form-7/modules/number.php:197 contact-form-7/modules/quiz.php:171
768
- #: contact-form-7/modules/quiz.php:174 contact-form-7/modules/quiz.php:179
769
- #: contact-form-7/modules/quiz.php:182 contact-form-7/modules/select.php:157
770
- #: contact-form-7/modules/select.php:160 contact-form-7/modules/submit.php:59
 
771
  #: contact-form-7/modules/submit.php:62 contact-form-7/modules/submit.php:67
772
- #: contact-form-7/modules/text.php:219 contact-form-7/modules/text.php:222
773
- #: contact-form-7/modules/text.php:227 contact-form-7/modules/text.php:230
774
- #: contact-form-7/modules/text.php:236 contact-form-7/modules/text.php:249
775
- #: contact-form-7/modules/textarea.php:117
776
- #: contact-form-7/modules/textarea.php:120
777
- #: contact-form-7/modules/textarea.php:125
778
- #: contact-form-7/modules/textarea.php:128
779
- #: contact-form-7/modules/textarea.php:133
780
- #: contact-form-7/modules/textarea.php:138
781
  msgid "optional"
782
  msgstr ""
783
 
784
- #: contact-form-7/modules/acceptance.php:156
785
  msgid "Make this checkbox checked by default?"
786
  msgstr ""
787
 
788
- #: contact-form-7/modules/acceptance.php:157
789
  msgid "Make this checkbox work inversely?"
790
  msgstr ""
791
 
792
- #: contact-form-7/modules/acceptance.php:158
793
  msgid "* That means visitor who accepts the term unchecks it."
794
  msgstr ""
795
 
796
- #: contact-form-7/modules/acceptance.php:163
797
- #: contact-form-7/modules/captcha.php:255
798
- #: contact-form-7/modules/checkbox.php:298 contact-form-7/modules/date.php:195
799
- #: contact-form-7/modules/file.php:257 contact-form-7/modules/number.php:205
800
- #: contact-form-7/modules/quiz.php:194 contact-form-7/modules/select.php:177
801
- #: contact-form-7/modules/submit.php:74 contact-form-7/modules/text.php:257
802
- #: contact-form-7/modules/textarea.php:146
803
  msgid "Copy this code and paste it into the form left."
804
  msgstr ""
805
 
@@ -809,63 +801,63 @@ msgid ""
809
  "really-simple-captcha/\">Really Simple CAPTCHA</a> plugin installed."
810
  msgstr ""
811
 
812
- #: contact-form-7/modules/captcha.php:178
813
  msgid "The code that sender entered does not match the CAPTCHA"
814
  msgstr ""
815
 
816
- #: contact-form-7/modules/captcha.php:179
817
  msgid "Your entered code is incorrect."
818
  msgstr ""
819
 
820
- #: contact-form-7/modules/captcha.php:192
821
  msgid "CAPTCHA"
822
  msgstr ""
823
 
824
- #: contact-form-7/modules/captcha.php:203
825
  msgid "Note: To use CAPTCHA, you need Really Simple CAPTCHA plugin installed."
826
  msgstr ""
827
 
828
- #: contact-form-7/modules/captcha.php:210
829
  msgid "Image settings"
830
  msgstr ""
831
 
832
- #: contact-form-7/modules/captcha.php:221
833
  msgid "Foreground color"
834
  msgstr ""
835
 
836
- #: contact-form-7/modules/captcha.php:224
837
  msgid "Background color"
838
  msgstr ""
839
 
840
- #: contact-form-7/modules/captcha.php:228
841
  msgid "Image size"
842
  msgstr ""
843
 
844
- #: contact-form-7/modules/captcha.php:229
845
  msgid "Small"
846
  msgstr ""
847
 
848
- #: contact-form-7/modules/captcha.php:230
849
  msgid "Medium"
850
  msgstr ""
851
 
852
- #: contact-form-7/modules/captcha.php:231
853
  msgid "Large"
854
  msgstr ""
855
 
856
- #: contact-form-7/modules/captcha.php:236
857
  msgid "Input field settings"
858
  msgstr ""
859
 
860
- #: contact-form-7/modules/captcha.php:256
861
  msgid "For image"
862
  msgstr ""
863
 
864
- #: contact-form-7/modules/captcha.php:258
865
  msgid "For input field"
866
  msgstr ""
867
 
868
- #: contact-form-7/modules/captcha.php:289
869
  #, php-format
870
  msgid ""
871
  "This contact form contains CAPTCHA fields, but the temporary folder for the "
@@ -873,142 +865,142 @@ msgid ""
873
  "change its permission manually."
874
  msgstr ""
875
 
876
- #: contact-form-7/modules/captcha.php:295
877
  msgid ""
878
  "This contact form contains CAPTCHA fields, but the necessary libraries (GD "
879
  "and FreeType) are not available on your server."
880
  msgstr ""
881
 
882
- #: contact-form-7/modules/checkbox.php:243
883
  msgid "Checkboxes"
884
  msgstr ""
885
 
886
- #: contact-form-7/modules/checkbox.php:246
887
  msgid "Radio buttons"
888
  msgstr ""
889
 
890
- #: contact-form-7/modules/checkbox.php:267 contact-form-7/modules/date.php:160
891
- #: contact-form-7/modules/file.php:235 contact-form-7/modules/number.php:170
892
- #: contact-form-7/modules/select.php:151 contact-form-7/modules/text.php:213
893
- #: contact-form-7/modules/textarea.php:111
894
  msgid "Required field?"
895
  msgstr ""
896
 
897
- #: contact-form-7/modules/checkbox.php:283
898
- #: contact-form-7/modules/select.php:165
899
  msgid "Choices"
900
  msgstr ""
901
 
902
- #: contact-form-7/modules/checkbox.php:285
903
- #: contact-form-7/modules/select.php:167
904
  msgid "* One choice per line."
905
  msgstr ""
906
 
907
- #: contact-form-7/modules/checkbox.php:289
908
  msgid "Put a label first, a checkbox last?"
909
  msgstr ""
910
 
911
- #: contact-form-7/modules/checkbox.php:290
912
  msgid "Wrap each item with <label> tag?"
913
  msgstr ""
914
 
915
- #: contact-form-7/modules/checkbox.php:292
916
  msgid "Make checkboxes exclusive?"
917
  msgstr ""
918
 
919
- #: contact-form-7/modules/checkbox.php:300 contact-form-7/modules/date.php:197
920
- #: contact-form-7/modules/number.php:207 contact-form-7/modules/select.php:179
921
- #: contact-form-7/modules/text.php:259 contact-form-7/modules/textarea.php:148
922
  msgid "And, put this code into the Mail fields below."
923
  msgstr ""
924
 
925
- #: contact-form-7/modules/date.php:120
926
  msgid "Date format that the sender entered is invalid"
927
  msgstr ""
928
 
929
- #: contact-form-7/modules/date.php:121
930
  msgid "Date format seems invalid."
931
  msgstr ""
932
 
933
- #: contact-form-7/modules/date.php:125
934
  msgid "Date is earlier than minimum limit"
935
  msgstr ""
936
 
937
- #: contact-form-7/modules/date.php:126
938
  msgid "This date is too early."
939
  msgstr ""
940
 
941
- #: contact-form-7/modules/date.php:130
942
  msgid "Date is later than maximum limit"
943
  msgstr ""
944
 
945
- #: contact-form-7/modules/date.php:131
946
  msgid "This date is too late."
947
  msgstr ""
948
 
949
- #: contact-form-7/modules/date.php:187 contact-form-7/modules/number.php:197
950
- #: contact-form-7/modules/text.php:249 contact-form-7/modules/textarea.php:138
951
  msgid "Default value"
952
  msgstr ""
953
 
954
- #: contact-form-7/modules/date.php:190 contact-form-7/modules/number.php:200
955
- #: contact-form-7/modules/text.php:252 contact-form-7/modules/textarea.php:141
956
  msgid "Use this text as placeholder?"
957
  msgstr ""
958
 
959
- #: contact-form-7/modules/file.php:196
960
  msgid "Uploading a file fails for any reason"
961
  msgstr ""
962
 
963
- #: contact-form-7/modules/file.php:197
964
  msgid "Failed to upload file."
965
  msgstr ""
966
 
967
- #: contact-form-7/modules/file.php:201
968
  msgid "Uploaded file is not allowed file type"
969
  msgstr ""
970
 
971
- #: contact-form-7/modules/file.php:202
972
  msgid "This file type is not allowed."
973
  msgstr ""
974
 
975
- #: contact-form-7/modules/file.php:206
976
  msgid "Uploaded file is too large"
977
  msgstr ""
978
 
979
- #: contact-form-7/modules/file.php:207
980
  msgid "This file is too large."
981
  msgstr ""
982
 
983
- #: contact-form-7/modules/file.php:211
984
  msgid "Uploading a file fails for PHP error"
985
  msgstr ""
986
 
987
- #: contact-form-7/modules/file.php:212
988
  msgid "Failed to upload file. Error occurred."
989
  msgstr ""
990
 
991
- #: contact-form-7/modules/file.php:226
992
  msgid "File upload"
993
  msgstr ""
994
 
995
- #: contact-form-7/modules/file.php:249
996
  msgid "File size limit"
997
  msgstr ""
998
 
999
- #: contact-form-7/modules/file.php:249
1000
  msgid "bytes"
1001
  msgstr ""
1002
 
1003
- #: contact-form-7/modules/file.php:252
1004
  msgid "Acceptable file types"
1005
  msgstr ""
1006
 
1007
- #: contact-form-7/modules/file.php:259
1008
  msgid "And, put this code into the File Attachments field below."
1009
  msgstr ""
1010
 
1011
- #: contact-form-7/modules/file.php:285
1012
  #, php-format
1013
  msgid ""
1014
  "This contact form contains file uploading fields, but the temporary folder "
@@ -1023,67 +1015,67 @@ msgid ""
1023
  "strong> <a href=\"%s\" target=\"_blank\">See how to avoid it.</a>"
1024
  msgstr ""
1025
 
1026
- #: contact-form-7/modules/number.php:123
1027
  msgid "Number format that the sender entered is invalid"
1028
  msgstr ""
1029
 
1030
- #: contact-form-7/modules/number.php:124
1031
  msgid "Number format seems invalid."
1032
  msgstr ""
1033
 
1034
- #: contact-form-7/modules/number.php:128
1035
  msgid "Number is smaller than minimum limit"
1036
  msgstr ""
1037
 
1038
- #: contact-form-7/modules/number.php:129
1039
  msgid "This number is too small."
1040
  msgstr ""
1041
 
1042
- #: contact-form-7/modules/number.php:133
1043
  msgid "Number is larger than maximum limit"
1044
  msgstr ""
1045
 
1046
- #: contact-form-7/modules/number.php:134
1047
  msgid "This number is too large."
1048
  msgstr ""
1049
 
1050
- #: contact-form-7/modules/number.php:147
1051
  msgid "Number (spinbox)"
1052
  msgstr ""
1053
 
1054
- #: contact-form-7/modules/number.php:150
1055
  msgid "Number (slider)"
1056
  msgstr ""
1057
 
1058
- #: contact-form-7/modules/quiz.php:143
1059
  msgid "Sender doesn't enter the correct answer to the quiz"
1060
  msgstr ""
1061
 
1062
- #: contact-form-7/modules/quiz.php:144
1063
  msgid "Your answer is not correct."
1064
  msgstr ""
1065
 
1066
- #: contact-form-7/modules/quiz.php:157
1067
  msgid "Quiz"
1068
  msgstr ""
1069
 
1070
- #: contact-form-7/modules/quiz.php:187
1071
  msgid "Quizzes"
1072
  msgstr ""
1073
 
1074
- #: contact-form-7/modules/quiz.php:189
1075
  msgid "* quiz|answer (e.g. 1+1=?|2)"
1076
  msgstr ""
1077
 
1078
- #: contact-form-7/modules/select.php:142
1079
  msgid "Drop-down menu"
1080
  msgstr ""
1081
 
1082
- #: contact-form-7/modules/select.php:171
1083
  msgid "Allow multiple selections?"
1084
  msgstr ""
1085
 
1086
- #: contact-form-7/modules/select.php:172
1087
  msgid "Insert a blank item as the first option?"
1088
  msgstr ""
1089
 
@@ -1095,62 +1087,62 @@ msgstr ""
1095
  msgid "Label"
1096
  msgstr ""
1097
 
1098
- #: contact-form-7/modules/text.php:152
1099
  msgid "Email address that the sender entered is invalid"
1100
  msgstr ""
1101
 
1102
- #: contact-form-7/modules/text.php:153
1103
  msgid "Email address seems invalid."
1104
  msgstr ""
1105
 
1106
- #: contact-form-7/modules/text.php:157
1107
  msgid "URL that the sender entered is invalid"
1108
  msgstr ""
1109
 
1110
- #: contact-form-7/modules/text.php:158
1111
  msgid "URL seems invalid."
1112
  msgstr ""
1113
 
1114
- #: contact-form-7/modules/text.php:162
1115
  msgid "Telephone number that the sender entered is invalid"
1116
  msgstr ""
1117
 
1118
- #: contact-form-7/modules/text.php:163
1119
  msgid "Telephone number seems invalid."
1120
  msgstr ""
1121
 
1122
- #: contact-form-7/modules/text.php:176
1123
  msgid "Text field"
1124
  msgstr ""
1125
 
1126
- #: contact-form-7/modules/text.php:179
1127
  msgid "Email"
1128
  msgstr ""
1129
 
1130
- #: contact-form-7/modules/text.php:182
1131
  msgid "URL"
1132
  msgstr ""
1133
 
1134
- #: contact-form-7/modules/text.php:185
1135
  msgid "Telephone number"
1136
  msgstr ""
1137
 
1138
- #: contact-form-7/modules/text.php:236
1139
  msgid "Akismet"
1140
  msgstr ""
1141
 
1142
- #: contact-form-7/modules/text.php:238
1143
  msgid "This field requires author's name"
1144
  msgstr ""
1145
 
1146
- #: contact-form-7/modules/text.php:240
1147
  msgid "This field requires author's email address"
1148
  msgstr ""
1149
 
1150
- #: contact-form-7/modules/text.php:242
1151
  msgid "This field requires author's URL"
1152
  msgstr ""
1153
 
1154
- #: contact-form-7/modules/textarea.php:102
1155
  msgid "Text area"
1156
  msgstr ""
2
  msgstr ""
3
  "Project-Id-Version: Contact Form 7\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2014-07-01 08:59+0900\n"
6
+ "PO-Revision-Date: 2014-07-01 08:59+0900\n"
7
  "Last-Translator: Takayuki Miyoshi <takayukister@gmail.com>\n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
20
  msgid "Just another contact form plugin. Simple but flexible."
21
  msgstr ""
22
 
23
+ #: contact-form-7/settings.php:71
24
  #, php-format
25
  msgid "Contact form %d"
26
  msgstr ""
27
 
28
+ #: contact-form-7/admin/admin.php:8 contact-form-7/modules/flamingo.php:128
29
  msgid "Contact Form 7"
30
  msgstr ""
31
 
32
+ #: contact-form-7/admin/admin.php:9
33
  msgid "Contact"
34
  msgstr ""
35
 
36
+ #: contact-form-7/admin/admin.php:14
37
+ #: contact-form-7/admin/edit-contact-form.php:13
38
  msgid "Edit Contact Form"
39
  msgstr ""
40
 
41
+ #: contact-form-7/admin/admin.php:15 contact-form-7/admin/admin.php:155
42
+ #: contact-form-7/admin/admin.php:211
43
+ #: contact-form-7/includes/contact-form.php:29
44
  msgid "Contact Forms"
45
  msgstr ""
46
 
47
+ #: contact-form-7/admin/admin.php:22 contact-form-7/admin/admin.php:253
48
+ #: contact-form-7/admin/edit-contact-form.php:11
49
  msgid "Add New Contact Form"
50
  msgstr ""
51
 
52
+ #: contact-form-7/admin/admin.php:23 contact-form-7/admin/admin.php:213
53
+ #: contact-form-7/admin/admin.php:258 contact-form-7/admin/admin.php:270
54
+ #: contact-form-7/admin/edit-contact-form.php:15
55
  msgid "Add New"
56
  msgstr ""
57
 
58
+ #: contact-form-7/admin/admin.php:52 contact-form-7/admin/admin.php:73
59
  msgid "You are not allowed to edit this item."
60
  msgstr ""
61
 
62
+ #: contact-form-7/admin/admin.php:112
63
  msgid "You are not allowed to delete this item."
64
  msgstr ""
65
 
66
+ #: contact-form-7/admin/admin.php:115
67
  msgid "Error in deleting."
68
  msgstr ""
69
 
70
+ #: contact-form-7/admin/admin.php:190
71
  msgid "Generate Tag"
72
  msgstr ""
73
 
74
+ #: contact-form-7/admin/admin.php:217
75
  #, php-format
76
  msgid "Search results for &#8220;%s&#8221;"
77
  msgstr ""
78
 
79
+ #: contact-form-7/admin/admin.php:226
80
  msgid "Search Contact Forms"
81
  msgstr ""
82
 
83
+ #: contact-form-7/admin/admin.php:257
84
  #, php-format
85
  msgid "Use the default language (%s)"
86
  msgstr ""
87
 
88
+ #: contact-form-7/admin/admin.php:261
89
  msgid "Or"
90
  msgstr ""
91
 
92
+ #: contact-form-7/admin/admin.php:265
93
  msgid "(select language)"
94
  msgstr ""
95
 
96
+ #: contact-form-7/admin/admin.php:277
97
  msgid "Form"
98
  msgstr ""
99
 
100
+ #: contact-form-7/admin/admin.php:280
101
  msgid "Mail"
102
  msgstr ""
103
 
104
+ #: contact-form-7/admin/admin.php:283
105
  msgid "Mail (2)"
106
  msgstr ""
107
 
108
+ #: contact-form-7/admin/admin.php:288
109
  msgid "Use mail (2)"
110
  msgstr ""
111
 
112
+ #: contact-form-7/admin/admin.php:290
113
  msgid "Messages"
114
  msgstr ""
115
 
116
+ #: contact-form-7/admin/admin.php:293
117
  msgid "Additional Settings"
118
  msgstr ""
119
 
120
+ #: contact-form-7/admin/admin.php:308
121
  msgid "Contact form created."
122
  msgstr ""
123
 
124
+ #: contact-form-7/admin/admin.php:310
125
  msgid "Contact form saved."
126
  msgstr ""
127
 
128
+ #: contact-form-7/admin/admin.php:312
129
  msgid "Contact form deleted."
130
  msgstr ""
131
 
132
+ #: contact-form-7/admin/admin.php:329
133
  msgid "Settings"
134
  msgstr ""
135
 
136
+ #: contact-form-7/admin/admin.php:340
137
  msgid "http://contactform7.com/docs/"
138
  msgstr ""
139
 
140
+ #: contact-form-7/admin/admin.php:341
141
  msgid "Docs"
142
  msgstr ""
143
 
144
+ #: contact-form-7/admin/admin.php:342
145
  msgid "http://contactform7.com/faq/"
146
  msgstr ""
147
 
148
+ #: contact-form-7/admin/admin.php:343
149
  msgid "FAQ"
150
  msgstr ""
151
 
152
+ #: contact-form-7/admin/admin.php:344
153
  msgid "http://contactform7.com/support/"
154
  msgstr ""
155
 
156
+ #: contact-form-7/admin/admin.php:345
157
  msgid "Support"
158
  msgstr ""
159
 
160
+ #: contact-form-7/admin/admin.php:346 contact-form-7/admin/admin.php:402
161
  msgid "http://contactform7.com/donate/"
162
  msgstr ""
163
 
164
+ #: contact-form-7/admin/admin.php:347 contact-form-7/admin/admin.php:402
165
  msgid "Donate"
166
  msgstr ""
167
 
168
+ #: contact-form-7/admin/admin.php:369
169
  #, php-format
170
  msgid ""
171
  "<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> "
172
  "Please <a href=\"%3$s\">update WordPress</a> first."
173
  msgstr ""
174
 
175
+ #: contact-form-7/admin/admin.php:395
176
  msgid "Dismiss"
177
  msgstr ""
178
 
179
+ #: contact-form-7/admin/admin.php:400
180
  msgid "Contact Form 7 Needs Your Support"
181
  msgstr ""
182
 
183
+ #: contact-form-7/admin/admin.php:401
184
  msgid ""
185
  "It is hard to continue development and support for this plugin without "
186
  "contributions from users like you. If you enjoy using Contact Form 7 and "
187
  "find it useful, please consider making a donation."
188
  msgstr ""
189
 
190
+ #: contact-form-7/admin/admin.php:406
191
  msgid "Get Started"
192
  msgstr ""
193
 
194
+ #: contact-form-7/admin/admin.php:408
195
  msgid "http://contactform7.com/getting-started-with-contact-form-7/"
196
  msgstr ""
197
 
198
+ #: contact-form-7/admin/admin.php:408
199
  msgid "Getting Started with Contact Form 7"
200
  msgstr ""
201
 
202
+ #: contact-form-7/admin/admin.php:409
203
  msgid "http://contactform7.com/admin-screen/"
204
  msgstr ""
205
 
206
+ #: contact-form-7/admin/admin.php:409
207
  msgid "Admin Screen"
208
  msgstr ""
209
 
210
+ #: contact-form-7/admin/admin.php:410
211
  msgid "http://contactform7.com/tag-syntax/"
212
  msgstr ""
213
 
214
+ #: contact-form-7/admin/admin.php:410
215
  msgid "How Tags Work"
216
  msgstr ""
217
 
218
+ #: contact-form-7/admin/admin.php:411
219
  msgid "http://contactform7.com/setting-up-mail/"
220
  msgstr ""
221
 
222
+ #: contact-form-7/admin/admin.php:411
223
  msgid "Setting Up Mail"
224
  msgstr ""
225
 
226
+ #: contact-form-7/admin/admin.php:416
227
  msgid "Did You Know?"
228
  msgstr ""
229
 
230
+ #: contact-form-7/admin/admin.php:418
231
  msgid "http://contactform7.com/spam-filtering-with-akismet/"
232
  msgstr ""
233
 
234
+ #: contact-form-7/admin/admin.php:418
235
  msgid "Spam Filtering with Akismet"
236
  msgstr ""
237
 
238
+ #: contact-form-7/admin/admin.php:419
239
  msgid "http://contactform7.com/save-submitted-messages-with-flamingo/"
240
  msgstr ""
241
 
242
+ #: contact-form-7/admin/admin.php:419
243
  msgid "Save Messages with Flamingo"
244
  msgstr ""
245
 
246
+ #: contact-form-7/admin/admin.php:420
247
  msgid "http://contactform7.com/selectable-recipient-with-pipes/"
248
  msgstr ""
249
 
250
+ #: contact-form-7/admin/admin.php:420
251
  msgid "Selectable Recipient with Pipes"
252
  msgstr ""
253
 
254
+ #: contact-form-7/admin/admin.php:421
255
  msgid ""
256
  "http://contactform7.com/tracking-form-submissions-with-google-analytics/"
257
  msgstr ""
258
 
259
+ #: contact-form-7/admin/admin.php:421
260
  msgid "Tracking with Google Analytics"
261
  msgstr ""
262
 
263
+ #: contact-form-7/admin/edit-contact-form.php:47
264
  msgid ""
265
  "Copy this code and paste it into your post, page or text widget content."
266
  msgstr ""
267
 
268
+ #: contact-form-7/admin/edit-contact-form.php:53
269
  msgid "Old code is also available."
270
  msgstr ""
271
 
272
+ #: contact-form-7/admin/edit-contact-form.php:61
273
  msgid "Save"
274
  msgstr ""
275
 
276
+ #: contact-form-7/admin/edit-contact-form.php:68
277
  msgid "Duplicate"
278
  msgstr ""
279
 
280
+ #: contact-form-7/admin/edit-contact-form.php:73
281
  #: contact-form-7/admin/includes/class-contact-forms-list-table.php:83
282
  msgid "Delete"
283
  msgstr ""
284
 
285
+ #: contact-form-7/admin/edit-contact-form.php:75
286
  msgid ""
287
  "You are about to delete this contact form.\n"
288
  " 'Cancel' to stop, 'OK' to delete."
301
  msgstr ""
302
 
303
  #: contact-form-7/admin/includes/class-contact-forms-list-table.php:14
304
+ #: contact-form-7/modules/date.php:147
305
  msgid "Date"
306
  msgstr ""
307
 
318
  msgid "Edit &#8220;%s&#8221;"
319
  msgstr ""
320
 
321
+ #: contact-form-7/admin/includes/class-contact-forms-list-table.php:158
322
  msgid "Y/m/d g:i:s A"
323
  msgstr ""
324
 
325
+ #: contact-form-7/admin/includes/class-contact-forms-list-table.php:165
326
  #, php-format
327
  msgid "%s ago"
328
  msgstr ""
329
 
330
+ #: contact-form-7/admin/includes/class-contact-forms-list-table.php:167
331
  msgid "Y/m/d"
332
  msgstr ""
333
 
334
+ #: contact-form-7/admin/includes/meta-boxes.php:43
335
  msgid "To:"
336
  msgstr ""
337
 
338
+ #: contact-form-7/admin/includes/meta-boxes.php:48
339
  msgid "From:"
340
  msgstr ""
341
 
342
+ #: contact-form-7/admin/includes/meta-boxes.php:53
343
  msgid "Subject:"
344
  msgstr ""
345
 
346
+ #: contact-form-7/admin/includes/meta-boxes.php:60
347
  msgid "Additional headers:"
348
  msgstr ""
349
 
350
+ #: contact-form-7/admin/includes/meta-boxes.php:65
351
  msgid "File attachments:"
352
  msgstr ""
353
 
354
+ #: contact-form-7/admin/includes/meta-boxes.php:73
355
  msgid "Use HTML content type"
356
  msgstr ""
357
 
358
+ #: contact-form-7/admin/includes/meta-boxes.php:79
359
  msgid "Message body:"
360
  msgstr ""
361
 
362
+ #: contact-form-7/admin/includes/meta-boxes.php:85
363
+ msgid "Exclude lines with blank mail-tags from output"
364
+ msgstr ""
365
+
366
+ #: contact-form-7/includes/contact-form.php:30
367
  msgid "Contact Form"
368
  msgstr ""
369
 
370
+ #: contact-form-7/includes/contact-form.php:76
371
+ #: contact-form-7/includes/contact-form.php:201
372
  msgid "Untitled"
373
  msgstr ""
374
 
375
+ #: contact-form-7/includes/contact-form.php:809
376
+ msgid "Your Name"
377
  msgstr ""
378
 
379
+ #: contact-form-7/includes/contact-form.php:809
380
+ #: contact-form-7/includes/contact-form.php:811
381
+ msgid "(required)"
382
+ msgstr ""
383
+
384
+ #: contact-form-7/includes/contact-form.php:811
385
+ msgid "Your Email"
386
+ msgstr ""
387
+
388
+ #: contact-form-7/includes/contact-form.php:813
389
+ msgid "Subject"
390
+ msgstr ""
391
+
392
+ #: contact-form-7/includes/contact-form.php:815
393
+ msgid "Your Message"
394
+ msgstr ""
395
+
396
+ #: contact-form-7/includes/contact-form.php:817
397
+ #: contact-form-7/modules/submit.php:28
398
+ msgid "Send"
399
+ msgstr ""
400
+
401
+ #: contact-form-7/includes/contact-form.php:825
402
  #, php-format
403
+ msgid "From: %s"
 
 
404
  msgstr ""
405
 
406
+ #: contact-form-7/includes/contact-form.php:826
407
  #, php-format
408
+ msgid "Subject: %s"
409
+ msgstr ""
410
+
411
+ #: contact-form-7/includes/contact-form.php:827
412
+ #: contact-form-7/includes/contact-form.php:842
413
+ msgid "Message Body:"
414
+ msgstr ""
415
+
416
+ #: contact-form-7/includes/contact-form.php:828
417
+ #: contact-form-7/includes/contact-form.php:843
418
+ #, php-format
419
+ msgid "This e-mail was sent from a contact form on %1$s (%2$s)"
420
  msgstr ""
421
 
422
+ #: contact-form-7/includes/contact-form.php:866
423
  msgid "Sender's message was sent successfully"
424
  msgstr ""
425
 
426
+ #: contact-form-7/includes/contact-form.php:867
427
  msgid "Your message was sent successfully. Thanks."
428
  msgstr ""
429
 
430
+ #: contact-form-7/includes/contact-form.php:871
431
  msgid "Sender's message was failed to send"
432
  msgstr ""
433
 
434
+ #: contact-form-7/includes/contact-form.php:872
435
+ #: contact-form-7/includes/contact-form.php:882
436
  msgid ""
437
  "Failed to send your message. Please try later or contact the administrator "
438
  "by another method."
439
  msgstr ""
440
 
441
+ #: contact-form-7/includes/contact-form.php:876
442
  msgid "Validation errors occurred"
443
  msgstr ""
444
 
445
+ #: contact-form-7/includes/contact-form.php:877
446
  msgid ""
447
  "Validation errors occurred. Please confirm the fields and submit it again."
448
  msgstr ""
449
 
450
+ #: contact-form-7/includes/contact-form.php:881
451
  msgid "Submission was referred to as spam"
452
  msgstr ""
453
 
454
+ #: contact-form-7/includes/contact-form.php:886
455
  msgid "There are terms that the sender must accept"
456
  msgstr ""
457
 
458
+ #: contact-form-7/includes/contact-form.php:887
459
  msgid "Please accept the terms to proceed."
460
  msgstr ""
461
 
462
+ #: contact-form-7/includes/contact-form.php:891
463
  msgid "There is a field that the sender must fill in"
464
  msgstr ""
465
 
466
+ #: contact-form-7/includes/contact-form.php:892
467
  msgid "Please fill the required field."
468
  msgstr ""
469
 
470
+ #: contact-form-7/includes/controller.php:199
471
+ msgid "Sending ..."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
472
  msgstr ""
473
 
474
+ #: contact-form-7/includes/functions.php:39
475
  msgid "Afrikaans"
476
  msgstr ""
477
 
478
+ #: contact-form-7/includes/functions.php:40
479
  msgid "Albanian"
480
  msgstr ""
481
 
482
+ #: contact-form-7/includes/functions.php:41
483
  msgid "Arabic"
484
  msgstr ""
485
 
486
+ #: contact-form-7/includes/functions.php:42
487
  msgid "Armenian"
488
  msgstr ""
489
 
490
+ #: contact-form-7/includes/functions.php:43
491
  msgid "Azerbaijani"
492
  msgstr ""
493
 
494
+ #: contact-form-7/includes/functions.php:44
495
  msgid "Bangla"
496
  msgstr ""
497
 
498
+ #: contact-form-7/includes/functions.php:45
499
  msgid "Basque"
500
  msgstr ""
501
 
502
+ #: contact-form-7/includes/functions.php:46
503
  msgid "Belarusian"
504
  msgstr ""
505
 
506
+ #: contact-form-7/includes/functions.php:47
507
  msgid "Bosnian"
508
  msgstr ""
509
 
510
+ #: contact-form-7/includes/functions.php:48
511
  msgid "Brazilian Portuguese"
512
  msgstr ""
513
 
514
+ #: contact-form-7/includes/functions.php:49
515
  msgid "Bulgarian"
516
  msgstr ""
517
 
518
+ #: contact-form-7/includes/functions.php:50
519
  msgid "Catalan"
520
  msgstr ""
521
 
522
+ #: contact-form-7/includes/functions.php:51
523
  msgid "Central Kurdish"
524
  msgstr ""
525
 
526
+ #: contact-form-7/includes/functions.php:52
527
  msgid "Chinese (Simplified)"
528
  msgstr ""
529
 
530
+ #: contact-form-7/includes/functions.php:53
531
  msgid "Chinese (Traditional)"
532
  msgstr ""
533
 
534
+ #: contact-form-7/includes/functions.php:54
535
  msgid "Croatian"
536
  msgstr ""
537
 
538
+ #: contact-form-7/includes/functions.php:55
539
  msgid "Czech"
540
  msgstr ""
541
 
542
+ #: contact-form-7/includes/functions.php:56
543
  msgid "Danish"
544
  msgstr ""
545
 
546
+ #: contact-form-7/includes/functions.php:57
547
  msgid "Dutch"
548
  msgstr ""
549
 
550
+ #: contact-form-7/includes/functions.php:58
551
  msgid "English"
552
  msgstr ""
553
 
554
+ #: contact-form-7/includes/functions.php:59
555
  msgid "Esperanto"
556
  msgstr ""
557
 
558
+ #: contact-form-7/includes/functions.php:60
559
  msgid "Estonian"
560
  msgstr ""
561
 
562
+ #: contact-form-7/includes/functions.php:61
563
  msgid "Finnish"
564
  msgstr ""
565
 
566
+ #: contact-form-7/includes/functions.php:62
567
  msgid "French"
568
  msgstr ""
569
 
570
+ #: contact-form-7/includes/functions.php:63
571
  msgid "Galician"
572
  msgstr ""
573
 
574
+ #: contact-form-7/includes/functions.php:64
575
  msgid "Gujarati"
576
  msgstr ""
577
 
578
+ #: contact-form-7/includes/functions.php:65
579
  msgid "Georgian"
580
  msgstr ""
581
 
582
+ #: contact-form-7/includes/functions.php:66
583
  msgid "German"
584
  msgstr ""
585
 
586
+ #: contact-form-7/includes/functions.php:67
587
  msgid "Greek"
588
  msgstr ""
589
 
590
+ #: contact-form-7/includes/functions.php:68
591
  msgid "Haitian"
592
  msgstr ""
593
 
594
+ #: contact-form-7/includes/functions.php:69
595
  msgid "Hebrew"
596
  msgstr ""
597
 
598
+ #: contact-form-7/includes/functions.php:70
599
  msgid "Hindi"
600
  msgstr ""
601
 
602
+ #: contact-form-7/includes/functions.php:71
603
  msgid "Hungarian"
604
  msgstr ""
605
 
606
+ #: contact-form-7/includes/functions.php:72
607
  msgid "Indian Bengali"
608
  msgstr ""
609
 
610
+ #: contact-form-7/includes/functions.php:73
611
  msgid "Indonesian"
612
  msgstr ""
613
 
614
+ #: contact-form-7/includes/functions.php:74
615
  msgid "Irish"
616
  msgstr ""
617
 
618
+ #: contact-form-7/includes/functions.php:75
619
  msgid "Italian"
620
  msgstr ""
621
 
622
+ #: contact-form-7/includes/functions.php:76
623
  msgid "Japanese"
624
  msgstr ""
625
 
626
+ #: contact-form-7/includes/functions.php:77
627
  msgid "Korean"
628
  msgstr ""
629
 
630
+ #: contact-form-7/includes/functions.php:78
631
  msgid "Latvian"
632
  msgstr ""
633
 
634
+ #: contact-form-7/includes/functions.php:79
635
  msgid "Lithuanian"
636
  msgstr ""
637
 
638
+ #: contact-form-7/includes/functions.php:80
639
  msgid "Macedonian"
640
  msgstr ""
641
 
642
+ #: contact-form-7/includes/functions.php:81
643
  msgid "Malay"
644
  msgstr ""
645
 
646
+ #: contact-form-7/includes/functions.php:82
647
  msgid "Malayalam"
648
  msgstr ""
649
 
650
+ #: contact-form-7/includes/functions.php:83
651
  msgid "Maltese"
652
  msgstr ""
653
 
654
+ #: contact-form-7/includes/functions.php:84
655
  msgid "Norwegian"
656
  msgstr ""
657
 
658
+ #: contact-form-7/includes/functions.php:85
659
  msgid "Persian"
660
  msgstr ""
661
 
662
+ #: contact-form-7/includes/functions.php:86
663
  msgid "Polish"
664
  msgstr ""
665
 
666
+ #: contact-form-7/includes/functions.php:87
667
  msgid "Portuguese"
668
  msgstr ""
669
 
670
+ #: contact-form-7/includes/functions.php:88
671
  msgid "Russian"
672
  msgstr ""
673
 
674
+ #: contact-form-7/includes/functions.php:89
675
  msgid "Romanian"
676
  msgstr ""
677
 
678
+ #: contact-form-7/includes/functions.php:90
679
  msgid "Serbian"
680
  msgstr ""
681
 
682
+ #: contact-form-7/includes/functions.php:91
683
  msgid "Sinhala"
684
  msgstr ""
685
 
686
+ #: contact-form-7/includes/functions.php:92
687
  msgid "Slovak"
688
  msgstr ""
689
 
690
+ #: contact-form-7/includes/functions.php:93
691
  msgid "Slovene"
692
  msgstr ""
693
 
694
+ #: contact-form-7/includes/functions.php:94
695
  msgid "Spanish"
696
  msgstr ""
697
 
698
+ #: contact-form-7/includes/functions.php:95
699
  msgid "Swedish"
700
  msgstr ""
701
 
702
+ #: contact-form-7/includes/functions.php:96
703
  msgid "Tamil"
704
  msgstr ""
705
 
706
+ #: contact-form-7/includes/functions.php:97
707
  msgid "Thai"
708
  msgstr ""
709
 
710
+ #: contact-form-7/includes/functions.php:98
711
  msgid "Tagalog"
712
  msgstr ""
713
 
714
+ #: contact-form-7/includes/functions.php:99
715
  msgid "Turkish"
716
  msgstr ""
717
 
718
+ #: contact-form-7/includes/functions.php:100
719
  msgid "Ukrainian"
720
  msgstr ""
721
 
722
+ #: contact-form-7/includes/functions.php:101
723
  msgid "Vietnamese"
724
  msgstr ""
725
 
726
+ #: contact-form-7/modules/acceptance.php:137
727
  msgid "Acceptance"
728
  msgstr ""
729
 
730
+ #: contact-form-7/modules/acceptance.php:146
731
+ #: contact-form-7/modules/captcha.php:210
732
+ #: contact-form-7/modules/checkbox.php:288 contact-form-7/modules/date.php:164
733
+ #: contact-form-7/modules/file.php:240 contact-form-7/modules/number.php:174
734
+ #: contact-form-7/modules/quiz.php:171 contact-form-7/modules/select.php:161
735
+ #: contact-form-7/modules/text.php:217 contact-form-7/modules/textarea.php:116
736
  msgid "Name"
737
  msgstr ""
738
 
739
+ #: contact-form-7/modules/acceptance.php:151
740
+ #: contact-form-7/modules/acceptance.php:154
741
+ #: contact-form-7/modules/captcha.php:217
742
+ #: contact-form-7/modules/captcha.php:220
743
+ #: contact-form-7/modules/captcha.php:225
 
744
  #: contact-form-7/modules/captcha.php:228
745
+ #: contact-form-7/modules/captcha.php:232
746
+ #: contact-form-7/modules/captcha.php:243
747
+ #: contact-form-7/modules/captcha.php:246
748
+ #: contact-form-7/modules/captcha.php:251
749
+ #: contact-form-7/modules/captcha.php:254
750
+ #: contact-form-7/modules/checkbox.php:293
751
+ #: contact-form-7/modules/checkbox.php:296 contact-form-7/modules/date.php:169
752
+ #: contact-form-7/modules/date.php:172 contact-form-7/modules/date.php:177
753
+ #: contact-form-7/modules/date.php:180 contact-form-7/modules/date.php:185
754
+ #: contact-form-7/modules/date.php:190 contact-form-7/modules/file.php:245
755
+ #: contact-form-7/modules/file.php:248 contact-form-7/modules/file.php:253
756
+ #: contact-form-7/modules/file.php:256 contact-form-7/modules/number.php:179
757
+ #: contact-form-7/modules/number.php:182 contact-form-7/modules/number.php:187
758
+ #: contact-form-7/modules/number.php:190 contact-form-7/modules/number.php:195
759
+ #: contact-form-7/modules/number.php:200 contact-form-7/modules/quiz.php:176
760
+ #: contact-form-7/modules/quiz.php:179 contact-form-7/modules/quiz.php:184
761
+ #: contact-form-7/modules/quiz.php:187 contact-form-7/modules/select.php:166
762
+ #: contact-form-7/modules/select.php:169 contact-form-7/modules/submit.php:59
763
  #: contact-form-7/modules/submit.php:62 contact-form-7/modules/submit.php:67
764
+ #: contact-form-7/modules/text.php:222 contact-form-7/modules/text.php:225
765
+ #: contact-form-7/modules/text.php:230 contact-form-7/modules/text.php:233
766
+ #: contact-form-7/modules/text.php:239 contact-form-7/modules/text.php:252
767
+ #: contact-form-7/modules/textarea.php:121
768
+ #: contact-form-7/modules/textarea.php:124
769
+ #: contact-form-7/modules/textarea.php:129
770
+ #: contact-form-7/modules/textarea.php:132
771
+ #: contact-form-7/modules/textarea.php:137
772
+ #: contact-form-7/modules/textarea.php:142
773
  msgid "optional"
774
  msgstr ""
775
 
776
+ #: contact-form-7/modules/acceptance.php:160
777
  msgid "Make this checkbox checked by default?"
778
  msgstr ""
779
 
780
+ #: contact-form-7/modules/acceptance.php:161
781
  msgid "Make this checkbox work inversely?"
782
  msgstr ""
783
 
784
+ #: contact-form-7/modules/acceptance.php:162
785
  msgid "* That means visitor who accepts the term unchecks it."
786
  msgstr ""
787
 
788
+ #: contact-form-7/modules/acceptance.php:167
789
+ #: contact-form-7/modules/captcha.php:259
790
+ #: contact-form-7/modules/checkbox.php:316 contact-form-7/modules/date.php:198
791
+ #: contact-form-7/modules/file.php:261 contact-form-7/modules/number.php:208
792
+ #: contact-form-7/modules/quiz.php:199 contact-form-7/modules/select.php:186
793
+ #: contact-form-7/modules/submit.php:74 contact-form-7/modules/text.php:260
794
+ #: contact-form-7/modules/textarea.php:150
795
  msgid "Copy this code and paste it into the form left."
796
  msgstr ""
797
 
801
  "really-simple-captcha/\">Really Simple CAPTCHA</a> plugin installed."
802
  msgstr ""
803
 
804
+ #: contact-form-7/modules/captcha.php:182
805
  msgid "The code that sender entered does not match the CAPTCHA"
806
  msgstr ""
807
 
808
+ #: contact-form-7/modules/captcha.php:183
809
  msgid "Your entered code is incorrect."
810
  msgstr ""
811
 
812
+ #: contact-form-7/modules/captcha.php:196
813
  msgid "CAPTCHA"
814
  msgstr ""
815
 
816
+ #: contact-form-7/modules/captcha.php:207
817
  msgid "Note: To use CAPTCHA, you need Really Simple CAPTCHA plugin installed."
818
  msgstr ""
819
 
820
+ #: contact-form-7/modules/captcha.php:214
821
  msgid "Image settings"
822
  msgstr ""
823
 
824
+ #: contact-form-7/modules/captcha.php:225
825
  msgid "Foreground color"
826
  msgstr ""
827
 
828
+ #: contact-form-7/modules/captcha.php:228
829
  msgid "Background color"
830
  msgstr ""
831
 
832
+ #: contact-form-7/modules/captcha.php:232
833
  msgid "Image size"
834
  msgstr ""
835
 
836
+ #: contact-form-7/modules/captcha.php:233
837
  msgid "Small"
838
  msgstr ""
839
 
840
+ #: contact-form-7/modules/captcha.php:234
841
  msgid "Medium"
842
  msgstr ""
843
 
844
+ #: contact-form-7/modules/captcha.php:235
845
  msgid "Large"
846
  msgstr ""
847
 
848
+ #: contact-form-7/modules/captcha.php:240
849
  msgid "Input field settings"
850
  msgstr ""
851
 
852
+ #: contact-form-7/modules/captcha.php:260
853
  msgid "For image"
854
  msgstr ""
855
 
856
+ #: contact-form-7/modules/captcha.php:262
857
  msgid "For input field"
858
  msgstr ""
859
 
860
+ #: contact-form-7/modules/captcha.php:293
861
  #, php-format
862
  msgid ""
863
  "This contact form contains CAPTCHA fields, but the temporary folder for the "
865
  "change its permission manually."
866
  msgstr ""
867
 
868
+ #: contact-form-7/modules/captcha.php:299
869
  msgid ""
870
  "This contact form contains CAPTCHA fields, but the necessary libraries (GD "
871
  "and FreeType) are not available on your server."
872
  msgstr ""
873
 
874
+ #: contact-form-7/modules/checkbox.php:261
875
  msgid "Checkboxes"
876
  msgstr ""
877
 
878
+ #: contact-form-7/modules/checkbox.php:264
879
  msgid "Radio buttons"
880
  msgstr ""
881
 
882
+ #: contact-form-7/modules/checkbox.php:285 contact-form-7/modules/date.php:163
883
+ #: contact-form-7/modules/file.php:239 contact-form-7/modules/number.php:173
884
+ #: contact-form-7/modules/select.php:160 contact-form-7/modules/text.php:216
885
+ #: contact-form-7/modules/textarea.php:115
886
  msgid "Required field?"
887
  msgstr ""
888
 
889
+ #: contact-form-7/modules/checkbox.php:301
890
+ #: contact-form-7/modules/select.php:174
891
  msgid "Choices"
892
  msgstr ""
893
 
894
+ #: contact-form-7/modules/checkbox.php:303
895
+ #: contact-form-7/modules/select.php:176
896
  msgid "* One choice per line."
897
  msgstr ""
898
 
899
+ #: contact-form-7/modules/checkbox.php:307
900
  msgid "Put a label first, a checkbox last?"
901
  msgstr ""
902
 
903
+ #: contact-form-7/modules/checkbox.php:308
904
  msgid "Wrap each item with <label> tag?"
905
  msgstr ""
906
 
907
+ #: contact-form-7/modules/checkbox.php:310
908
  msgid "Make checkboxes exclusive?"
909
  msgstr ""
910
 
911
+ #: contact-form-7/modules/checkbox.php:318 contact-form-7/modules/date.php:200
912
+ #: contact-form-7/modules/number.php:210 contact-form-7/modules/select.php:188
913
+ #: contact-form-7/modules/text.php:262 contact-form-7/modules/textarea.php:152
914
  msgid "And, put this code into the Mail fields below."
915
  msgstr ""
916
 
917
+ #: contact-form-7/modules/date.php:123
918
  msgid "Date format that the sender entered is invalid"
919
  msgstr ""
920
 
921
+ #: contact-form-7/modules/date.php:124
922
  msgid "Date format seems invalid."
923
  msgstr ""
924
 
925
+ #: contact-form-7/modules/date.php:128
926
  msgid "Date is earlier than minimum limit"
927
  msgstr ""
928
 
929
+ #: contact-form-7/modules/date.php:129
930
  msgid "This date is too early."
931
  msgstr ""
932
 
933
+ #: contact-form-7/modules/date.php:133
934
  msgid "Date is later than maximum limit"
935
  msgstr ""
936
 
937
+ #: contact-form-7/modules/date.php:134
938
  msgid "This date is too late."
939
  msgstr ""
940
 
941
+ #: contact-form-7/modules/date.php:190 contact-form-7/modules/number.php:200
942
+ #: contact-form-7/modules/text.php:252 contact-form-7/modules/textarea.php:142
943
  msgid "Default value"
944
  msgstr ""
945
 
946
+ #: contact-form-7/modules/date.php:193 contact-form-7/modules/number.php:203
947
+ #: contact-form-7/modules/text.php:255 contact-form-7/modules/textarea.php:145
948
  msgid "Use this text as placeholder?"
949
  msgstr ""
950
 
951
+ #: contact-form-7/modules/file.php:200
952
  msgid "Uploading a file fails for any reason"
953
  msgstr ""
954
 
955
+ #: contact-form-7/modules/file.php:201
956
  msgid "Failed to upload file."
957
  msgstr ""
958
 
959
+ #: contact-form-7/modules/file.php:205
960
  msgid "Uploaded file is not allowed file type"
961
  msgstr ""
962
 
963
+ #: contact-form-7/modules/file.php:206
964
  msgid "This file type is not allowed."
965
  msgstr ""
966
 
967
+ #: contact-form-7/modules/file.php:210
968
  msgid "Uploaded file is too large"
969
  msgstr ""
970
 
971
+ #: contact-form-7/modules/file.php:211
972
  msgid "This file is too large."
973
  msgstr ""
974
 
975
+ #: contact-form-7/modules/file.php:215
976
  msgid "Uploading a file fails for PHP error"
977
  msgstr ""
978
 
979
+ #: contact-form-7/modules/file.php:216
980
  msgid "Failed to upload file. Error occurred."
981
  msgstr ""
982
 
983
+ #: contact-form-7/modules/file.php:230
984
  msgid "File upload"
985
  msgstr ""
986
 
987
+ #: contact-form-7/modules/file.php:253
988
  msgid "File size limit"
989
  msgstr ""
990
 
991
+ #: contact-form-7/modules/file.php:253
992
  msgid "bytes"
993
  msgstr ""
994
 
995
+ #: contact-form-7/modules/file.php:256
996
  msgid "Acceptable file types"
997
  msgstr ""
998
 
999
+ #: contact-form-7/modules/file.php:263
1000
  msgid "And, put this code into the File Attachments field below."
1001
  msgstr ""
1002
 
1003
+ #: contact-form-7/modules/file.php:289
1004
  #, php-format
1005
  msgid ""
1006
  "This contact form contains file uploading fields, but the temporary folder "
1015
  "strong> <a href=\"%s\" target=\"_blank\">See how to avoid it.</a>"
1016
  msgstr ""
1017
 
1018
+ #: contact-form-7/modules/number.php:126
1019
  msgid "Number format that the sender entered is invalid"
1020
  msgstr ""
1021
 
1022
+ #: contact-form-7/modules/number.php:127
1023
  msgid "Number format seems invalid."
1024
  msgstr ""
1025
 
1026
+ #: contact-form-7/modules/number.php:131
1027
  msgid "Number is smaller than minimum limit"
1028
  msgstr ""
1029
 
1030
+ #: contact-form-7/modules/number.php:132
1031
  msgid "This number is too small."
1032
  msgstr ""
1033
 
1034
+ #: contact-form-7/modules/number.php:136
1035
  msgid "Number is larger than maximum limit"
1036
  msgstr ""
1037
 
1038
+ #: contact-form-7/modules/number.php:137
1039
  msgid "This number is too large."
1040
  msgstr ""
1041
 
1042
+ #: contact-form-7/modules/number.php:150
1043
  msgid "Number (spinbox)"
1044
  msgstr ""
1045
 
1046
+ #: contact-form-7/modules/number.php:153
1047
  msgid "Number (slider)"
1048
  msgstr ""
1049
 
1050
+ #: contact-form-7/modules/quiz.php:148
1051
  msgid "Sender doesn't enter the correct answer to the quiz"
1052
  msgstr ""
1053
 
1054
+ #: contact-form-7/modules/quiz.php:149
1055
  msgid "Your answer is not correct."
1056
  msgstr ""
1057
 
1058
+ #: contact-form-7/modules/quiz.php:162
1059
  msgid "Quiz"
1060
  msgstr ""
1061
 
1062
+ #: contact-form-7/modules/quiz.php:192
1063
  msgid "Quizzes"
1064
  msgstr ""
1065
 
1066
+ #: contact-form-7/modules/quiz.php:194
1067
  msgid "* quiz|answer (e.g. 1+1=?|2)"
1068
  msgstr ""
1069
 
1070
+ #: contact-form-7/modules/select.php:151
1071
  msgid "Drop-down menu"
1072
  msgstr ""
1073
 
1074
+ #: contact-form-7/modules/select.php:180
1075
  msgid "Allow multiple selections?"
1076
  msgstr ""
1077
 
1078
+ #: contact-form-7/modules/select.php:181
1079
  msgid "Insert a blank item as the first option?"
1080
  msgstr ""
1081
 
1087
  msgid "Label"
1088
  msgstr ""
1089
 
1090
+ #: contact-form-7/modules/text.php:155
1091
  msgid "Email address that the sender entered is invalid"
1092
  msgstr ""
1093
 
1094
+ #: contact-form-7/modules/text.php:156
1095
  msgid "Email address seems invalid."
1096
  msgstr ""
1097
 
1098
+ #: contact-form-7/modules/text.php:160
1099
  msgid "URL that the sender entered is invalid"
1100
  msgstr ""
1101
 
1102
+ #: contact-form-7/modules/text.php:161
1103
  msgid "URL seems invalid."
1104
  msgstr ""
1105
 
1106
+ #: contact-form-7/modules/text.php:165
1107
  msgid "Telephone number that the sender entered is invalid"
1108
  msgstr ""
1109
 
1110
+ #: contact-form-7/modules/text.php:166
1111
  msgid "Telephone number seems invalid."
1112
  msgstr ""
1113
 
1114
+ #: contact-form-7/modules/text.php:179
1115
  msgid "Text field"
1116
  msgstr ""
1117
 
1118
+ #: contact-form-7/modules/text.php:182
1119
  msgid "Email"
1120
  msgstr ""
1121
 
1122
+ #: contact-form-7/modules/text.php:185
1123
  msgid "URL"
1124
  msgstr ""
1125
 
1126
+ #: contact-form-7/modules/text.php:188
1127
  msgid "Telephone number"
1128
  msgstr ""
1129
 
1130
+ #: contact-form-7/modules/text.php:239
1131
  msgid "Akismet"
1132
  msgstr ""
1133
 
1134
+ #: contact-form-7/modules/text.php:241
1135
  msgid "This field requires author's name"
1136
  msgstr ""
1137
 
1138
+ #: contact-form-7/modules/text.php:243
1139
  msgid "This field requires author's email address"
1140
  msgstr ""
1141
 
1142
+ #: contact-form-7/modules/text.php:245
1143
  msgid "This field requires author's URL"
1144
  msgstr ""
1145
 
1146
+ #: contact-form-7/modules/textarea.php:106
1147
  msgid "Text area"
1148
  msgstr ""
modules/acceptance.php CHANGED
@@ -138,7 +138,7 @@ function wpcf7_add_tag_generator_acceptance() {
138
  'wpcf7-tg-pane-acceptance', 'wpcf7_tg_pane_acceptance' );
139
  }
140
 
141
- function wpcf7_tg_pane_acceptance( &$contact_form ) {
142
  ?>
143
  <div id="wpcf7-tg-pane-acceptance" class="hidden">
144
  <form action="">
138
  'wpcf7-tg-pane-acceptance', 'wpcf7_tg_pane_acceptance' );
139
  }
140
 
141
+ function wpcf7_tg_pane_acceptance( $contact_form ) {
142
  ?>
143
  <div id="wpcf7-tg-pane-acceptance" class="hidden">
144
  <form action="">
modules/akismet.php CHANGED
@@ -131,11 +131,13 @@ function wpcf7_akismet_comment_check( $comment ) {
131
  '/1.1/comment-check', $akismet_api_port );
132
  }
133
 
134
- if ( 'true' == $response[1] )
135
  $spam = true;
 
136
 
137
- if ( $contact_form = wpcf7_get_current_contact_form() )
138
- $contact_form->akismet = array( 'comment' => $comment, 'spam' => $spam );
 
139
 
140
  return apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment );
141
  }
131
  '/1.1/comment-check', $akismet_api_port );
132
  }
133
 
134
+ if ( 'true' == $response[1] ) {
135
  $spam = true;
136
+ }
137
 
138
+ if ( $submission = WPCF7_Submission::get_instance() ) {
139
+ $submission->akismet = array( 'comment' => $comment, 'spam' => $spam );
140
+ }
141
 
142
  return apply_filters( 'wpcf7_akismet_comment_check', $spam, $comment );
143
  }
modules/captcha.php CHANGED
@@ -197,7 +197,7 @@ function wpcf7_add_tag_generator_captcha() {
197
  'wpcf7-tg-pane-captcha', 'wpcf7_tg_pane_captcha' );
198
  }
199
 
200
- function wpcf7_tg_pane_captcha( &$contact_form ) {
201
  ?>
202
  <div id="wpcf7-tg-pane-captcha" class="hidden">
203
  <form action="">
197
  'wpcf7-tg-pane-captcha', 'wpcf7_tg_pane_captcha' );
198
  }
199
 
200
+ function wpcf7_tg_pane_captcha( $contact_form ) {
201
  ?>
202
  <div id="wpcf7-tg-pane-captcha" class="hidden">
203
  <form action="">
modules/checkbox.php CHANGED
@@ -54,13 +54,6 @@ function wpcf7_checkbox_shortcode_handler( $tag ) {
54
  if ( $matches = $tag->get_first_match_option( '/^default:([0-9_]+)$/' ) )
55
  $defaults = explode( '_', $matches[1] );
56
 
57
- if ( isset( $_POST[$tag->name] ) )
58
- $post = $_POST[$tag->name];
59
- else
60
- $post = $multiple ? array() : '';
61
-
62
- $is_posted = wpcf7_is_posted();
63
-
64
  $html = '';
65
  $count = 0;
66
 
@@ -83,19 +76,21 @@ function wpcf7_checkbox_shortcode_handler( $tag ) {
83
  }
84
  }
85
 
 
 
86
  foreach ( $values as $key => $value ) {
87
  $class = 'wpcf7-list-item';
88
 
89
  $checked = false;
90
 
91
- if ( $is_posted && ! empty( $post ) ) {
92
- if ( $multiple && in_array( esc_sql( $value ), (array) $post ) )
93
- $checked = true;
94
- if ( ! $multiple && $post == esc_sql( $value ) )
95
- $checked = true;
 
96
  } else {
97
- if ( in_array( $key + 1, (array) $defaults ) )
98
- $checked = true;
99
  }
100
 
101
  if ( isset( $labels[$key] ) )
@@ -270,11 +265,11 @@ function wpcf7_add_tag_generator_checkbox_and_radio() {
270
  'wpcf7-tg-pane-radio', 'wpcf7_tg_pane_radio' );
271
  }
272
 
273
- function wpcf7_tg_pane_checkbox( &$contact_form ) {
274
  wpcf7_tg_pane_checkbox_and_radio( 'checkbox' );
275
  }
276
 
277
- function wpcf7_tg_pane_radio( &$contact_form ) {
278
  wpcf7_tg_pane_checkbox_and_radio( 'radio' );
279
  }
280
 
54
  if ( $matches = $tag->get_first_match_option( '/^default:([0-9_]+)$/' ) )
55
  $defaults = explode( '_', $matches[1] );
56
 
 
 
 
 
 
 
 
57
  $html = '';
58
  $count = 0;
59
 
76
  }
77
  }
78
 
79
+ $hangover = wpcf7_get_hangover( $tag->name, $multiple ? array() : '' );
80
+
81
  foreach ( $values as $key => $value ) {
82
  $class = 'wpcf7-list-item';
83
 
84
  $checked = false;
85
 
86
+ if ( $hangover ) {
87
+ if ( $multiple ) {
88
+ $checked = in_array( esc_sql( $value ), (array) $hangover );
89
+ } else {
90
+ $checked = ( $hangover == esc_sql( $value ) );
91
+ }
92
  } else {
93
+ $checked = in_array( $key + 1, (array) $defaults );
 
94
  }
95
 
96
  if ( isset( $labels[$key] ) )
265
  'wpcf7-tg-pane-radio', 'wpcf7_tg_pane_radio' );
266
  }
267
 
268
+ function wpcf7_tg_pane_checkbox( $contact_form ) {
269
  wpcf7_tg_pane_checkbox_and_radio( 'checkbox' );
270
  }
271
 
272
+ function wpcf7_tg_pane_radio( $contact_form ) {
273
  wpcf7_tg_pane_checkbox_and_radio( 'radio' );
274
  }
275
 
modules/date.php CHANGED
@@ -52,8 +52,7 @@ function wpcf7_date_shortcode_handler( $tag ) {
52
  $value = '';
53
  }
54
 
55
- if ( wpcf7_is_posted() && isset( $_POST[$tag->name] ) )
56
- $value = wp_unslash( $_POST[$tag->name] );
57
 
58
  $atts['value'] = $value;
59
 
@@ -149,7 +148,7 @@ function wpcf7_add_tag_generator_date() {
149
  'wpcf7-tg-pane-date', 'wpcf7_tg_pane_date' );
150
  }
151
 
152
- function wpcf7_tg_pane_date( &$contact_form ) {
153
  wpcf7_tg_pane_date_and_relatives( 'date' );
154
  }
155
 
52
  $value = '';
53
  }
54
 
55
+ $value = wpcf7_get_hangover( $tag->name, $value );
 
56
 
57
  $atts['value'] = $value;
58
 
148
  'wpcf7-tg-pane-date', 'wpcf7_tg_pane_date' );
149
  }
150
 
151
+ function wpcf7_tg_pane_date( $contact_form ) {
152
  wpcf7_tg_pane_date_and_relatives( 'date' );
153
  }
154
 
modules/file.php CHANGED
@@ -58,8 +58,9 @@ add_filter( 'wpcf7_form_enctype', 'wpcf7_file_form_enctype_filter' );
58
  function wpcf7_file_form_enctype_filter( $enctype ) {
59
  $multipart = (bool) wpcf7_scan_shortcode( array( 'type' => array( 'file', 'file*' ) ) );
60
 
61
- if ( $multipart )
62
- $enctype = ' enctype="multipart/form-data"';
 
63
 
64
  return $enctype;
65
  }
@@ -181,11 +182,8 @@ function wpcf7_file_validation_filter( $result, $tag ) {
181
  // Make sure the uploaded file is only readable for the owner process
182
  @chmod( $new_file, 0400 );
183
 
184
- if ( $contact_form = wpcf7_get_current_contact_form() ) {
185
- $contact_form->uploaded_files[$name] = $new_file;
186
-
187
- if ( empty( $contact_form->posted_data[$name] ) )
188
- $contact_form->posted_data[$name] = $filename;
189
  }
190
 
191
  return $result;
@@ -233,7 +231,7 @@ function wpcf7_add_tag_generator_file() {
233
  'wpcf7-tg-pane-file', 'wpcf7_tg_pane_file' );
234
  }
235
 
236
- function wpcf7_tg_pane_file( &$contact_form ) {
237
  ?>
238
  <div id="wpcf7-tg-pane-file" class="hidden">
239
  <form action="">
@@ -319,30 +317,37 @@ function wpcf7_upload_tmp_dir() {
319
  return wpcf7_upload_dir( 'dir' ) . '/wpcf7_uploads';
320
  }
321
 
 
 
322
  function wpcf7_cleanup_upload_files() {
 
 
 
 
 
323
  $dir = trailingslashit( wpcf7_upload_tmp_dir() );
324
 
325
- if ( ! is_dir( $dir ) )
326
- return false;
327
- if ( ! is_readable( $dir ) )
328
- return false;
329
- if ( ! wp_is_writable( $dir ) )
330
- return false;
331
 
332
  if ( $handle = @opendir( $dir ) ) {
333
  while ( false !== ( $file = readdir( $handle ) ) ) {
334
- if ( $file == "." || $file == ".." || $file == ".htaccess" )
335
  continue;
 
 
 
336
 
337
- $stat = stat( $dir . $file );
338
- if ( $stat['mtime'] + 60 < time() ) // 60 secs
339
- @unlink( $dir . $file );
 
 
340
  }
 
341
  closedir( $handle );
342
  }
343
  }
344
 
345
- if ( ! is_admin() && 'GET' == $_SERVER['REQUEST_METHOD'] )
346
- wpcf7_cleanup_upload_files();
347
-
348
  ?>
58
  function wpcf7_file_form_enctype_filter( $enctype ) {
59
  $multipart = (bool) wpcf7_scan_shortcode( array( 'type' => array( 'file', 'file*' ) ) );
60
 
61
+ if ( $multipart ) {
62
+ $enctype = 'multipart/form-data';
63
+ }
64
 
65
  return $enctype;
66
  }
182
  // Make sure the uploaded file is only readable for the owner process
183
  @chmod( $new_file, 0400 );
184
 
185
+ if ( $submission = WPCF7_Submission::get_instance() ) {
186
+ $submission->add_uploaded_file( $name, $new_file );
 
 
 
187
  }
188
 
189
  return $result;
231
  'wpcf7-tg-pane-file', 'wpcf7_tg_pane_file' );
232
  }
233
 
234
+ function wpcf7_tg_pane_file( $contact_form ) {
235
  ?>
236
  <div id="wpcf7-tg-pane-file" class="hidden">
237
  <form action="">
317
  return wpcf7_upload_dir( 'dir' ) . '/wpcf7_uploads';
318
  }
319
 
320
+ add_action( 'template_redirect', 'wpcf7_cleanup_upload_files' );
321
+
322
  function wpcf7_cleanup_upload_files() {
323
+ if ( is_admin() || 'GET' != $_SERVER['REQUEST_METHOD']
324
+ || is_robots() || is_feed() || is_trackback() ) {
325
+ return;
326
+ }
327
+
328
  $dir = trailingslashit( wpcf7_upload_tmp_dir() );
329
 
330
+ if ( ! is_dir( $dir ) || ! is_readable( $dir ) || ! wp_is_writable( $dir ) ) {
331
+ return;
332
+ }
 
 
 
333
 
334
  if ( $handle = @opendir( $dir ) ) {
335
  while ( false !== ( $file = readdir( $handle ) ) ) {
336
+ if ( $file == "." || $file == ".." || $file == ".htaccess" ) {
337
  continue;
338
+ }
339
+
340
+ $mtime = @filemtime( $dir . $file );
341
 
342
+ if ( $mtime && time() < $mtime + 60 ) { // less than 60 secs old
343
+ continue;
344
+ }
345
+
346
+ @unlink( $dir . $file );
347
  }
348
+
349
  closedir( $handle );
350
  }
351
  }
352
 
 
 
 
353
  ?>
modules/flamingo.php CHANGED
@@ -20,7 +20,9 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
20
  return;
21
  }
22
 
23
- if ( empty( $contactform->posted_data ) ) {
 
 
24
  return;
25
  }
26
 
@@ -29,14 +31,14 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
29
 
30
  $exclude_names = array();
31
 
32
- foreach ( $fields_senseless as $tag )
33
  $exclude_names[] = $tag['name'];
34
-
35
- $posted_data = $contactform->posted_data;
36
 
37
  foreach ( $posted_data as $key => $value ) {
38
- if ( '_' == substr( $key, 0, 1 ) || in_array( $key, $exclude_names ) )
39
  unset( $posted_data[$key] );
 
40
  }
41
 
42
  $email = wpcf7_flamingo_get_value( 'email', $contactform );
@@ -45,20 +47,23 @@ function wpcf7_flamingo_submit( $contactform, $result ) {
45
 
46
  $meta = array();
47
 
48
- $special_mail_tags = array( 'remote_ip', 'user_agent', 'url', 'date', 'time',
49
- 'post_id', 'post_name', 'post_title', 'post_url', 'post_author', 'post_author_email' );
 
50
 
51
- foreach ( $special_mail_tags as $smt )
52
- $meta[$smt] = apply_filters( 'wpcf7_special_mail_tags', '', '_' . $smt, false );
 
 
53
 
54
- $akismet = isset( $contactform->akismet ) ? (array) $contactform->akismet : null;
55
 
56
  Flamingo_Contact::add( array(
57
  'email' => $email,
58
  'name' => $name ) );
59
 
60
  $channel_id = wpcf7_flamingo_add_channel(
61
- $contactform->name, $contactform->title );
62
 
63
  if ( $channel_id ) {
64
  $channel = get_term( $channel_id,
@@ -103,7 +108,7 @@ function wpcf7_flamingo_get_value( $field, $contactform ) {
103
  $template = trim( wpcf7_strip_quote( $templates[0] ) );
104
  }
105
 
106
- $value = $contactform->replace_mail_tags( $template );
107
  }
108
 
109
  $value = apply_filters( 'wpcf7_flamingo_get_value', $value,
20
  return;
21
  }
22
 
23
+ $submission = WPCF7_Submission::get_instance();
24
+
25
+ if ( ! $submission || ! $posted_data = $submission->get_posted_data() ) {
26
  return;
27
  }
28
 
31
 
32
  $exclude_names = array();
33
 
34
+ foreach ( $fields_senseless as $tag ) {
35
  $exclude_names[] = $tag['name'];
36
+ }
 
37
 
38
  foreach ( $posted_data as $key => $value ) {
39
+ if ( '_' == substr( $key, 0, 1 ) || in_array( $key, $exclude_names ) ) {
40
  unset( $posted_data[$key] );
41
+ }
42
  }
43
 
44
  $email = wpcf7_flamingo_get_value( 'email', $contactform );
47
 
48
  $meta = array();
49
 
50
+ $special_mail_tags = array( 'remote_ip', 'user_agent', 'url',
51
+ 'date', 'time', 'post_id', 'post_name', 'post_title', 'post_url',
52
+ 'post_author', 'post_author_email' );
53
 
54
+ foreach ( $special_mail_tags as $smt ) {
55
+ $meta[$smt] = apply_filters( 'wpcf7_special_mail_tags',
56
+ '', '_' . $smt, false );
57
+ }
58
 
59
+ $akismet = isset( $submission->akismet ) ? (array) $submission->akismet : null;
60
 
61
  Flamingo_Contact::add( array(
62
  'email' => $email,
63
  'name' => $name ) );
64
 
65
  $channel_id = wpcf7_flamingo_add_channel(
66
+ $contactform->name(), $contactform->title() );
67
 
68
  if ( $channel_id ) {
69
  $channel = get_term( $channel_id,
108
  $template = trim( wpcf7_strip_quote( $templates[0] ) );
109
  }
110
 
111
+ $value = wpcf7_mail_replace_tags( $template );
112
  }
113
 
114
  $value = apply_filters( 'wpcf7_flamingo_get_value', $value,
modules/number.php CHANGED
@@ -53,8 +53,7 @@ function wpcf7_number_shortcode_handler( $tag ) {
53
  $value = '';
54
  }
55
 
56
- if ( wpcf7_is_posted() && isset( $_POST[$tag->name] ) )
57
- $value = wp_unslash( $_POST[$tag->name] );
58
 
59
  $atts['value'] = $value;
60
 
@@ -155,11 +154,11 @@ function wpcf7_add_tag_generator_number() {
155
  'wpcf7-tg-pane-range', 'wpcf7_tg_pane_range' );
156
  }
157
 
158
- function wpcf7_tg_pane_number( &$contact_form ) {
159
  wpcf7_tg_pane_number_and_relatives( 'number' );
160
  }
161
 
162
- function wpcf7_tg_pane_range( &$contact_form ) {
163
  wpcf7_tg_pane_number_and_relatives( 'range' );
164
  }
165
 
53
  $value = '';
54
  }
55
 
56
+ $value = wpcf7_get_hangover( $tag->name, $value );
 
57
 
58
  $atts['value'] = $value;
59
 
154
  'wpcf7-tg-pane-range', 'wpcf7_tg_pane_range' );
155
  }
156
 
157
+ function wpcf7_tg_pane_number( $contact_form ) {
158
  wpcf7_tg_pane_number_and_relatives( 'number' );
159
  }
160
 
161
+ function wpcf7_tg_pane_range( $contact_form ) {
162
  wpcf7_tg_pane_number_and_relatives( 'range' );
163
  }
164
 
modules/quiz.php CHANGED
@@ -163,7 +163,7 @@ function wpcf7_add_tag_generator_quiz() {
163
  'wpcf7-tg-pane-quiz', 'wpcf7_tg_pane_quiz' );
164
  }
165
 
166
- function wpcf7_tg_pane_quiz( &$contact_form ) {
167
  ?>
168
  <div id="wpcf7-tg-pane-quiz" class="hidden">
169
  <form action="">
163
  'wpcf7-tg-pane-quiz', 'wpcf7_tg_pane_quiz' );
164
  }
165
 
166
+ function wpcf7_tg_pane_quiz( $contact_form ) {
167
  ?>
168
  <div id="wpcf7-tg-pane-quiz" class="hidden">
169
  <form action="">
modules/response.php CHANGED
@@ -9,7 +9,6 @@ wpcf7_add_shortcode( 'response', 'wpcf7_response_shortcode_handler' );
9
 
10
  function wpcf7_response_shortcode_handler( $tag ) {
11
  if ( $contact_form = wpcf7_get_current_contact_form() ) {
12
- $contact_form->responses_count += 1;
13
  return $contact_form->form_response_output();
14
  }
15
  }
9
 
10
  function wpcf7_response_shortcode_handler( $tag ) {
11
  if ( $contact_form = wpcf7_get_current_contact_form() ) {
 
12
  return $contact_form->form_response_output();
13
  }
14
  }
modules/select.php CHANGED
@@ -45,7 +45,6 @@ function wpcf7_select_shortcode_handler( $tag ) {
45
  $include_blank = $tag->has_option( 'include_blank' );
46
  $first_as_label = $tag->has_option( 'first_as_label' );
47
 
48
- $name = $tag->name;
49
  $values = $tag->values;
50
  $labels = $tag->labels;
51
 
@@ -64,20 +63,21 @@ function wpcf7_select_shortcode_handler( $tag ) {
64
  }
65
 
66
  $html = '';
67
-
68
- $posted = wpcf7_is_posted();
69
 
70
  foreach ( $values as $key => $value ) {
71
  $selected = false;
72
 
73
- if ( $posted && ! empty( $_POST[$name] ) ) {
74
- if ( $multiple && in_array( esc_sql( $value ), (array) $_POST[$name] ) )
75
- $selected = true;
76
- if ( ! $multiple && $_POST[$name] == esc_sql( $value ) )
77
- $selected = true;
 
78
  } else {
79
- if ( ! $empty_select && in_array( $key + 1, (array) $defaults ) )
80
  $selected = true;
 
81
  }
82
 
83
  $item_atts = array(
@@ -152,7 +152,7 @@ function wpcf7_add_tag_generator_menu() {
152
  'wpcf7-tg-pane-menu', 'wpcf7_tg_pane_menu' );
153
  }
154
 
155
- function wpcf7_tg_pane_menu( &$contact_form ) {
156
  ?>
157
  <div id="wpcf7-tg-pane-menu" class="hidden">
158
  <form action="">
45
  $include_blank = $tag->has_option( 'include_blank' );
46
  $first_as_label = $tag->has_option( 'first_as_label' );
47
 
 
48
  $values = $tag->values;
49
  $labels = $tag->labels;
50
 
63
  }
64
 
65
  $html = '';
66
+ $hangover = wpcf7_get_hangover( $tag->name );
 
67
 
68
  foreach ( $values as $key => $value ) {
69
  $selected = false;
70
 
71
+ if ( $hangover ) {
72
+ if ( $multiple ) {
73
+ $selected = in_array( esc_sql( $value ), (array) $hangover );
74
+ } else {
75
+ $selected = ( $hangover == esc_sql( $value ) );
76
+ }
77
  } else {
78
+ if ( ! $empty_select && in_array( $key + 1, (array) $defaults ) ) {
79
  $selected = true;
80
+ }
81
  }
82
 
83
  $item_atts = array(
152
  'wpcf7-tg-pane-menu', 'wpcf7_tg_pane_menu' );
153
  }
154
 
155
+ function wpcf7_tg_pane_menu( $contact_form ) {
156
  ?>
157
  <div id="wpcf7-tg-pane-menu" class="hidden">
158
  <form action="">
modules/special-mail-tags.php DELETED
@@ -1,80 +0,0 @@
1
- <?php
2
- /**
3
- ** Filters for Special Mail Tags
4
- **/
5
-
6
- add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag', 10, 3 );
7
-
8
- function wpcf7_special_mail_tag( $output, $name, $html ) {
9
-
10
- // For backwards compat.
11
- $name = preg_replace( '/^wpcf7\./', '_', $name );
12
-
13
- if ( '_remote_ip' == $name )
14
- $output = preg_replace( '/[^0-9a-f.:, ]/', '', $_SERVER['REMOTE_ADDR'] );
15
-
16
- elseif ( '_user_agent' == $name ) {
17
- $output = substr( $_SERVER['HTTP_USER_AGENT'], 0, 254 );
18
-
19
- if ( $html )
20
- $output = esc_html( $output );
21
- }
22
-
23
- elseif ( '_url' == $name ) {
24
- $url = untrailingslashit( home_url() );
25
- $url = preg_replace( '%(?<!:|/)/.*$%', '', $url );
26
- $url .= wpcf7_get_request_uri();
27
- $output = esc_url( $url );
28
- }
29
-
30
- elseif ( '_date' == $name )
31
- $output = date_i18n( get_option( 'date_format' ) );
32
-
33
- elseif ( '_time' == $name )
34
- $output = date_i18n( get_option( 'time_format' ) );
35
-
36
- return $output;
37
- }
38
-
39
- add_filter( 'wpcf7_special_mail_tags', 'wpcf7_special_mail_tag_for_post_data', 10, 2 );
40
-
41
- function wpcf7_special_mail_tag_for_post_data( $output, $name ) {
42
-
43
- if ( ! isset( $_POST['_wpcf7_unit_tag'] ) || empty( $_POST['_wpcf7_unit_tag'] ) )
44
- return $output;
45
-
46
- if ( ! preg_match( '/^wpcf7-f(\d+)-p(\d+)-o(\d+)$/', $_POST['_wpcf7_unit_tag'], $matches ) )
47
- return $output;
48
-
49
- $post_id = (int) $matches[2];
50
-
51
- if ( ! $post = get_post( $post_id ) )
52
- return $output;
53
-
54
- $user = new WP_User( $post->post_author );
55
-
56
- // For backwards compat.
57
- $name = preg_replace( '/^wpcf7\./', '_', $name );
58
-
59
- if ( '_post_id' == $name )
60
- $output = (string) $post->ID;
61
-
62
- elseif ( '_post_name' == $name )
63
- $output = $post->post_name;
64
-
65
- elseif ( '_post_title' == $name )
66
- $output = $post->post_title;
67
-
68
- elseif ( '_post_url' == $name )
69
- $output = get_permalink( $post->ID );
70
-
71
- elseif ( '_post_author' == $name )
72
- $output = $user->display_name;
73
-
74
- elseif ( '_post_author_email' == $name )
75
- $output = $user->user_email;
76
-
77
- return $output;
78
- }
79
-
80
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
modules/submit.php CHANGED
@@ -50,7 +50,7 @@ function wpcf7_add_tag_generator_submit() {
50
  'wpcf7-tg-pane-submit', 'wpcf7_tg_pane_submit', array( 'nameless' => 1 ) );
51
  }
52
 
53
- function wpcf7_tg_pane_submit( &$contact_form ) {
54
  ?>
55
  <div id="wpcf7-tg-pane-submit" class="hidden">
56
  <form action="">
50
  'wpcf7-tg-pane-submit', 'wpcf7_tg_pane_submit', array( 'nameless' => 1 ) );
51
  }
52
 
53
+ function wpcf7_tg_pane_submit( $contact_form ) {
54
  ?>
55
  <div id="wpcf7-tg-pane-submit" class="hidden">
56
  <form action="">
modules/text.php CHANGED
@@ -58,8 +58,7 @@ function wpcf7_text_shortcode_handler( $tag ) {
58
  $value = $tag->get_default_option();
59
  }
60
 
61
- if ( wpcf7_is_posted() && isset( $_POST[$tag->name] ) )
62
- $value = wp_unslash( $_POST[$tag->name] );
63
 
64
  $atts['value'] = $value;
65
 
@@ -190,19 +189,19 @@ function wpcf7_add_tag_generator_text() {
190
  'wpcf7-tg-pane-tel', 'wpcf7_tg_pane_tel' );
191
  }
192
 
193
- function wpcf7_tg_pane_text( &$contact_form ) {
194
  wpcf7_tg_pane_text_and_relatives( 'text' );
195
  }
196
 
197
- function wpcf7_tg_pane_email( &$contact_form ) {
198
  wpcf7_tg_pane_text_and_relatives( 'email' );
199
  }
200
 
201
- function wpcf7_tg_pane_url( &$contact_form ) {
202
  wpcf7_tg_pane_text_and_relatives( 'url' );
203
  }
204
 
205
- function wpcf7_tg_pane_tel( &$contact_form ) {
206
  wpcf7_tg_pane_text_and_relatives( 'tel' );
207
  }
208
 
58
  $value = $tag->get_default_option();
59
  }
60
 
61
+ $value = wpcf7_get_hangover( $tag->name, $value );
 
62
 
63
  $atts['value'] = $value;
64
 
189
  'wpcf7-tg-pane-tel', 'wpcf7_tg_pane_tel' );
190
  }
191
 
192
+ function wpcf7_tg_pane_text( $contact_form ) {
193
  wpcf7_tg_pane_text_and_relatives( 'text' );
194
  }
195
 
196
+ function wpcf7_tg_pane_email( $contact_form ) {
197
  wpcf7_tg_pane_text_and_relatives( 'email' );
198
  }
199
 
200
+ function wpcf7_tg_pane_url( $contact_form ) {
201
  wpcf7_tg_pane_text_and_relatives( 'url' );
202
  }
203
 
204
+ function wpcf7_tg_pane_tel( $contact_form ) {
205
  wpcf7_tg_pane_text_and_relatives( 'tel' );
206
  }
207
 
modules/textarea.php CHANGED
@@ -52,8 +52,7 @@ function wpcf7_textarea_shortcode_handler( $tag ) {
52
  $value = '';
53
  }
54
 
55
- if ( wpcf7_is_posted() && isset( $_POST[$tag->name] ) )
56
- $value = wp_unslash( $_POST[$tag->name] );
57
 
58
  $atts['name'] = $tag->name;
59
 
@@ -108,7 +107,7 @@ function wpcf7_add_tag_generator_textarea() {
108
  'wpcf7-tg-pane-textarea', 'wpcf7_tg_pane_textarea' );
109
  }
110
 
111
- function wpcf7_tg_pane_textarea( &$contact_form ) {
112
  ?>
113
  <div id="wpcf7-tg-pane-textarea" class="hidden">
114
  <form action="">
52
  $value = '';
53
  }
54
 
55
+ $value = wpcf7_get_hangover( $tag->name, $value );
 
56
 
57
  $atts['name'] = $tag->name;
58
 
107
  'wpcf7-tg-pane-textarea', 'wpcf7_tg_pane_textarea' );
108
  }
109
 
110
+ function wpcf7_tg_pane_textarea( $contact_form ) {
111
  ?>
112
  <div id="wpcf7-tg-pane-textarea" class="hidden">
113
  <form action="">
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: takayukister
3
  Donate link: http://contactform7.com/donate/
4
  Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
- Requires at least: 3.7
6
  Tested up to: 3.9.1
7
  Stable tag: 3.8.1
8
  License: GPLv2 or later
@@ -124,6 +124,15 @@ Do you have questions or issues with Contact Form 7? Use these support channels
124
 
125
  For more information, see [Releases](http://contactform7.com/category/releases/).
126
 
 
 
 
 
 
 
 
 
 
127
  = 3.8.1 =
128
 
129
  * Fix: misuse of functions that Akismet 3.0 has marked deprecated.
@@ -138,25 +147,3 @@ For more information, see [Releases](http://contactform7.com/category/releases/)
138
  * Added html_name attribute support in [contact-form-7] shortcodes.
139
  * WordPress 3.7 or higher is required.
140
  * Translation for Ukrainian has been updated.
141
-
142
- = 3.7.2 =
143
-
144
- * Fixed a bug that allowed to avoid CAPTCHA validation.
145
- * The jQuery Form Plugin (jquery.form.js) has been updated to 3.50.0.
146
- * Translation for Dutch has been updated.
147
-
148
- = 3.7.1 =
149
-
150
- * The jQuery Form Plugin (jquery.form.js) has been updated to 3.49.0.
151
- * Fixed a bug of auto-p formatting around [response].
152
- * Translations for Russian, Korean, Hungarian, and German have been updated.
153
-
154
- = 3.7 =
155
-
156
- * Support free_text option that allows checkbox/radio to have an additional free text field.
157
- * Restore floating-tip style validation error as an option.
158
- * Support html_id and html_class attributes in [contact-form-7] shortcode.
159
- * Fixed bug that Flamingo stored submissions in demo-mode.
160
- * Fixed bug where auto-p function wrapped [response] with p.
161
- * The jQuery Form Plugin (jquery.form.js) has been updated to 3.48.0.
162
- * Translation for Haitian has been created. Translations for German, Hungarian, Czech, Turkish, Lithuanian, French, Basque, and Brazilian Portuguese have been updated.
2
  Contributors: takayukister
3
  Donate link: http://contactform7.com/donate/
4
  Tags: contact, form, contact form, feedback, email, ajax, captcha, akismet, multilingual
5
+ Requires at least: 3.8
6
  Tested up to: 3.9.1
7
  Stable tag: 3.8.1
8
  License: GPLv2 or later
124
 
125
  For more information, see [Releases](http://contactform7.com/category/releases/).
126
 
127
+ = 3.9 =
128
+
129
+ * A major change has been made to the internal structure of the WPCF7_ContactForm class. For details, see [Contact Form 7 3.9 Beta](http://contactform7.com/2014/07/02/contact-form-7-39-beta/).
130
+ * The exclude_blank mail option has been introduced.
131
+ * The wpcf7_load_js and wpcf7_load_css (functions and filter hooks) have been introduced.
132
+ * The jQuery Form Plugin (jquery.form.js) has been updated to 3.51.0.
133
+ * Translation for Persian has been updated.
134
+ * WordPress 3.8 or higher is required.
135
+
136
  = 3.8.1 =
137
 
138
  * Fix: misuse of functions that Akismet 3.0 has marked deprecated.
147
  * Added html_name attribute support in [contact-form-7] shortcodes.
148
  * WordPress 3.7 or higher is required.
149
  * Translation for Ukrainian has been updated.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
settings.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
 
3
  require_once WPCF7_PLUGIN_DIR . '/includes/functions.php';
4
- require_once WPCF7_PLUGIN_DIR . '/includes/deprecated.php';
5
  require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
6
  require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
7
  require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
8
  require_once WPCF7_PLUGIN_DIR . '/includes/capabilities.php';
9
- require_once WPCF7_PLUGIN_DIR . '/includes/classes.php';
 
 
10
  require_once WPCF7_PLUGIN_DIR . '/includes/upgrade.php';
11
 
12
  if ( is_admin() )
@@ -66,8 +67,8 @@ function wpcf7_install() {
66
  if ( get_posts( array( 'post_type' => 'wpcf7_contact_form' ) ) )
67
  return;
68
 
69
- $contact_form = wpcf7_get_contact_form_default_pack(
70
- array( 'title' => sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ) ) );
71
 
72
  $contact_form->save();
73
  }
1
  <?php
2
 
3
  require_once WPCF7_PLUGIN_DIR . '/includes/functions.php';
 
4
  require_once WPCF7_PLUGIN_DIR . '/includes/formatting.php';
5
  require_once WPCF7_PLUGIN_DIR . '/includes/pipe.php';
6
  require_once WPCF7_PLUGIN_DIR . '/includes/shortcodes.php';
7
  require_once WPCF7_PLUGIN_DIR . '/includes/capabilities.php';
8
+ require_once WPCF7_PLUGIN_DIR . '/includes/contact-form.php';
9
+ require_once WPCF7_PLUGIN_DIR . '/includes/mail.php';
10
+ require_once WPCF7_PLUGIN_DIR . '/includes/submission.php';
11
  require_once WPCF7_PLUGIN_DIR . '/includes/upgrade.php';
12
 
13
  if ( is_admin() )
67
  if ( get_posts( array( 'post_type' => 'wpcf7_contact_form' ) ) )
68
  return;
69
 
70
+ $contact_form = WPCF7_ContactForm::get_template( array(
71
+ 'title' => sprintf( __( 'Contact form %d', 'contact-form-7' ), 1 ) ) );
72
 
73
  $contact_form->save();
74
  }
wp-contact-form-7.php CHANGED
@@ -7,7 +7,7 @@ Author: Takayuki Miyoshi
7
  Author URI: http://ideasilo.wordpress.com/
8
  Text Domain: contact-form-7
9
  Domain Path: /languages/
10
- Version: 3.8.1
11
  */
12
 
13
  /* Copyright 2007-2014 Takayuki Miyoshi (email: takayukister at gmail.com)
@@ -27,24 +27,19 @@ Version: 3.8.1
27
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
  */
29
 
30
- define( 'WPCF7_VERSION', '3.8.1' );
31
 
32
- define( 'WPCF7_REQUIRED_WP_VERSION', '3.7' );
33
 
34
- if ( ! defined( 'WPCF7_PLUGIN_BASENAME' ) )
35
- define( 'WPCF7_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
36
 
37
- if ( ! defined( 'WPCF7_PLUGIN_NAME' ) )
38
- define( 'WPCF7_PLUGIN_NAME', trim( dirname( WPCF7_PLUGIN_BASENAME ), '/' ) );
39
 
40
- if ( ! defined( 'WPCF7_PLUGIN_DIR' ) )
41
- define( 'WPCF7_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
42
 
43
- if ( ! defined( 'WPCF7_PLUGIN_URL' ) )
44
- define( 'WPCF7_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
45
 
46
- if ( ! defined( 'WPCF7_PLUGIN_MODULES_DIR' ) )
47
- define( 'WPCF7_PLUGIN_MODULES_DIR', WPCF7_PLUGIN_DIR . '/modules' );
48
 
49
  if ( ! defined( 'WPCF7_LOAD_JS' ) )
50
  define( 'WPCF7_LOAD_JS', true );
7
  Author URI: http://ideasilo.wordpress.com/
8
  Text Domain: contact-form-7
9
  Domain Path: /languages/
10
+ Version: 3.9-beta
11
  */
12
 
13
  /* Copyright 2007-2014 Takayuki Miyoshi (email: takayukister at gmail.com)
27
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
  */
29
 
30
+ define( 'WPCF7_VERSION', '3.9-beta' );
31
 
32
+ define( 'WPCF7_REQUIRED_WP_VERSION', '3.8' );
33
 
34
+ define( 'WPCF7_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
 
35
 
36
+ define( 'WPCF7_PLUGIN_NAME', trim( dirname( WPCF7_PLUGIN_BASENAME ), '/' ) );
 
37
 
38
+ define( 'WPCF7_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) );
 
39
 
40
+ define( 'WPCF7_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) );
 
41
 
42
+ define( 'WPCF7_PLUGIN_MODULES_DIR', WPCF7_PLUGIN_DIR . '/modules' );
 
43
 
44
  if ( ! defined( 'WPCF7_LOAD_JS' ) )
45
  define( 'WPCF7_LOAD_JS', true );