Contact Form 7 - Version 3.2

Version Description

  • Enhanced admin panel. Introduced list table view for contact forms.
  • Moved the Contact menu to the upper position (just below the Comments).
  • Show alert message when Jetpack contact form is active.
  • Introduced Flamingo module.
  • Made capabilities more customizable.
  • wpcf7_admin_url() is deprecated. Use admin_url() or menu_page_url() instead.
  • Changed the default defined value of constants WPCF7_PLUGIN_DIR and WPCF7_PLUGIN_URL.
  • The jQuery Form Plugin (jquery.form.js) has been updated to 3.09 and compressed with YUI compressor.
  • Translations for Latvian, Swedish, and Czech have been updated.

=

Download this release

Release Info

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

Code changes from version 3.1.2 to 3.2

admin/admin-functions.php ADDED
@@ -0,0 +1,52 @@
1
+ <?php
2
+
3
+ function wpcf7_current_action() {
4
+ if ( isset( $_REQUEST['action'] ) && -1 != $_REQUEST['action'] )
5
+ return $_REQUEST['action'];
6
+
7
+ if ( isset( $_REQUEST['action2'] ) && -1 != $_REQUEST['action2'] )
8
+ return $_REQUEST['action2'];
9
+
10
+ return false;
11
+ }
12
+
13
+ function wpcf7_admin_has_edit_cap() {
14
+ return current_user_can( 'wpcf7_edit_contact_forms' );
15
+ }
16
+
17
+ function wpcf7_add_tag_generator( $name, $title, $elm_id, $callback, $options = array() ) {
18
+ global $wpcf7_tag_generators;
19
+
20
+ $name = trim( $name );
21
+ if ( '' == $name )
22
+ return false;
23
+
24
+ if ( ! is_array( $wpcf7_tag_generators ) )
25
+ $wpcf7_tag_generators = array();
26
+
27
+ $wpcf7_tag_generators[$name] = array(
28
+ 'title' => $title,
29
+ 'content' => $elm_id,
30
+ 'options' => $options );
31
+
32
+ if ( is_callable( $callback ) )
33
+ add_action( 'wpcf7_admin_footer', $callback );
34
+
35
+ return true;
36
+ }
37
+
38
+ function wpcf7_tag_generators() {
39
+ global $wpcf7_tag_generators;
40
+
41
+ $taggenerators = array();
42
+
43
+ foreach ( (array) $wpcf7_tag_generators as $name => $tg ) {
44
+ $taggenerators[$name] = array_merge(
45
+ (array) $tg['options'],
46
+ array( 'title' => $tg['title'], 'content' => $tg['content'] ) );
47
+ }
48
+
49
+ return $taggenerators;
50
+ }
51
+
52
+ ?>
admin/admin.php CHANGED
@@ -1,18 +1,42 @@
1
<?php
2
3
- function wpcf7_admin_has_edit_cap() {
4
- return current_user_can( WPCF7_ADMIN_READ_WRITE_CAPABILITY );
5
}
6
7
- add_action( 'admin_init', 'wpcf7_admin_init' );
8
9
- function wpcf7_admin_init() {
10
- if ( ! wpcf7_admin_has_edit_cap() )
11
- return;
12
13
- if ( isset( $_POST['wpcf7-save'] ) ) {
14
$id = $_POST['post_ID'];
15
- check_admin_referer( 'wpcf7-save_' . $id );
16
17
if ( ! $contact_form = wpcf7_contact_form( $id ) ) {
18
$contact_form = new WPCF7_ContactForm();
@@ -68,15 +92,23 @@ function wpcf7_admin_init() {
68
69
$contact_form->save();
70
71
- $query['contactform'] = $contact_form->id;
72
- $redirect_to = wpcf7_admin_url( $query );
73
wp_safe_redirect( $redirect_to );
74
exit();
75
}
76
77
- if ( isset( $_POST['wpcf7-copy'] ) ) {
78
- $id = $_POST['post_ID'];
79
- check_admin_referer( 'wpcf7-copy_' . $id );
80
81
$query = array();
82
@@ -84,89 +116,103 @@ function wpcf7_admin_init() {
84
$new_contact_form = $contact_form->copy();
85
$new_contact_form->save();
86
87
- $query['contactform'] = $new_contact_form->id;
88
$query['message'] = 'created';
89
} else {
90
- $query['contactform'] = $contact_form->id;
91
}
92
93
- $redirect_to = wpcf7_admin_url( $query );
94
wp_safe_redirect( $redirect_to );
95
exit();
96
}
97
98
- if ( isset( $_POST['wpcf7-delete'] ) ) {
99
- $id = $_POST['post_ID'];
100
- check_admin_referer( 'wpcf7-delete_' . $id );
101
102
- if ( $contact_form = wpcf7_contact_form( $id ) )
103
- $contact_form->delete();
104
105
- $redirect_to = wpcf7_admin_url( array( 'message' => 'deleted' ) );
106
- wp_safe_redirect( $redirect_to );
107
- exit();
108
- }
109
- }
110
111
- add_action( 'admin_menu', 'wpcf7_admin_menu', 9 );
112
113
- function wpcf7_admin_menu() {
114
- add_menu_page( __( 'Contact Form 7', 'wpcf7' ), __( 'Contact', 'wpcf7' ),
115
- WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7', 'wpcf7_admin_management_page',
116
- wpcf7_plugin_url( 'admin/images/menu-icon.png' ) );
117
118
- add_submenu_page( 'wpcf7', __( 'Edit Contact Forms', 'wpcf7' ), __( 'Edit', 'wpcf7' ),
119
- WPCF7_ADMIN_READ_CAPABILITY, 'wpcf7', 'wpcf7_admin_management_page' );
120
- }
121
122
- add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_styles' );
123
124
- function wpcf7_admin_enqueue_styles() {
125
- global $plugin_page;
126
127
- if ( ! isset( $plugin_page ) || 'wpcf7' != $plugin_page )
128
- return;
129
130
- wp_enqueue_style( 'thickbox' );
131
132
- wp_enqueue_style( 'contact-form-7-admin', wpcf7_plugin_url( 'admin/styles.css' ),
133
- array(), WPCF7_VERSION, 'all' );
134
135
- if ( wpcf7_is_rtl() ) {
136
- wp_enqueue_style( 'contact-form-7-admin-rtl',
137
- wpcf7_plugin_url( 'admin/styles-rtl.css' ), array(), WPCF7_VERSION, 'all' );
138
}
139
- }
140
141
- add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_scripts' );
142
143
- function wpcf7_admin_enqueue_scripts() {
144
- global $plugin_page, $wpcf7_tag_generators;
145
146
- if ( ! isset( $plugin_page ) || 'wpcf7' != $plugin_page )
147
- return;
148
149
- wp_enqueue_script( 'thickbox' );
150
- wp_enqueue_script( 'postbox' );
151
152
- wp_enqueue_script( 'wpcf7-admin-taggenerator', wpcf7_plugin_url( 'admin/taggenerator.js' ),
153
- array( 'jquery' ), WPCF7_VERSION, true );
154
155
- wp_enqueue_script( 'wpcf7-admin', wpcf7_plugin_url( 'admin/scripts.js' ),
156
- array( 'jquery', 'wpcf7-admin-taggenerator' ), WPCF7_VERSION, true );
157
158
- $taggenerators = array();
159
160
- foreach ( (array) $wpcf7_tag_generators as $name => $tg ) {
161
- $taggenerators[$name] = array_merge(
162
- (array) $tg['options'],
163
- array( 'title' => $tg['title'], 'content' => $tg['content'] ) );
164
}
165
166
wp_localize_script( 'wpcf7-admin', '_wpcf7', array(
167
'generateTag' => __( 'Generate Tag', 'wpcf7' ),
168
'pluginUrl' => wpcf7_plugin_url(),
169
- 'tagGenerators' => $taggenerators ) );
170
}
171
172
add_action( 'admin_print_footer_scripts', 'wpcf7_print_taggenerators_json', 20 );
@@ -198,49 +244,134 @@ _wpcf7.tagGenerators = <?php echo json_encode( $taggenerators ) ?>;
198
}
199
200
function wpcf7_admin_management_page() {
201
- $contact_forms = get_posts( array(
202
- 'numberposts' => -1,
203
- 'orderby' => 'ID',
204
- 'order' => 'ASC',
205
- 'post_type' => 'wpcf7_contact_form' ) );
206
-
207
- $cf = null;
208
$unsaved = false;
209
210
- if ( ! isset( $_GET['contactform'] ) )
211
- $_GET['contactform'] = '';
212
213
- if ( 'new' == $_GET['contactform'] && wpcf7_admin_has_edit_cap() ) {
214
$unsaved = true;
215
- $current = -1;
216
- $cf = wpcf7_get_contact_form_default_pack(
217
array( 'locale' => ( isset( $_GET['locale'] ) ? $_GET['locale'] : '' ) ) );
218
- } elseif ( $cf = wpcf7_contact_form( $_GET['contactform'] ) ) {
219
- $current = (int) $_GET['contactform'];
220
- } else {
221
- $first = reset( $contact_forms ); // Returns first item
222
-
223
- if ( $first ) {
224
- $current = $first->ID;
225
- $cf = wpcf7_contact_form( $current );
226
- }
227
}
228
229
- require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php';
230
- require_once WPCF7_PLUGIN_DIR . '/admin/edit.php';
231
}
232
233
/* Misc */
234
235
add_filter( 'plugin_action_links', 'wpcf7_plugin_action_links', 10, 2 );
236
237
function wpcf7_plugin_action_links( $links, $file ) {
238
if ( $file != WPCF7_PLUGIN_BASENAME )
239
return $links;
240
241
- $url = wpcf7_admin_url();
242
-
243
- $settings_link = '<a href="' . esc_attr( $url ) . '">'
244
. esc_html( __( 'Settings', 'wpcf7' ) ) . '</a>';
245
246
array_unshift( $links, $settings_link );
@@ -248,12 +379,10 @@ function wpcf7_plugin_action_links( $links, $file ) {
248
return $links;
249
}
250
251
- add_action( 'wpcf7_admin_before_subsubsub', 'wpcf7_cf7com_links', 9 );
252
253
- function wpcf7_cf7com_links( &$contact_form ) {
254
$links = '<div class="cf7com-links">'
255
- . '<a href="' . esc_url_raw( __( 'http://contactform7.com/', 'wpcf7' ) ) . '" target="_blank">'
256
- . esc_html( __( 'Contactform7.com', 'wpcf7' ) ) . '</a>&ensp;'
257
. '<a href="' . esc_url_raw( __( 'http://contactform7.com/docs/', 'wpcf7' ) ) . '" target="_blank">'
258
. esc_html( __( 'Docs', 'wpcf7' ) ) . '</a> - '
259
. '<a href="' . esc_url_raw( __( 'http://contactform7.com/faq/', 'wpcf7' ) ) . '" target="_blank">'
@@ -265,39 +394,16 @@ function wpcf7_cf7com_links( &$contact_form ) {
265
echo apply_filters( 'wpcf7_cf7com_links', $links );
266
}
267
268
- add_action( 'wpcf7_admin_before_subsubsub', 'wpcf7_updated_message' );
269
-
270
- function wpcf7_updated_message( &$contact_form ) {
271
- if ( ! isset( $_GET['message'] ) )
272
- return;
273
274
- switch ( $_GET['message'] ) {
275
- case 'created':
276
- $updated_message = __( "Contact form created.", 'wpcf7' );
277
- break;
278
- case 'saved':
279
- $updated_message = __( "Contact form saved.", 'wpcf7' );
280
- break;
281
- case 'deleted':
282
- $updated_message = __( "Contact form deleted.", 'wpcf7' );
283
- break;
284
- }
285
-
286
- if ( ! $updated_message )
287
return;
288
289
- ?>
290
- <div id="message" class="updated"><p><?php echo esc_html( $updated_message ); ?></p></div>
291
- <?php
292
- }
293
-
294
- add_action( 'wpcf7_admin_before_subsubsub', 'wpcf7_donation_link' );
295
-
296
- function wpcf7_donation_link( &$contact_form ) {
297
- if ( ! WPCF7_SHOW_DONATION_LINK )
298
return;
299
300
- if ( 'new' == $_GET['contactform'] || ! empty( $_GET['message'] ) )
301
return;
302
303
$show_link = true;
1
<?php
2
3
+ require_once WPCF7_PLUGIN_DIR . '/admin/admin-functions.php';
4
+
5
+ add_action( 'admin_menu', 'wpcf7_admin_menu', 9 );
6
+
7
+ function wpcf7_admin_menu() {
8
+ add_object_page( __( 'Contact Form 7', 'wpcf7' ), __( 'Contact', 'wpcf7' ),
9
+ 'wpcf7_read_contact_forms', 'wpcf7', 'wpcf7_admin_management_page',
10
+ wpcf7_plugin_url( 'admin/images/menu-icon.png' ) );
11
+
12
+ $contact_form_admin = add_submenu_page( 'wpcf7',
13
+ __( 'Edit Contact Forms', 'wpcf7' ), __( 'Edit', 'wpcf7' ),
14
+ 'wpcf7_read_contact_forms', 'wpcf7', 'wpcf7_admin_management_page' );
15
+
16
+ add_action( 'load-' . $contact_form_admin, 'wpcf7_load_contact_form_admin' );
17
}
18
19
+ add_filter( 'set-screen-option', 'wpcf7_set_screen_options', 10, 3 );
20
21
+ function wpcf7_set_screen_options( $result, $option, $value ) {
22
+ $wpcf7_screens = array(
23
+ 'cfseven_contact_forms_per_page' );
24
+
25
+ if ( in_array( $option, $wpcf7_screens ) )
26
+ $result = $value;
27
+
28
+ return $result;
29
+ }
30
31
+ function wpcf7_load_contact_form_admin() {
32
+ $action = wpcf7_current_action();
33
+
34
+ if ( 'save' == $action ) {
35
$id = $_POST['post_ID'];
36
+ check_admin_referer( 'wpcf7-save-contact-form_' . $id );
37
+
38
+ if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
39
+ wp_die( __( 'You are not allowed to edit this item.', 'wpcf7' ) );
40
41
if ( ! $contact_form = wpcf7_contact_form( $id ) ) {
42
$contact_form = new WPCF7_ContactForm();
92
93
$contact_form->save();
94
95
+ $query['post'] = $contact_form->id;
96
+
97
+ $redirect_to = add_query_arg( $query, menu_page_url( 'wpcf7', false ) );
98
+
99
wp_safe_redirect( $redirect_to );
100
exit();
101
}
102
103
+ if ( 'copy' == $action ) {
104
+ $id = empty( $_POST['post_ID'] )
105
+ ? absint( $_REQUEST['post'] )
106
+ : absint( $_POST['post_ID'] );
107
+
108
+ check_admin_referer( 'wpcf7-copy-contact-form_' . $id );
109
+
110
+ if ( ! current_user_can( 'wpcf7_edit_contact_form', $id ) )
111
+ wp_die( __( 'You are not allowed to edit this item.', 'wpcf7' ) );
112
113
$query = array();
114
116
$new_contact_form = $contact_form->copy();
117
$new_contact_form->save();
118
119
+ $query['post'] = $new_contact_form->id;
120
$query['message'] = 'created';
121
} else {
122
+ $query['post'] = $contact_form->id;
123
}
124
125
+ $redirect_to = add_query_arg( $query, menu_page_url( 'wpcf7', false ) );
126
+
127
wp_safe_redirect( $redirect_to );
128
exit();
129
}
130
131
+ if ( 'delete' == $action ) {
132
+ if ( ! empty( $_POST['post_ID'] ) )
133
+ check_admin_referer( 'wpcf7-delete-contact-form_' . $_POST['post_ID'] );
134
+ elseif ( ! is_array( $_REQUEST['post'] ) )
135
+ check_admin_referer( 'wpcf7-delete-contact-form_' . $_REQUEST['post'] );
136
+ else
137
+ check_admin_referer( 'bulk-posts' );
138
139
+ $posts = empty( $_POST['post_ID'] )
140
+ ? (array) $_REQUEST['post']
141
+ : (array) $_POST['post_ID'];
142
143
+ $deleted = 0;
144
145
+ foreach ( $posts as $post ) {
146
+ $post = new WPCF7_ContactForm( $post );
147
148
+ if ( empty( $post ) )
149
+ continue;
150
151
+ if ( ! current_user_can( 'wpcf7_delete_contact_form', $post->id ) )
152
+ wp_die( __( 'You are not allowed to delete this item.', 'wpcf7' ) );
153
154
+ if ( ! $post->delete() )
155
+ wp_die( __( 'Error in deleting.', 'wpcf7' ) );
156
157
+ $deleted += 1;
158
+ }
159
160
+ $query = array();
161
162
+ if ( ! empty( $deleted ) )
163
+ $query['message'] = 'deleted';
164
165
+ $redirect_to = add_query_arg( $query, menu_page_url( 'wpcf7', false ) );
166
167
+ wp_safe_redirect( $redirect_to );
168
+ exit();
169
}
170
171
+ if ( empty( $_GET['post'] ) ) {
172
+ $current_screen = get_current_screen();
173
174
+ if ( ! class_exists( 'WPCF7_Contact_Form_List_Table' ) )
175
+ require_once WPCF7_PLUGIN_DIR . '/admin/includes/class-contact-forms-list-table.php';
176
177
+ add_filter( 'manage_' . $current_screen->id . '_columns',
178
+ array( 'WPCF7_Contact_Form_List_Table', 'define_columns' ) );
179
180
+ add_screen_option( 'per_page', array(
181
+ 'label' => __( 'Contact Forms', 'wpcf7' ),
182
+ 'default' => 20,
183
+ 'option' => 'cfseven_contact_forms_per_page' ) );
184
+ }
185
+ }
186
187
+ add_action( 'admin_enqueue_scripts', 'wpcf7_admin_enqueue_scripts' );
188
189
+ function wpcf7_admin_enqueue_scripts( $hook_suffix ) {
190
+ if ( false === strpos( $hook_suffix, 'wpcf7' ) )
191
+ return;
192
193
+ wp_enqueue_style( 'contact-form-7-admin',
194
+ wpcf7_plugin_url( 'admin/css/styles.css' ),
195
+ array( 'thickbox' ), WPCF7_VERSION, 'all' );
196
197
+ if ( wpcf7_is_rtl() ) {
198
+ wp_enqueue_style( 'contact-form-7-admin-rtl',
199
+ wpcf7_plugin_url( 'admin/css/styles-rtl.css' ),
200
+ array(), WPCF7_VERSION, 'all' );
201
}
202
203
+ wp_enqueue_script( 'wpcf7-admin-taggenerator',
204
+ wpcf7_plugin_url( 'admin/js/taggenerator.js' ),
205
+ array( 'jquery' ), WPCF7_VERSION, true );
206
+
207
+ wp_enqueue_script( 'wpcf7-admin',
208
+ wpcf7_plugin_url( 'admin/js/scripts.js' ),
209
+ array( 'jquery', 'thickbox', 'postbox', 'wpcf7-admin-taggenerator' ),
210
+ WPCF7_VERSION, true );
211
+
212
wp_localize_script( 'wpcf7-admin', '_wpcf7', array(
213
'generateTag' => __( 'Generate Tag', 'wpcf7' ),
214
'pluginUrl' => wpcf7_plugin_url(),
215
+ 'tagGenerators' => wpcf7_tag_generators() ) );
216
}
217
218
add_action( 'admin_print_footer_scripts', 'wpcf7_print_taggenerators_json', 20 );
244
}
245
246
function wpcf7_admin_management_page() {
247
+ $post = null;
248
$unsaved = false;
249
250
+ if ( ! isset( $_GET['post'] ) )
251
+ $_GET['post'] = '';
252
253
+ if ( 'new' == $_GET['post'] && current_user_can( 'wpcf7_edit_contact_forms' ) ) {
254
$unsaved = true;
255
+ $post_id = -1;
256
+ $post = wpcf7_get_contact_form_default_pack(
257
array( 'locale' => ( isset( $_GET['locale'] ) ? $_GET['locale'] : '' ) ) );
258
+ } elseif ( $post = wpcf7_contact_form( $_GET['post'] ) ) {
259
+ $post_id = (int) $_GET['post'];
260
+ }
261
+
262
+ if ( $post ) {
263
+ require_once WPCF7_PLUGIN_DIR . '/admin/includes/meta-boxes.php';
264
+ require_once WPCF7_PLUGIN_DIR . '/admin/edit-contact-form.php';
265
+ return;
266
+ }
267
+
268
+ $list_table = new WPCF7_Contact_Form_List_Table();
269
+ $list_table->prepare_items();
270
+
271
+ ?>
272
+ <div class="wrap">
273
+ <?php screen_icon(); ?>
274
+
275
+ <h2><?php
276
+ echo esc_html( __( 'Contact Form 7', 'wpcf7' ) );
277
+
278
+ echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html( __( 'Add New', 'wpcf7' ) ) . '</a>';
279
+
280
+ if ( ! empty( $_REQUEST['s'] ) ) {
281
+ echo sprintf( '<span class="subtitle">'
282
+ . __( 'Search results for &#8220;%s&#8221;', 'wpcf7' )
283
+ . '</span>', esc_html( $_REQUEST['s'] ) );
284
}
285
+ ?></h2>
286
+
287
+ <?php do_action( 'wpcf7_admin_notices' ); ?>
288
289
+ <form method="get" action="">
290
+ <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
291
+ <?php $list_table->search_box( __( 'Search Contact Forms', 'wpcf7' ), 'wpcf7-contact' ); ?>
292
+ <?php $list_table->display(); ?>
293
+ </form>
294
+
295
+ </div>
296
+ <?php
297
+ wpcf7_admin_lang_select_modal();
298
+ }
299
+
300
+ function wpcf7_admin_lang_select_modal() {
301
+ $available_locales = wpcf7_l10n();
302
+ $default_locale = get_locale();
303
+
304
+ if ( ! isset( $available_locales[$default_locale] ) )
305
+ $default_locale = 'en_US';
306
+
307
+ ?>
308
+ <div id="wpcf7-lang-select-modal" class="hidden">
309
+ <h4><?php echo esc_html( sprintf( __( 'Use the default language (%s)', 'wpcf7' ), $available_locales[$default_locale] ) ); ?></h4>
310
+ <p><a href="<?php echo esc_url( add_query_arg( array( 'post' => 'new' ), menu_page_url( 'wpcf7', false ) ) ); ?>" class="button" /><?php echo esc_html( __( 'Add New', 'wpcf7' ) ); ?></a></p>
311
+
312
+ <?php unset( $available_locales[$default_locale] ); ?>
313
+ <h4><?php echo esc_html( __( 'Or', 'wpcf7' ) ); ?></h4>
314
+ <form action="" method="get">
315
+ <input type="hidden" name="page" value="wpcf7" />
316
+ <input type="hidden" name="post" value="new" />
317
+ <select name="locale">
318
+ <option value="" selected="selected"><?php echo esc_html( __( '(select language)', 'wpcf7' ) ); ?></option>
319
+ <?php foreach ( $available_locales as $code => $locale ) : ?>
320
+ <option value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $locale ); ?></option>
321
+ <?php endforeach; ?>
322
+ </select>
323
+ <input type="submit" class="button" value="<?php echo esc_attr( __( 'Add New', 'wpcf7' ) ); ?>" />
324
+ </form>
325
+ </div>
326
+ <?php
327
}
328
329
/* Misc */
330
331
+ add_action( 'wpcf7_admin_notices', 'wpcf7_admin_before_subsubsub' );
332
+
333
+ function wpcf7_admin_before_subsubsub() {
334
+ // wpcf7_admin_before_subsubsub is deprecated. Use wpcf7_admin_notices instead.
335
+
336
+ $current_screen = get_current_screen();
337
+
338
+ if ( 'toplevel_page_wpcf7' != $current_screen->id )
339
+ return;
340
+
341
+ if ( empty( $_GET['post'] ) || ! $contact_form = wpcf7_contact_form( $_GET['post'] ) )
342
+ return;
343
+
344
+ do_action_ref_array( 'wpcf7_admin_before_subsubsub', array( &$contact_form ) );
345
+ }
346
+
347
+ add_action( 'wpcf7_admin_notices', 'wpcf7_admin_updated_message' );
348
+
349
+ function wpcf7_admin_updated_message() {
350
+ if ( empty( $_REQUEST['message'] ) )
351
+ return;
352
+
353
+ if ( 'created' == $_REQUEST['message'] )
354
+ $updated_message = esc_html( __( 'Contact form created.', 'wpcf7' ) );
355
+ elseif ( 'saved' == $_REQUEST['message'] )
356
+ $updated_message = esc_html( __( 'Contact form saved.', 'wpcf7' ) );
357
+ elseif ( 'deleted' == $_REQUEST['message'] )
358
+ $updated_message = esc_html( __( 'Contact form deleted.', 'wpcf7' ) );
359
+
360
+ if ( empty( $updated_message ) )
361
+ return;
362
+
363
+ ?>
364
+ <div id="message" class="updated"><p><?php echo $updated_message; ?></p></div>
365
+ <?php
366
+ }
367
+
368
add_filter( 'plugin_action_links', 'wpcf7_plugin_action_links', 10, 2 );
369
370
function wpcf7_plugin_action_links( $links, $file ) {
371
if ( $file != WPCF7_PLUGIN_BASENAME )
372
return $links;
373
374
+ $settings_link = '<a href="' . menu_page_url( 'wpcf7', false ) . '">'
375
. esc_html( __( 'Settings', 'wpcf7' ) ) . '</a>';
376
377
array_unshift( $links, $settings_link );
379
return $links;
380
}
381
382
+ add_action( 'wpcf7_admin_notices', 'wpcf7_cf7com_links', 9 );
383
384
+ function wpcf7_cf7com_links() {
385
$links = '<div class="cf7com-links">'
386
. '<a href="' . esc_url_raw( __( 'http://contactform7.com/docs/', 'wpcf7' ) ) . '" target="_blank">'
387
. esc_html( __( 'Docs', 'wpcf7' ) ) . '</a> - '
388
. '<a href="' . esc_url_raw( __( 'http://contactform7.com/faq/', 'wpcf7' ) ) . '" target="_blank">'
394
echo apply_filters( 'wpcf7_cf7com_links', $links );
395
}
396
397
+ add_action( 'wpcf7_admin_notices', 'wpcf7_donation_link' );
398
399
+ function wpcf7_donation_link() {
400
+ if ( ! WPCF7_SHOW_DONATION_LINK )
401
return;
402
403
+ if ( ! empty( $_REQUEST['post'] ) && 'new' == $_REQUEST['post'] )
404
return;
405
406
+ if ( ! empty( $_REQUEST['message'] ) )
407
return;
408
409
$show_link = true;
admin/{styles-rtl.css → css/styles-rtl.css} RENAMED
@@ -1,8 +1,3 @@
1
- ul.subsubsub li.addnew {
2
- margin-left: 0;
3
- margin-right: 0.5em;
4
- }
5
-
6
div.save-contact-form {
7
direction: rtl;
8
}
1
div.save-contact-form {
2
direction: rtl;
3
}
admin/{styles.css → css/styles.css} RENAMED
@@ -1,15 +1,16 @@
1
#icon-wpcf7 {
2
- background: transparent url(./images/screen-icon.png) no-repeat 2px 1px;
3
}
4
5
div.wrap div.cf7com-links {
6
text-align: right;
7
font-size: .9em;
8
- margin-top: -1.6em;
9
}
10
11
div.wrap div.cf7com-links a {
12
text-decoration: none;
13
}
14
15
div.wrap div.donation {
@@ -21,7 +22,6 @@ div.wrap div.donation {
21
border-radius: 3px;
22
background-color: #ffffe0;
23
border-color: #e6db55;
24
- text-align: center;
25
}
26
27
div.wrap div.donation p {
@@ -32,33 +32,13 @@ div.wrap div.donation p {
32
}
33
34
div.wrap div.donation p a {
35
- font-weight: bold;
36
color: #3f3f3f;
37
}
38
39
div.wrap div.donation p a.button {
40
margin-left: 1em;
41
- }
42
-
43
- div.wrap ul.subsubsub {
44
- white-space: normal;
45
- }
46
-
47
- ul.subsubsub li.addnew {
48
- margin-left: 0.5em;
49
- }
50
-
51
- ul.subsubsub li.addnew a {
52
- color: #e6255b;
53
- }
54
-
55
- ul.subsubsub li.addnew a.current {
56
- border: 1px solid #bbb;
57
- }
58
-
59
- ul.subsubsub li.addnew a:hover,
60
- ul.subsubsub li.addnew a:active {
61
- color: #999;
62
}
63
64
#titlediv {
@@ -272,4 +252,9 @@ div.tg-panetitle {
272
font: bold 132% sans-serif;
273
margin: 0 0 10px;
274
color: #777;
275
}
1
#icon-wpcf7 {
2
+ background: transparent url(../images/screen-icon.png) no-repeat 2px 1px;
3
}
4
5
div.wrap div.cf7com-links {
6
text-align: right;
7
font-size: .9em;
8
+ margin: -2em 1em 1em 0;
9
}
10
11
div.wrap div.cf7com-links a {
12
text-decoration: none;
13
+ font-weight: bold;
14
}
15
16
div.wrap div.donation {
22
border-radius: 3px;
23
background-color: #ffffe0;
24
border-color: #e6db55;
25
}
26
27
div.wrap div.donation p {
32
}
33
34
div.wrap div.donation p a {
35
color: #3f3f3f;
36
+ text-decoration: none;
37
}
38
39
div.wrap div.donation p a.button {
40
margin-left: 1em;
41
+ font-weight: bold;
42
}
43
44
#titlediv {
252
font: bold 132% sans-serif;
253
margin: 0 0 10px;
254
color: #777;
255
+ }
256
+
257
+ input.shortcode-in-list-table {
258
+ width: 100%;
259
+ border: none;
260
}
admin/edit-contact-form.php ADDED
@@ -0,0 +1,139 @@
1
+ <?php
2
+
3
+ // don't load directly
4
+ if ( ! defined( 'ABSPATH' ) )
5
+ die( '-1' );
6
+
7
+ ?><div class="wrap">
8
+
9
+ <?php screen_icon(); ?>
10
+
11
+ <h2><?php
12
+ echo esc_html( __( 'Contact Form 7', 'wpcf7' ) );
13
+
14
+ if ( ! $unsaved ) {
15
+ echo ' <a href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal" class="add-new-h2 thickbox">' . esc_html( __( 'Add New', 'wpcf7' ) ) . '</a>';
16
+ }
17
+ ?></h2>
18
+
19
+ <?php do_action( 'wpcf7_admin_notices' ); ?>
20
+
21
+ <br class="clear" />
22
+
23
+ <?php
24
+ if ( $post ) :
25
+
26
+ if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) )
27
+ $disabled = '';
28
+ else
29
+ $disabled = ' disabled="disabled"';
30
+ ?>
31
+
32
+ <form method="post" action="<?php echo esc_url( add_query_arg( array( 'post' => $post_id ), menu_page_url( 'wpcf7', false ) ) ); ?>" id="wpcf7-admin-form-element"<?php do_action( 'wpcf7_post_edit_form_tag' ); ?>>
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="hiddenaction" name="action" value="save" />
38
+
39
+ <div id="poststuff" class="metabox-holder">
40
+
41
+ <div id="titlediv">
42
+ <input type="text" id="wpcf7-title" name="wpcf7-title" size="40" value="<?php echo esc_attr( $post->title ); ?>"<?php echo $disabled; ?> />
43
+
44
+ <?php if ( ! $unsaved ) : ?>
45
+ <p class="tagcode">
46
+ <?php echo esc_html( __( "Copy this code and paste it into your post, page or text widget content.", 'wpcf7' ) ); ?><br />
47
+
48
+ <input type="text" id="contact-form-anchor-text" onfocus="this.select();" readonly="readonly" />
49
+ </p>
50
+
51
+ <p class="tagcode" style="display: none;">
52
+ <?php echo esc_html( __( "Old code is also available.", 'wpcf7' ) ); ?><br />
53
+
54
+ <input type="text" id="contact-form-anchor-text-old" onfocus="this.select();" readonly="readonly" />
55
+ </p>
56
+ <?php endif; ?>
57
+
58
+ <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) ) : ?>
59
+ <div class="save-contact-form">
60
+ <input type="submit" class="button-primary" name="wpcf7-save" value="<?php echo esc_attr( __( 'Save', 'wpcf7' ) ); ?>" />
61
+ </div>
62
+ <?php endif; ?>
63
+
64
+ <?php if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) && ! $unsaved ) : ?>
65
+ <div class="actions-link">
66
+ <?php $copy_nonce = wp_create_nonce( 'wpcf7-copy-contact-form_' . $post_id ); ?>
67
+ <input type="submit" name="wpcf7-copy" class="copy" value="<?php echo esc_attr( __( 'Copy', 'wpcf7' ) ); ?>"
68
+ <?php echo "onclick=\"this.form._wpnonce.value = '$copy_nonce'; this.form.action.value = 'copy'; return true;\""; ?> />
69
+ |
70
+
71
+ <?php $delete_nonce = wp_create_nonce( 'wpcf7-delete-contact-form_' . $post_id ); ?>
72
+ <input type="submit" name="wpcf7-delete" class="delete" value="<?php echo esc_attr( __( 'Delete', 'wpcf7' ) ); ?>"
73
+ <?php echo "onclick=\"if (confirm('" .
74
+ esc_js( __( "You are about to delete this contact form.\n 'Cancel' to stop, 'OK' to delete.", 'wpcf7' ) ) .
75
+ "')) {this.form._wpnonce.value = '$delete_nonce'; this.form.action.value = 'delete'; return true;} return false;\""; ?> />
76
+ </div>
77
+ <?php endif; ?>
78
+ </div>
79
+
80
+ <?php
81
+
82
+ if ( current_user_can( 'wpcf7_edit_contact_form', $post_id ) ) {
83
+ add_meta_box( 'formdiv', __( 'Form', 'wpcf7' ),
84
+ 'wpcf7_form_meta_box', 'cfseven', 'form', 'core' );
85
+
86
+ add_meta_box( 'maildiv', __( 'Mail', 'wpcf7' ),
87
+ 'wpcf7_mail_meta_box', 'cfseven', 'mail', 'core' );
88
+
89
+ add_meta_box( 'mail2div', __( 'Mail (2)', 'wpcf7' ),
90
+ 'wpcf7_mail_meta_box', 'cfseven', 'mail_2', 'core',
91
+ array(
92
+ 'id' => 'wpcf7-mail-2',
93
+ 'name' => 'mail_2',
94
+ 'use' => __( 'Use mail (2)', 'wpcf7' ) ) );
95
+
96
+ add_meta_box( 'messagesdiv', __( 'Messages', 'wpcf7' ),
97
+ 'wpcf7_messages_meta_box', 'cfseven', 'messages', 'core' );
98
+
99
+ add_meta_box( 'additionalsettingsdiv', __( 'Additional Settings', 'wpcf7' ),
100
+ 'wpcf7_additional_settings_meta_box', 'cfseven', 'additional_settings', 'core' );
101
+ }
102
+
103
+ do_action_ref_array( 'wpcf7_admin_after_general_settings', array( &$post ) );
104
+
105
+ do_meta_boxes( 'cfseven', 'form', $post );
106
+
107
+ do_action_ref_array( 'wpcf7_admin_after_form', array( &$post ) );
108
+
109
+ do_meta_boxes( 'cfseven', 'mail', $post );
110
+
111
+ do_action_ref_array( 'wpcf7_admin_after_mail', array( &$post ) );
112
+
113
+ do_meta_boxes( 'cfseven', 'mail_2', $post );
114
+
115
+ do_action_ref_array( 'wpcf7_admin_after_mail_2', array( &$post ) );
116
+
117
+ do_meta_boxes( 'cfseven', 'messages', $post );
118
+
119
+ do_action_ref_array( 'wpcf7_admin_after_messages', array( &$post ) );
120
+
121
+ do_meta_boxes( 'cfseven', 'additional_settings', $post );
122
+
123
+ do_action_ref_array( 'wpcf7_admin_after_additional_settings', array( &$post ) );
124
+
125
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
126
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
127
+
128
+ ?>
129
+ </div>
130
+
131
+ </form>
132
+
133
+ <?php endif; ?>
134
+
135
+ </div>
136
+
137
+ <?php wpcf7_admin_lang_select_modal(); ?>
138
+
139
+ <?php do_action_ref_array( 'wpcf7_admin_footer', array( &$post ) ); ?>
admin/edit.php DELETED
@@ -1,159 +0,0 @@
1
- <div class="wrap">
2
-
3
- <?php screen_icon(); ?>
4
-
5
- <h2><?php echo esc_html( __( 'Contact Form 7', 'wpcf7' ) ); ?></h2>
6
-
7
- <?php do_action_ref_array( 'wpcf7_admin_before_subsubsub', array( &$cf ) ); ?>
8
-
9
- <ul class="subsubsub">
10
- <?php
11
- $first = array_shift( $contact_forms );
12
- if ( ! is_null( $first ) ) : ?>
13
- <li><a href="<?php echo wpcf7_admin_url( array( 'contactform' => $first->ID ) ); ?>"<?php if ( $first->ID == $current ) echo ' class="current"'; ?>><?php echo esc_html( $first->post_title ); ?></a></li>
14
- <?php endif;
15
- foreach ( $contact_forms as $v ) : ?>
16
- <li>| <a href="<?php echo wpcf7_admin_url( array( 'contactform' => $v->ID ) ); ?>"<?php if ( $v->ID == $current ) echo ' class="current"'; ?>><?php echo esc_html( $v->post_title ); ?></a></li>
17
- <?php endforeach; ?>
18
-
19
- <?php if ( wpcf7_admin_has_edit_cap() ) : ?>
20
- <li class="addnew"><a class="button thickbox<?php if ( $unsaved ) echo ' current'; ?>" href="#TB_inline?height=300&width=400&inlineId=wpcf7-lang-select-modal"><?php echo esc_html( __( 'Add New', 'wpcf7' ) ); ?></a></li>
21
- <?php endif; ?>
22
- </ul>
23
-
24
- <br class="clear" />
25
-
26
- <?php if ( $cf ) : ?>
27
- <?php $disabled = ( wpcf7_admin_has_edit_cap() ) ? '' : ' disabled="disabled"'; ?>
28
-
29
- <form method="post" action="<?php echo wpcf7_admin_url( array( 'contactform' => $current ) ); ?>" id="wpcf7-admin-form-element"<?php do_action( 'wpcf7_post_edit_form_tag' ); ?>>
30
- <?php if ( wpcf7_admin_has_edit_cap() ) wp_nonce_field( 'wpcf7-save_' . $current ); ?>
31
- <input type="hidden" id="post_ID" name="post_ID" value="<?php echo (int) $current; ?>" />
32
- <input type="hidden" id="wpcf7-id" name="wpcf7-id" value="<?php echo (int) get_post_meta( $cf->id, '_old_cf7_unit_id', true ); ?>" />
33
-
34
- <div id="poststuff" class="metabox-holder">
35
-
36
- <div id="titlediv">
37
- <input type="text" id="wpcf7-title" name="wpcf7-title" size="40" value="<?php echo esc_attr( $cf->title ); ?>"<?php echo $disabled; ?> />
38
-
39
- <?php if ( ! $unsaved ) : ?>
40
- <p class="tagcode">
41
- <?php echo esc_html( __( "Copy this code and paste it into your post, page or text widget content.", 'wpcf7' ) ); ?><br />
42
-
43
- <input type="text" id="contact-form-anchor-text" onfocus="this.select();" readonly="readonly" />
44
- </p>
45
-
46
- <p class="tagcode" style="display: none;">
47
- <?php echo esc_html( __( "Old code is also available.", 'wpcf7' ) ); ?><br />
48
-
49
- <input type="text" id="contact-form-anchor-text-old" onfocus="this.select();" readonly="readonly" />
50
- </p>
51
- <?php endif; ?>
52
-
53
- <?php if ( wpcf7_admin_has_edit_cap() ) : ?>
54
- <div class="save-contact-form">
55
- <input type="submit" class="button" name="wpcf7-save" value="<?php echo esc_attr( __( 'Save', 'wpcf7' ) ); ?>" />
56
- </div>
57
- <?php endif; ?>
58
-
59
- <?php if ( wpcf7_admin_has_edit_cap() && ! $unsaved ) : ?>
60
- <div class="actions-link">
61
- <?php $copy_nonce = wp_create_nonce( 'wpcf7-copy_' . $current ); ?>
62
- <input type="submit" name="wpcf7-copy" class="copy" value="<?php echo esc_attr( __( 'Copy', 'wpcf7' ) ); ?>"
63
- <?php echo "onclick=\"this.form._wpnonce.value = '$copy_nonce'; return true;\""; ?> />
64
- |
65
-
66
- <?php $delete_nonce = wp_create_nonce( 'wpcf7-delete_' . $current ); ?>
67
- <input type="submit" name="wpcf7-delete" class="delete" value="<?php echo esc_attr( __( 'Delete', 'wpcf7' ) ); ?>"
68
- <?php echo "onclick=\"if (confirm('" .
69
- esc_js( __( "You are about to delete this contact form.\n 'Cancel' to stop, 'OK' to delete.", 'wpcf7' ) ) .
70
- "')) {this.form._wpnonce.value = '$delete_nonce'; return true;} return false;\""; ?> />
71
- </div>
72
- <?php endif; ?>
73
- </div>
74
-
75
- <?php
76
-
77
- if ( wpcf7_admin_has_edit_cap() ) {
78
- add_meta_box( 'formdiv', __( 'Form', 'wpcf7' ),
79
- 'wpcf7_form_meta_box', 'cfseven', 'form', 'core' );
80
-
81
- add_meta_box( 'maildiv', __( 'Mail', 'wpcf7' ),
82
- 'wpcf7_mail_meta_box', 'cfseven', 'mail', 'core' );
83
-
84
- add_meta_box( 'mail2div', __( 'Mail (2)', 'wpcf7' ),
85
- 'wpcf7_mail_meta_box', 'cfseven', 'mail_2', 'core',
86
- array(
87
- 'id' => 'wpcf7-mail-2',
88
- 'name' => 'mail_2',
89
- 'use' => __( 'Use mail (2)', 'wpcf7' ) ) );
90
-
91
- add_meta_box( 'messagesdiv', __( 'Messages', 'wpcf7' ),
92
- 'wpcf7_messages_meta_box', 'cfseven', 'messages', 'core' );
93
-
94
- add_meta_box( 'additionalsettingsdiv', __( 'Additional Settings', 'wpcf7' ),
95
- 'wpcf7_additional_settings_meta_box', 'cfseven', 'additional_settings', 'core' );
96
- }
97
-
98
- do_action_ref_array( 'wpcf7_admin_after_general_settings', array( &$cf ) );
99
-
100
- do_meta_boxes( 'cfseven', 'form', $cf );
101
-
102
- do_action_ref_array( 'wpcf7_admin_after_form', array( &$cf ) );
103
-
104
- do_meta_boxes( 'cfseven', 'mail', $cf );
105
-
106
- do_action_ref_array( 'wpcf7_admin_after_mail', array( &$cf ) );
107
-
108
- do_meta_boxes( 'cfseven', 'mail_2', $cf );
109
-
110
- do_action_ref_array( 'wpcf7_admin_after_mail_2', array( &$cf ) );
111
-
112
- do_meta_boxes( 'cfseven', 'messages', $cf );
113
-
114
- do_action_ref_array( 'wpcf7_admin_after_messages', array( &$cf ) );
115
-
116
- do_meta_boxes( 'cfseven', 'additional_settings', $cf );
117
-
118
- do_action_ref_array( 'wpcf7_admin_after_additional_settings', array( &$cf ) );
119
-
120
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
121
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
122
-
123
- ?>
124
- </div>
125
-
126
- </form>
127
-
128
- <?php endif; ?>
129
-
130
- </div>
131
-
132
- <div id="wpcf7-lang-select-modal" class="hidden">
133
- <?php
134
- $available_locales = wpcf7_l10n();
135
- $default_locale = get_locale();
136
-
137
- if ( ! isset( $available_locales[$default_locale] ) )
138
- $default_locale = 'en_US';
139
-
140
- ?>
141
- <h4><?php echo esc_html( sprintf( __( 'Use the default language (%s)', 'wpcf7' ), $available_locales[$default_locale] ) ); ?></h4>
142
- <p><a href="<?php echo wpcf7_admin_url( array( 'contactform' => 'new' ) ); ?>" class="button" /><?php echo esc_html( __( 'Add New', 'wpcf7' ) ); ?></a></p>
143
-
144
- <?php unset( $available_locales[$default_locale] ); ?>
145
- <h4><?php echo esc_html( __( 'Or', 'wpcf7' ) ); ?></h4>
146
- <form action="" method="get">
147
- <input type="hidden" name="page" value="wpcf7" />
148
- <input type="hidden" name="contactform" value="new" />
149
- <select name="locale">
150
- <option value="" selected="selected"><?php echo esc_html( __( '(select language)', 'wpcf7' ) ); ?></option>
151
- <?php foreach ( $available_locales as $code => $locale ) : ?>
152
- <option value="<?php echo esc_attr( $code ); ?>"><?php echo esc_html( $locale ); ?></option>
153
- <?php endforeach; ?>
154
- </select>
155
- <input type="submit" class="button" value="<?php echo esc_attr( __( 'Add New', 'wpcf7' ) ); ?>" />
156
- </form>
157
- </div>
158
-
159
- <?php do_action_ref_array( 'wpcf7_admin_footer', array( &$cf ) ); ?>
admin/includes/class-contact-forms-list-table.php ADDED
@@ -0,0 +1,169 @@
1
+ <?php
2
+
3
+ if ( ! class_exists( 'WP_List_Table' ) )
4
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
5
+
6
+ class WPCF7_Contact_Form_List_Table extends WP_List_Table {
7
+
8
+ public static function define_columns() {
9
+ $columns = array(
10
+ 'cb' => '<input type="checkbox" />',
11
+ 'title' => __( 'Title', 'wpcf7' ),
12
+ 'shortcode' => __( 'Shortcode', 'wpcf7' ),
13
+ 'author' => __( 'Author', 'wpcf7' ),
14
+ 'date' => __( 'Date', 'wpcf7' ) );
15
+
16
+ return $columns;
17
+ }
18
+
19
+ function __construct() {
20
+ parent::__construct( array(
21
+ 'singular' => 'post',
22
+ 'plural' => 'posts',
23
+ 'ajax' => false ) );
24
+ }
25
+
26
+ function prepare_items() {
27
+ $current_screen = get_current_screen();
28
+ $per_page = $this->get_items_per_page( 'cfseven_contact_forms_per_page' );
29
+
30
+ $this->_column_headers = $this->get_column_info();
31
+
32
+ $args = array(
33
+ 'posts_per_page' => $per_page,
34
+ 'orderby' => 'title',
35
+ 'order' => 'ASC',
36
+ 'offset' => ( $this->get_pagenum() - 1 ) * $per_page );
37
+
38
+ if ( ! empty( $_REQUEST['s'] ) )
39
+ $args['s'] = $_REQUEST['s'];
40
+
41
+ if ( ! empty( $_REQUEST['orderby'] ) ) {
42
+ if ( 'title' == $_REQUEST['orderby'] )
43
+ $args['orderby'] = 'title';
44
+ elseif ( 'author' == $_REQUEST['orderby'] )
45
+ $args['orderby'] = 'author';
46
+ elseif ( 'date' == $_REQUEST['orderby'] )
47
+ $args['orderby'] = 'date';
48
+ }
49
+
50
+ if ( ! empty( $_REQUEST['order'] ) ) {
51
+ if ( 'asc' == strtolower( $_REQUEST['order'] ) )
52
+ $args['order'] = 'ASC';
53
+ elseif ( 'desc' == strtolower( $_REQUEST['order'] ) )
54
+ $args['order'] = 'DESC';
55
+ }
56
+
57
+ $this->items = WPCF7_ContactForm::find( $args );
58
+
59
+ $total_items = WPCF7_ContactForm::$found_items;
60
+ $total_pages = ceil( $total_items / $per_page );
61
+
62
+ $this->set_pagination_args( array(
63
+ 'total_items' => $total_items,
64
+ 'total_pages' => $total_pages,
65
+ 'per_page' => $per_page ) );
66
+ }
67
+
68
+ function get_columns() {
69
+ return get_column_headers( get_current_screen() );
70
+ }
71
+
72
+ function get_sortable_columns() {
73
+ $columns = array(
74
+ 'title' => array( 'title', true ),
75
+ 'author' => array( 'author', false ),
76
+ 'date' => array( 'date', false ) );
77
+
78
+ return $columns;
79
+ }
80
+
81
+ function get_bulk_actions() {
82
+ $actions = array(
83
+ 'delete' => __( 'Delete', 'wpcf7' ) );
84
+
85
+ return $actions;
86
+ }
87
+
88
+ function column_default( $item, $column_name ) {
89
+ return '';
90
+ }
91
+
92
+ function column_cb( $item ) {
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', 'wpcf7' ) . '</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', 'wpcf7' ) . '</a>' ) );
113
+ }
114
+
115
+ $a = sprintf( '<a class="row-title" href="%1$s" title="%2$s">%3$s</a>',
116
+ $edit_link,
117
+ esc_attr( sprintf( __( 'Edit &#8220;%s&#8221;', 'wpcf7' ), $item->title ) ),
118
+ esc_html( $item->title ) );
119
+
120
+ return '<strong>' . $a . '</strong> ' . $this->row_actions( $actions );
121
+ }
122
+
123
+ function column_author( $item ) {
124
+ $post = get_post( $item->id );
125
+
126
+ if ( ! $post )
127
+ return;
128
+
129
+ $author = get_userdata( $post->post_author );
130
+
131
+ return esc_html( $author->display_name );
132
+ }
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
+
140
+ foreach ( $shortcodes as $shortcode ) {
141
+ $output .= "\n" . '<input type="text" onfocus="this.select();" readonly="readonly"
142
+ value="' . esc_attr( $shortcode ) . '" class="shortcode-in-list-table" />';
143
+ }
144
+
145
+ return trim( $output );
146
+ }
147
+
148
+ function column_date( $item ) {
149
+ $post = get_post( $item->id );
150
+
151
+ if ( ! $post )
152
+ return;
153
+
154
+ $t_time = mysql2date( __( 'Y/m/d g:i:s A', 'wpcf7' ), $post->post_date, true );
155
+ $m_time = $post->post_date;
156
+ $time = mysql2date( 'G', $post->post_date ) - get_option( 'gmt_offset' ) * 3600;
157
+
158
+ $time_diff = time() - $time;
159
+
160
+ if ( $time_diff > 0 && $time_diff < 24*60*60 )
161
+ $h_time = sprintf( __( '%s ago', 'wpcf7' ), human_time_diff( $time ) );
162
+ else
163
+ $h_time = mysql2date( __( 'Y/m/d', 'wpcf7' ), $m_time );
164
+
165
+ return '<abbr title="' . $t_time . '">' . $h_time . '</abbr>';
166
+ }
167
+ }
168
+
169
+ ?>
admin/{scripts.js → js/scripts.js} RENAMED
File without changes
admin/{taggenerator.js → js/taggenerator.js} RENAMED
File without changes
includes/capabilities.php ADDED
@@ -0,0 +1,20 @@
1
+ <?php
2
+
3
+ add_filter( 'map_meta_cap', 'wpcf7_map_meta_cap', 10, 4 );
4
+
5
+ function wpcf7_map_meta_cap( $caps, $cap, $user_id, $args ) {
6
+ $meta_caps = array(
7
+ 'wpcf7_edit_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY,
8
+ 'wpcf7_edit_contact_forms' => WPCF7_ADMIN_READ_WRITE_CAPABILITY,
9
+ 'wpcf7_read_contact_forms' => WPCF7_ADMIN_READ_CAPABILITY,
10
+ 'wpcf7_delete_contact_form' => WPCF7_ADMIN_READ_WRITE_CAPABILITY );
11
+
12
+ $caps = array_diff( $caps, array_keys( $meta_caps ) );
13
+
14
+ if ( array_key_exists( $cap, $meta_caps ) )
15
+ $caps[] = $meta_caps[$cap];
16
+
17
+ return $caps;
18
+ }
19
+
20
+ ?>
includes/classes.php CHANGED
@@ -2,6 +2,10 @@
2
3
class WPCF7_ContactForm {
4
5
var $initial = false;
6
7
var $id;
@@ -17,6 +21,60 @@ class WPCF7_ContactForm {
17
18
var $skip_mail = false;
19
20
// Return true if this form is the same one as currently POSTed.
21
function is_posted() {
22
if ( ! isset( $_POST['_wpcf7_unit_tag'] ) || empty( $_POST['_wpcf7_unit_tag'] ) )
@@ -55,8 +113,25 @@ class WPCF7_ContactForm {
55
$url .= '#' . $this->unit_tag;
56
57
$url = apply_filters( 'wpcf7_form_action_url', $url );
58
$enctype = apply_filters( 'wpcf7_form_enctype', '' );
59
- $class = apply_filters( 'wpcf7_form_class_attr', 'wpcf7-form' );
60
61
$form .= '<form action="' . esc_url_raw( $url ) . '" method="post"'
62
. ' class="' . esc_attr( $class ) . '"' . $enctype . '>' . "\n";
@@ -533,17 +608,32 @@ class WPCF7_ContactForm {
533
/* Save */
534
535
function save() {
536
- $postarr = array(
537
- 'ID' => (int) $this->id,
538
- 'post_type' => 'wpcf7_contact_form',
539
- 'post_status' => 'publish',
540
- 'post_title' => $this->title );
541
542
- $post_id = wp_insert_post( $postarr );
543
544
- if ( $post_id ) {
545
- $metas = array( 'form', 'mail', 'mail_2', 'messages', 'additional_settings' );
546
547
foreach ( $metas as $meta )
548
update_post_meta( $post_id, $meta, wpcf7_normalize_newline_deep( $this->{$meta} ) );
549
@@ -581,33 +671,22 @@ class WPCF7_ContactForm {
581
if ( $this->initial )
582
return;
583
584
- wp_delete_post( $this->id, true );
585
586
- $this->initial = true;
587
- $this->id = null;
588
}
589
}
590
591
function wpcf7_contact_form( $id ) {
592
- $post = get_post( $id );
593
594
- if ( empty( $post ) || 'wpcf7_contact_form' != get_post_type( $post ) )
595
return false;
596
597
- $contact_form = new WPCF7_ContactForm();
598
- $contact_form->id = $post->ID;
599
- $contact_form->title = $post->post_title;
600
-
601
- $contact_form->form = get_post_meta( $post->ID, 'form', true );
602
- $contact_form->mail = get_post_meta( $post->ID, 'mail', true );
603
- $contact_form->mail_2 = get_post_meta( $post->ID, 'mail_2', true );
604
- $contact_form->messages = get_post_meta( $post->ID, 'messages', true );
605
- $contact_form->additional_settings = get_post_meta( $post->ID, 'additional_settings', true );
606
-
607
- $contact_form->upgrade();
608
-
609
- $contact_form = apply_filters_ref_array( 'wpcf7_contact_form', array( &$contact_form ) );
610
-
611
return $contact_form;
612
}
613
@@ -622,7 +701,7 @@ function wpcf7_get_contact_form_by_old_id( $old_id ) {
622
}
623
624
function wpcf7_get_contact_form_by_title( $title ) {
625
- $page = get_page_by_title( $title, OBJECT, 'wpcf7_contact_form' );
626
627
if ( $page )
628
return wpcf7_contact_form( $page->ID );
@@ -630,12 +709,6 @@ function wpcf7_get_contact_form_by_title( $title ) {
630
return null;
631
}
632
633
- function wpcf7_contact_form_default_pack( $locale = null ) {
634
- // For backward compatibility
635
-
636
- return wpcf7_get_contact_form_default_pack( array( 'locale' => $locale ) );
637
- }
638
-
639
function wpcf7_get_contact_form_default_pack( $args = '' ) {
640
global $l10n;
641
2
3
class WPCF7_ContactForm {
4
5
+ const post_type = 'wpcf7_contact_form';
6
+
7
+ public static $found_items = 0;
8
+
9
var $initial = false;
10
11
var $id;
21
22
var $skip_mail = false;
23
24
+ public static function register_post_type() {
25
+ register_post_type( self::post_type, array(
26
+ 'labels' => array(
27
+ 'name' => __( 'Contact Forms', 'wpcf7' ),
28
+ 'singular_name' => __( 'Contact Form', 'wpcf7' ) ) ) );
29
+ }
30
+
31
+ public static function find( $args = '' ) {
32
+ $defaults = array(
33
+ 'post_status' => 'any',
34
+ 'posts_per_page' => -1,
35
+ 'offset' => 0,
36
+ 'orderby' => 'ID',
37
+ 'order' => 'ASC' );
38
+
39
+ $args = wp_parse_args( $args, $defaults );
40
+
41
+ $args['post_type'] = self::post_type;
42
+
43
+ $q = new WP_Query();
44
+ $posts = $q->query( $args );
45
+
46
+ self::$found_items = $q->found_posts;
47
+
48
+ $objs = array();
49
+
50
+ foreach ( (array) $posts as $post )
51
+ $objs[] = new self( $post );
52
+
53
+ return $objs;
54
+ }
55
+
56
+ public function __construct( $post = null ) {
57
+ $this->initial = true;
58
+
59
+ $post = get_post( $post );
60
+
61
+ if ( $post && self::post_type == get_post_type( $post ) ) {
62
+ $this->initial = false;
63
+ $this->id = $post->ID;
64
+ $this->title = $post->post_title;
65
+
66
+ $this->form = get_post_meta( $post->ID, 'form', true );
67
+ $this->mail = get_post_meta( $post->ID, 'mail', true );
68
+ $this->mail_2 = get_post_meta( $post->ID, 'mail_2', true );
69
+ $this->messages = get_post_meta( $post->ID, 'messages', true );
70
+ $this->additional_settings = get_post_meta( $post->ID, 'additional_settings', true );
71
+
72
+ $this->upgrade();
73
+ }
74
+
75
+ do_action_ref_array( 'wpcf7_contact_form', array( &$this ) );
76
+ }
77
+
78
// Return true if this form is the same one as currently POSTed.
79
function is_posted() {
80
if ( ! isset( $_POST['_wpcf7_unit_tag'] ) || empty( $_POST['_wpcf7_unit_tag'] ) )
113
$url .= '#' . $this->unit_tag;
114
115
$url = apply_filters( 'wpcf7_form_action_url', $url );
116
+
117
+ $class = 'wpcf7-form';
118
+
119
+ if ( $this->is_posted() ) {
120
+ if ( ! empty( $_POST['_wpcf7_validation_errors'] ) ) {
121
+ $class .= ' invalid';
122
+ } elseif ( ! empty( $_POST['_wpcf7_mail_sent'] ) ) {
123
+ if ( ! empty( $_POST['_wpcf7_mail_sent']['spam'] ) )
124
+ $class .= ' spam';
125
+ elseif ( ! empty( $_POST['_wpcf7_mail_sent']['ok'] ) )
126
+ $class .= ' sent';
127
+ else
128
+ $class .= ' failed';
129
+ }
130
+ }
131
+
132
+ $class = apply_filters( 'wpcf7_form_class_attr', $class );
133
+
134
$enctype = apply_filters( 'wpcf7_form_enctype', '' );
135
136
$form .= '<form action="' . esc_url_raw( $url ) . '" method="post"'
137
. ' class="' . esc_attr( $class ) . '"' . $enctype . '>' . "\n";
608
/* Save */
609
610
function save() {
611
+ $metas = array( 'form', 'mail', 'mail_2', 'messages', 'additional_settings' );
612
613
+ $post_content = '';
614
615
+ foreach ( $metas as $meta ) {
616
+ $props = (array) $this->{$meta};
617
+
618
+ foreach ( $props as $prop )
619
+ $post_content .= "\n" . trim( $prop );
620
+ }
621
+
622
+ if ( $this->initial ) {
623
+ $post_id = wp_insert_post( array(
624
+ 'post_type' => self::post_type,
625
+ 'post_status' => 'publish',
626
+ 'post_title' => $this->title,
627
+ 'post_content' => trim( $post_content ) ) );
628
+ } else {
629
+ $post_id = wp_update_post( array(
630
+ 'ID' => (int) $this->id,
631
+ 'post_status' => 'publish',
632
+ 'post_title' => $this->title,
633
+ 'post_content' => trim( $post_content ) ) );
634
+ }
635
636
+ if ( $post_id ) {
637
foreach ( $metas as $meta )
638
update_post_meta( $post_id, $meta, wpcf7_normalize_newline_deep( $this->{$meta} ) );
639
671
if ( $this->initial )
672
return;
673
674
+ if ( wp_delete_post( $this->id, true ) ) {
675
+ $this->initial = true;
676
+ $this->id = null;
677
+ return true;
678
+ }
679
680
+ return false;
681
}
682
}
683
684
function wpcf7_contact_form( $id ) {
685
+ $contact_form = new WPCF7_ContactForm( $id );
686
687
+ if ( $contact_form->initial )
688
return false;
689
690
return $contact_form;
691
}
692
701
}
702
703
function wpcf7_get_contact_form_by_title( $title ) {
704
+ $page = get_page_by_title( $title, OBJECT, WPCF7_ContactForm::post_type );
705
706
if ( $page )
707
return wpcf7_contact_form( $page->ID );
709
return null;
710
}
711
712
function wpcf7_get_contact_form_default_pack( $args = '' ) {
713
global $l10n;
714
includes/controller.php CHANGED
@@ -1,6 +1,12 @@
1
<?php
2
3
- add_action( 'init', 'wpcf7_ajax_onload', 11 );
4
5
function wpcf7_ajax_onload() {
6
global $wpcf7_contact_form;
@@ -29,8 +35,6 @@ function wpcf7_ajax_onload() {
29
exit();
30
}
31
32
- add_action( 'init', 'wpcf7_ajax_json_echo', 11 );
33
-
34
function wpcf7_ajax_json_echo() {
35
global $wpcf7_contact_form;
36
@@ -102,8 +106,6 @@ function wpcf7_is_xhr() {
102
return $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
103
}
104
105
- add_action( 'init', 'wpcf7_submit_nonajax', 11 );
106
-
107
function wpcf7_submit_nonajax() {
108
global $wpcf7_contact_form;
109
@@ -169,8 +171,12 @@ function wpcf7_widget_text_filter( $content ) {
169
170
/* Shortcodes */
171
172
- add_shortcode( 'contact-form-7', 'wpcf7_contact_form_tag_func' );
173
- add_shortcode( 'contact-form', 'wpcf7_contact_form_tag_func' );
174
175
function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) {
176
global $wpcf7, $wpcf7_contact_form;
@@ -230,14 +236,16 @@ function wpcf7_enqueue_scripts() {
230
// jquery.form.js originally bundled with WordPress is out of date and deprecated
231
// so we need to deregister it and re-register the latest one
232
wp_deregister_script( 'jquery-form' );
233
- wp_register_script( 'jquery-form', wpcf7_plugin_url( 'jquery.form.js' ),
234
- array( 'jquery' ), '3.08', true );
235
236
$in_footer = true;
237
if ( 'header' === WPCF7_LOAD_JS )
238
$in_footer = false;
239
240
- wp_enqueue_script( 'contact-form-7', wpcf7_plugin_url( 'scripts.js' ),
241
array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );
242
243
$_wpcf7 = array(
@@ -260,11 +268,13 @@ if ( WPCF7_LOAD_CSS )
260
add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_styles' );
261
262
function wpcf7_enqueue_styles() {
263
- wp_enqueue_style( 'contact-form-7', wpcf7_plugin_url( 'styles.css' ),
264
array(), WPCF7_VERSION, 'all' );
265
266
if ( wpcf7_is_rtl() ) {
267
- wp_enqueue_style( 'contact-form-7-rtl', wpcf7_plugin_url( 'styles-rtl.css' ),
268
array(), WPCF7_VERSION, 'all' );
269
}
270
1
<?php
2
3
+ add_action( 'init', 'wpcf7_control_init', 11 );
4
+
5
+ function wpcf7_control_init() {
6
+ wpcf7_ajax_onload();
7
+ wpcf7_ajax_json_echo();
8
+ wpcf7_submit_nonajax();
9
+ }
10
11
function wpcf7_ajax_onload() {
12
global $wpcf7_contact_form;
35
exit();
36
}
37
38
function wpcf7_ajax_json_echo() {
39
global $wpcf7_contact_form;
40
106
return $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
107
}
108
109
function wpcf7_submit_nonajax() {
110
global $wpcf7_contact_form;
111
171
172
/* Shortcodes */
173
174
+ add_action( 'plugins_loaded', 'wpcf7_add_shortcodes', 1 );
175
+
176
+ function wpcf7_add_shortcodes() {
177
+ add_shortcode( 'contact-form-7', 'wpcf7_contact_form_tag_func' );
178
+ add_shortcode( 'contact-form', 'wpcf7_contact_form_tag_func' );
179
+ }
180
181
function wpcf7_contact_form_tag_func( $atts, $content = null, $code = '' ) {
182
global $wpcf7, $wpcf7_contact_form;
236
// jquery.form.js originally bundled with WordPress is out of date and deprecated
237
// so we need to deregister it and re-register the latest one
238
wp_deregister_script( 'jquery-form' );
239
+ wp_register_script( 'jquery-form',
240
+ wpcf7_plugin_url( 'includes/js/jquery.form.js' ),
241
+ array( 'jquery' ), '3.09', true );
242
243
$in_footer = true;
244
if ( 'header' === WPCF7_LOAD_JS )
245
$in_footer = false;
246
247
+ wp_enqueue_script( 'contact-form-7',
248
+ wpcf7_plugin_url( 'includes/js/scripts.js' ),
249
array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer );
250
251
$_wpcf7 = array(
268
add_action( 'wp_enqueue_scripts', 'wpcf7_enqueue_styles' );
269
270
function wpcf7_enqueue_styles() {
271
+ wp_enqueue_style( 'contact-form-7',
272
+ wpcf7_plugin_url( 'includes/css/styles.css' ),
273
array(), WPCF7_VERSION, 'all' );
274
275
if ( wpcf7_is_rtl() ) {
276
+ wp_enqueue_style( 'contact-form-7-rtl',
277
+ wpcf7_plugin_url( 'includes/css/styles-rtl.css' ),
278
array(), WPCF7_VERSION, 'all' );
279
}
280
styles-rtl.css → includes/css/styles-rtl.css RENAMED
File without changes
styles.css → includes/css/styles.css RENAMED
File without changes
includes/deprecated.php ADDED
@@ -0,0 +1,26 @@
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
@@ -5,19 +5,23 @@ function wpcf7_plugin_path( $path = '' ) {
5
}
6
7
function wpcf7_plugin_url( $path = '' ) {
8
- return plugins_url( $path, WPCF7_PLUGIN_BASENAME );
9
- }
10
11
- function wpcf7_admin_url( $args = array() ) {
12
- $defaults = array( 'page' => 'wpcf7' );
13
- $args = wp_parse_args( $args, $defaults );
14
15
- $url = menu_page_url( $args['page'], false );
16
- unset( $args['page'] );
17
18
- $url = add_query_arg( $args, $url );
19
20
- return esc_url_raw( $url );
21
}
22
23
function wpcf7_messages() {
5
}
6
7
function wpcf7_plugin_url( $path = '' ) {
8
+ $url = untrailingslashit( WPCF7_PLUGIN_URL );
9
10
+ if ( ! empty( $path ) && is_string( $path ) && false === strpos( $path, '..' ) )
11
+ $url .= '/' . ltrim( $path, '/' );
12
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.', 'wpcf7' ), $function, $version, $replacement ) );
22
+ else
23
+ trigger_error( sprintf( __( '%1$s is <strong>deprecated</strong> since Contact Form 7 version %2$s with no alternative available.', 'wpcf7' ), $function, $version ) );
24
+ }
25
}
26
27
function wpcf7_messages() {
jquery.form.js → includes/js/jquery.form.dev.js RENAMED
@@ -1,6 +1,6 @@
1
/*!
2
* jQuery Form Plugin
3
- * version: 3.08 (07-APR-2012)
4
* @requires jQuery v1.3.2 or later
5
*
6
* Examples and documentation at: http://malsup.com/jquery/form/
@@ -21,7 +21,7 @@
21
to bind your own submit handler to the form. For example,
22
23
$(document).ready(function() {
24
- $('#myForm').bind('submit', function(e) {
25
e.preventDefault(); // <-- important
26
$(this).ajaxSubmit({
27
target: '#output'
@@ -808,8 +808,14 @@ $.fn.formToArray = function(semantic, elements) {
808
if (elements)
809
elements.push(el);
810
var files = el.files;
811
- for (j=0; j < files.length; j++) {
812
- a.push({name: n, value: files[j], type: el.type});
813
}
814
}
815
else if (v !== null && typeof v != 'undefined') {
1
/*!
2
* jQuery Form Plugin
3
+ * version: 3.09 (16-APR-2012)
4
* @requires jQuery v1.3.2 or later
5
*
6
* Examples and documentation at: http://malsup.com/jquery/form/
21
to bind your own submit handler to the form. For example,
22
23
$(document).ready(function() {
24
+ $('#myForm').on('submit', function(e) {
25
e.preventDefault(); // <-- important
26
$(this).ajaxSubmit({
27
target: '#output'
808
if (elements)
809
elements.push(el);
810
var files = el.files;
811
+ if (files.length) {
812
+ for (j=0; j < files.length; j++) {
813
+ a.push({name: n, value: files[j], type: el.type});
814
+ }
815
+ }
816
+ else {
817
+ // #180
818
+ a.push({ name: n, value: '', type: el.type });
819
}
820
}
821
else if (v !== null && typeof v != 'undefined') {
includes/js/jquery.form.js ADDED
@@ -0,0 +1,12 @@
1
+ /*!
2
+ * jQuery Form Plugin
3
+ * version: 3.09 (16-APR-2012)
4
+ * @requires jQuery v1.3.2 or later
5
+ *
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
+ * http://malsup.github.com/mit-license.txt
10
+ * http://malsup.github.com/gpl-license-v2.txt
11
+ */
12
+ (function(e){var c={};c.fileapi=e("<input type='file'/>").get(0).files!==undefined;c.formdata=window.FormData!==undefined;e.fn.ajaxSubmit=function(g){if(!this.length){d("ajaxSubmit: skipping submit process - no element selected");return this}var f,w,i,l=this;if(typeof g=="function"){g={success:g}}f=this.attr("method");w=this.attr("action");i=(typeof w==="string")?e.trim(w):"";i=i||window.location.href||"";if(i){i=(i.match(/^([^#]+)/)||[])[1]}g=e.extend(true,{url:i,success:e.ajaxSettings.success,type:f||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},g);var r={};this.trigger("form-pre-serialize",[this,g,r]);if(r.veto){d("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(g.beforeSerialize&&g.beforeSerialize(this,g)===false){d("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var j=g.traditional;if(j===undefined){j=e.ajaxSettings.traditional}var o=[];var z,A=this.formToArray(g.semantic,o);if(g.data){g.extraData=g.data;z=e.param(g.data,j)}if(g.beforeSubmit&&g.beforeSubmit(A,this,g)===false){d("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[A,this,g,r]);if(r.veto){d("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var u=e.param(A,j);if(z){u=(u?(u+"&"+z):z)}if(g.type.toUpperCase()=="GET"){g.url+=(g.url.indexOf("?")>=0?"&":"?")+u;g.data=null}else{g.data=u}var C=[];if(g.resetForm){C.push(function(){l.resetForm()})}if(g.clearForm){C.push(function(){l.clearForm(g.includeHidden)})}if(!g.dataType&&g.target){var h=g.success||function(){};C.push(function(q){var k=g.replaceTarget?"replaceWith":"html";e(g.target)[k](q).each(h,arguments)})}else{if(g.success){C.push(g.success)}}g.success=function(F,q,G){var E=g.context||g;for(var D=0,k=C.length;D<k;D++){C[D].apply(E,[F,q,G||l,l])}};var y=e("input:file:enabled[value]",this);var m=y.length>0;var x="multipart/form-data";var t=(l.attr("enctype")==x||l.attr("encoding")==x);var s=c.fileapi&&c.formdata;d("fileAPI :"+s);var n=(m||t)&&!s;if(g.iframe!==false&&(g.iframe||n)){if(g.closeKeepAlive){e.get(g.closeKeepAlive,function(){B(A)})}else{B(A)}}else{if((m||t)&&s){p(A)}else{e.ajax(g)}}for(var v=0;v<o.length;v++){o[v]=null}this.trigger("form-submit-notify",[this,g]);return this;function p(q){var k=new FormData();for(var D=0;D<q.length;D++){k.append(q[D].name,q[D].value)}if(g.extraData){for(var G in g.extraData){if(g.extraData.hasOwnProperty(G)){k.append(G,g.extraData[G])}}}g.data=null;var F=e.extend(true,{},e.ajaxSettings,g,{contentType:false,processData:false,cache:false,type:"POST"});if(g.uploadProgress){F.xhr=function(){var H=jQuery.ajaxSettings.xhr();if(H.upload){H.upload.onprogress=function(L){var K=0;var I=L.loaded||L.position;var J=L.total;if(L.lengthComputable){K=Math.ceil(I/J*100)}g.uploadProgress(L,I,J,K)}}return H}}F.data=null;var E=F.beforeSend;F.beforeSend=function(I,H){H.data=k;if(E){E.call(H,I,g)}};e.ajax(F)}function B(ab){var G=l[0],F,X,R,Z,U,I,M,K,L,V,Y,P;var J=!!e.fn.prop;if(e(":input[name=submit],:input[id=submit]",G).length){alert('Error: Form elements must not have name or id of "submit".');return}if(ab){for(X=0;X<o.length;X++){F=e(o[X]);if(J){F.prop("disabled",false)}else{F.removeAttr("disabled")}}}R=e.extend(true,{},e.ajaxSettings,g);R.context=R.context||R;U="jqFormIO"+(new Date().getTime());if(R.iframeTarget){I=e(R.iframeTarget);V=I.attr("name");if(!V){I.attr("name",U)}else{U=V}}else{I=e('<iframe name="'+U+'" src="'+R.iframeSrc+'" />');I.css({position:"absolute",top:"-1000px",left:"-1000px"})}M=I[0];K={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(ae){var af=(ae==="timeout"?"timeout":"aborted");d("aborting upload... "+af);this.aborted=1;I.attr("src",R.iframeSrc);K.error=af;if(R.error){R.error.call(R.context,K,af,ae)}if(Z){e.event.trigger("ajaxError",[K,R,af])}if(R.complete){R.complete.call(R.context,K,af)}}};Z=R.global;if(Z&&0===e.active++){e.event.trigger("ajaxStart")}if(Z){e.event.trigger("ajaxSend",[K,R])}if(R.beforeSend&&R.beforeSend.call(R.context,K,R)===false){if(R.global){e.active--}return}if(K.aborted){return}L=G.clk;if(L){V=L.name;if(V&&!L.disabled){R.extraData=R.extraData||{};R.extraData[V]=L.value;if(L.type=="image"){R.extraData[V+".x"]=G.clk_x;R.extraData[V+".y"]=G.clk_y}}}var Q=1;var N=2;function O(af){var ae=af.contentWindow?af.contentWindow.document:af.contentDocument?af.contentDocument:af.document;return ae}var E=e("meta[name=csrf-token]").attr("content");var D=e("meta[name=csrf-param]").attr("content");if(D&&E){R.extraData=R.extraData||{};R.extraData[D]=E}function W(){var ag=l.attr("target"),ae=l.attr("action");G.setAttribute("target",U);if(!f){G.setAttribute("method","POST")}if(ae!=R.url){G.setAttribute("action",R.url)}if(!R.skipEncodingOverride&&(!f||/post/i.test(f))){l.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(R.timeout){P=setTimeout(function(){Y=true;T(Q)},R.timeout)}function ah(){try{var aj=O(M).readyState;d("state = "+aj);if(aj&&aj.toLowerCase()=="uninitialized"){setTimeout(ah,50)}}catch(ak){d("Server abort: ",ak," (",ak.name,")");T(N);if(P){clearTimeout(P)}P=undefined}}var af=[];try{if(R.extraData){for(var ai in R.extraData){if(R.extraData.hasOwnProperty(ai)){af.push(e('<input type="hidden" name="'+ai+'">').attr("value",R.extraData[ai]).appendTo(G)[0])}}}if(!R.iframeTarget){I.appendTo("body");if(M.attachEvent){M.attachEvent("onload",T)}else{M.addEventListener("load",T,false)}}setTimeout(ah,15);G.submit()}finally{G.setAttribute("action",ae);if(ag){G.setAttribute("target",ag)}else{l.removeAttr("target")}e(af).remove()}}if(R.forceSync){W()}else{setTimeout(W,10)}var ac,ad,aa=50,H;function T(aj){if(K.aborted||H){return}try{ad=O(M)}catch(am){d("cannot access response document: ",am);aj=N}if(aj===Q&&K){K.abort("timeout");return}else{if(aj==N&&K){K.abort("server abort");return}}if(!ad||ad.location.href==R.iframeSrc){if(!Y){return}}if(M.detachEvent){M.detachEvent("onload",T)}else{M.removeEventListener("load",T,false)}var ah="success",al;try{if(Y){throw"timeout"}var ag=R.dataType=="xml"||ad.XMLDocument||e.isXMLDoc(ad);d("isXml="+ag);if(!ag&&window.opera&&(ad.body===null||!ad.body.innerHTML)){if(--aa){d("requeing onLoad callback, DOM not available");setTimeout(T,250);return}}var an=ad.body?ad.body:ad.documentElement;K.responseText=an?an.innerHTML:null;K.responseXML=ad.XMLDocument?ad.XMLDocument:ad;if(ag){R.dataType="xml"}K.getResponseHeader=function(aq){var ap={"content-type":R.dataType};return ap[aq]};if(an){K.status=Number(an.getAttribute("status"))||K.status;K.statusText=an.getAttribute("statusText")||K.statusText}var ae=(R.dataType||"").toLowerCase();var ak=/(json|script|text)/.test(ae);if(ak||R.textarea){var ai=ad.getElementsByTagName("textarea")[0];if(ai){K.responseText=ai.value;K.status=Number(ai.getAttribute("status"))||K.status;K.statusText=ai.getAttribute("statusText")||K.statusText}else{if(ak){var af=ad.getElementsByTagName("pre")[0];var ao=ad.getElementsByTagName("body")[0];if(af){K.responseText=af.textContent?af.textContent:af.innerText}else{if(ao){K.responseText=ao.textContent?ao.textContent:ao.innerText}}}}}else{if(ae=="xml"&&!K.responseXML&&K.responseText){K.responseXML=S(K.responseText)}}try{ac=k(K,ae,R)}catch(aj){ah="parsererror";K.error=al=(aj||ah)}}catch(aj){d("error caught: ",aj);ah="error";K.error=al=(aj||ah)}if(K.aborted){d("upload aborted");ah=null}if(K.status){ah=(K.status>=200&&K.status<300||K.status===304)?"success":"error"}if(ah==="success"){if(R.success){R.success.call(R.context,ac,"success",K)}if(Z){e.event.trigger("ajaxSuccess",[K,R])}}else{if(ah){if(al===undefined){al=K.statusText}if(R.error){R.error.call(R.context,K,ah,al)}if(Z){e.event.trigger("ajaxError",[K,R,al])}}}if(Z){e.event.trigger("ajaxComplete",[K,R])}if(Z&&!--e.active){e.event.trigger("ajaxStop")}if(R.complete){R.complete.call(R.context,K,ah)}H=true;if(R.timeout){clearTimeout(P)}setTimeout(function(){if(!R.iframeTarget){I.remove()}K.responseXML=null},100)}var S=e.parseXML||function(ae,af){if(window.ActiveXObject){af=new ActiveXObject("Microsoft.XMLDOM");af.async="false";af.loadXML(ae)}else{af=(new DOMParser()).parseFromString(ae,"text/xml")}return(af&&af.documentElement&&af.documentElement.nodeName!="parsererror")?af:null};var q=e.parseJSON||function(ae){return window["eval"]("("+ae+")")};var k=function(aj,ah,ag){var af=aj.getResponseHeader("content-type")||"",ae=ah==="xml"||!ah&&af.indexOf("xml")>=0,ai=ae?aj.responseXML:aj.responseText;if(ae&&ai.documentElement.nodeName==="parsererror"){if(e.error){e.error("parsererror")}}if(ag&&ag.dataFilter){ai=ag.dataFilter(ai,ah)}if(typeof ai==="string"){if(ah==="json"||!ah&&af.indexOf("json")>=0){ai=q(ai)}else{if(ah==="script"||!ah&&af.indexOf("javascript")>=0){e.globalEval(ai)}}}return ai}}};e.fn.ajaxForm=function(f){f=f||{};f.delegation=f.delegation&&e.isFunction(e.fn.on);if(!f.delegation&&this.length===0){var g={s:this.selector,c:this.context};if(!e.isReady&&g.s){d("DOM not ready, queuing ajaxForm");e(function(){e(g.s,g.c).ajaxForm(f)});return this}d("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)"));return this}if(f.delegation){e(document).off("submit.form-plugin",this.selector,b).off("click.form-plugin",this.selector,a).on("submit.form-plugin",this.selector,f,b).on("click.form-plugin",this.selector,f,a);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",f,b).bind("click.form-plugin",f,a)};function b(g){var f=g.data;if(!g.isDefaultPrevented()){g.preventDefault();e(this).ajaxSubmit(f)}}function a(j){var i=j.target;var g=e(i);if(!(g.is(":submit,input:image"))){var f=g.closest(":submit");if(f.length===0){return}i=f[0]}var h=this;h.clk=i;if(i.type=="image"){if(j.offsetX!==undefined){h.clk_x=j.offsetX;h.clk_y=j.offsetY}else{if(typeof e.fn.offset=="function"){var k=g.offset();h.clk_x=j.pageX-k.left;h.clk_y=j.pageY-k.top}else{h.clk_x=j.pageX-i.offsetLeft;h.clk_y=j.pageY-i.offsetTop}}}setTimeout(function(){h.clk=h.clk_x=h.clk_y=null},100)}e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};e.fn.formToArray=function(w,f){var u=[];if(this.length===0){return u}var k=this[0];var o=w?k.getElementsByTagName("*"):k.elements;if(!o){return u}var q,p,m,x,l,s,h;for(q=0,s=o.length;q<s;q++){l=o[q];m=l.name;if(!m){continue}if(w&&k.clk&&l.type=="image"){if(!l.disabled&&k.clk==l){u.push({name:m,value:e(l).val(),type:l.type});u.push({name:m+".x",value:k.clk_x},{name:m+".y",value:k.clk_y})}continue}x=e.fieldValue(l,true);if(x&&x.constructor==Array){if(f){f.push(l)}for(p=0,h=x.length;p<h;p++){u.push({name:m,value:x[p]})}}else{if(c.fileapi&&l.type=="file"&&!l.disabled){if(f){f.push(l)}var g=l.files;if(g.length){for(p=0;p<g.length;p++){u.push({name:m,value:g[p],type:l.type})}}else{u.push({name:m,value:"",type:l.type})}}else{if(x!==null&&typeof x!="undefined"){if(f){f.push(l)}u.push({name:m,value:x,type:l.type,required:l.required})}}}}if(!w&&k.clk){var r=e(k.clk),t=r[0];m=t.name;if(m&&!t.disabled&&t.type=="image"){u.push({name:m,value:r.val()});u.push({name:m+".x",value:k.clk_x},{name:m+".y",value:k.clk_y})}}return u};e.fn.formSerialize=function(f){return e.param(this.formToArray(f))};e.fn.fieldSerialize=function(g){var f=[];this.each(function(){var l=this.name;if(!l){return}var j=e.fieldValue(this,g);if(j&&j.constructor==Array){for(var k=0,h=j.length;k<h;k++){f.push({name:l,value:j[k]})}}else{if(j!==null&&typeof j!="undefined"){f.push({name:this.name,value:j})}}});return e.param(f)};e.fn.fieldValue=function(l){for(var k=[],h=0,f=this.length;h<f;h++){var j=this[h];var g=e.fieldValue(j,l);if(g===null||typeof g=="undefined"||(g.constructor==Array&&!g.length)){continue}if(g.constructor==Array){e.merge(k,g)}else{k.push(g)}}return k};e.fieldValue=function(f,m){var h=f.name,s=f.type,u=f.tagName.toLowerCase();if(m===undefined){m=true}if(m&&(!h||f.disabled||s=="reset"||s=="button"||(s=="checkbox"||s=="radio")&&!f.checked||(s=="submit"||s=="image")&&f.form&&f.form.clk!=f||u=="select"&&f.selectedIndex==-1)){return null}if(u=="select"){var o=f.selectedIndex;if(o<0){return null}var q=[],g=f.options;var k=(s=="select-one");var p=(k?o+1:g.length);for(var j=(k?o:0);j<p;j++){var l=g[j];if(l.selected){var r=l.value;if(!r){r=(l.attributes&&l.attributes.value&&!(l.attributes.value.specified))?l.text:l.value}if(k){return r}q.push(r)}}return q}return e(f).val()};e.fn.clearForm=function(f){return this.each(function(){e("input,select,textarea",this).clearFields(f)})};e.fn.clearFields=e.fn.clearInputs=function(f){var g=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)#x2F;i;return this.each(function(){var i=this.type,h=this.tagName.toLowerCase();if(g.test(i)||h=="textarea"){this.value=""}else{if(i=="checkbox"||i=="radio"){this.checked=false}else{if(h=="select"){this.selectedIndex=-1}else{if(f){if((f===true&&/hidden/.test(i))||(typeof f=="string"&&e(this).is(f))){this.value=""}}}}}})};e.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};e.fn.enable=function(f){if(f===undefined){f=true}return this.each(function(){this.disabled=!f})};e.fn.selected=function(f){if(f===undefined){f=true}return this.each(function(){var g=this.type;if(g=="checkbox"||g=="radio"){this.checked=f}else{if(this.tagName.toLowerCase()=="option"){var h=e(this).parent("select");if(f&&h[0]&&h[0].type=="select-one"){h.find("option").selected(false)}this.selected=f}}})};e.fn.ajaxSubmit.debug=false;function d(){if(!e.fn.ajaxSubmit.debug){return}var f="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log){window.console.log(f)}else{if(window.opera&&window.opera.postError){window.opera.postError(f)}}}})(jQuery);
scripts.js → includes/js/scripts.js RENAMED
@@ -25,13 +25,8 @@
25
var ro = $(data.into).find('div.wpcf7-response-output');
26
$(data.into).wpcf7ClearResponseOutput();
27
28
- if (data.invalids) {
29
- $.each(data.invalids, function(i, n) {
30
- $(data.into).find(n.into).wpcf7NotValidTip(n.message);
31
- $(data.into).find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
32
- });
33
- ro.addClass('wpcf7-validation-errors');
34
- }
35
36
if (data.captcha)
37
$(data.into).wpcf7RefillCaptcha(data.captcha);
@@ -39,16 +34,29 @@
39
if (data.quiz)
40
$(data.into).wpcf7RefillQuiz(data.quiz);
41
42
- if (1 == data.spam)
43
ro.addClass('wpcf7-spam-blocked');
44
45
- if (1 == data.mailSent) {
46
ro.addClass('wpcf7-mail-sent-ok');
47
48
if (data.onSentOk)
49
$.each(data.onSentOk, function(i, n) { eval(n) });
50
} else {
51
ro.addClass('wpcf7-mail-sent-ng');
52
}
53
54
if (data.onSubmit)
25
var ro = $(data.into).find('div.wpcf7-response-output');
26
$(data.into).wpcf7ClearResponseOutput();
27
28
+ $(data.into).find('.wpcf7-form-control').removeClass('wpcf7-not-valid');
29
+ $(data.into).find('form.wpcf7-form').removeClass('invalid spam sent failed');
30
31
if (data.captcha)
32
$(data.into).wpcf7RefillCaptcha(data.captcha);
34
if (data.quiz)
35
$(data.into).wpcf7RefillQuiz(data.quiz);
36
37
+ if (data.invalids) {
38
+ $.each(data.invalids, function(i, n) {
39
+ $(data.into).find(n.into).wpcf7NotValidTip(n.message);
40
+ $(data.into).find(n.into).find('.wpcf7-form-control').addClass('wpcf7-not-valid');
41
+ });
42
+
43
+ ro.addClass('wpcf7-validation-errors');
44
+ $(data.into).find('form.wpcf7-form').addClass('invalid');
45
+
46
+ } else if (1 == data.spam) {
47
ro.addClass('wpcf7-spam-blocked');
48
+ $(data.into).find('form.wpcf7-form').addClass('spam');
49
50
+ } else if (1 == data.mailSent) {
51
ro.addClass('wpcf7-mail-sent-ok');
52
+ $(data.into).find('form.wpcf7-form').addClass('sent');
53
54
if (data.onSentOk)
55
$.each(data.onSentOk, function(i, n) { eval(n) });
56
+
57
} else {
58
ro.addClass('wpcf7-mail-sent-ng');
59
+ $(data.into).find('form.wpcf7-form').addClass('failed');
60
}
61
62
if (data.onSubmit)
includes/taggenerator.php DELETED
@@ -1,24 +0,0 @@
1
- <?php
2
-
3
- function wpcf7_add_tag_generator( $name, $title, $elm_id, $callback, $options = array() ) {
4
- global $wpcf7_tag_generators;
5
-
6
- $name = trim( $name );
7
- if ( '' == $name )
8
- return false;
9
-
10
- if ( ! is_array( $wpcf7_tag_generators ) )
11
- $wpcf7_tag_generators = array();
12
-
13
- $wpcf7_tag_generators[$name] = array(
14
- 'title' => $title,
15
- 'content' => $elm_id,
16
- 'options' => $options );
17
-
18
- if ( is_callable( $callback ) )
19
- add_action( 'wpcf7_admin_footer', $callback );
20
-
21
- return true;
22
- }
23
-
24
- ?>
languages/wpcf7-cs_CZ.mo CHANGED
Binary file
languages/wpcf7-ja.mo CHANGED
Binary file
languages/wpcf7-lv.mo CHANGED
Binary file
languages/wpcf7-sv_SE.mo CHANGED
Binary file
languages/wpcf7.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: 2012-04-12 22:04+0900\n"
6
- "PO-Revision-Date: 2012-04-12 22:04+0900\n"
7
"Last-Translator: Takayuki Miyoshi <takayukister@gmail.com>\n"
8
"Language-Team: \n"
9
"MIME-Version: 1.0\n"
@@ -19,176 +19,226 @@ msgstr ""
19
msgid "Just another contact form plugin. Simple but flexible."
20
msgstr ""
21
22
- #: contact-form-7/settings.php:75
23
- msgid "Contact Forms"
24
- msgstr ""
25
-
26
- #: contact-form-7/settings.php:76
27
- msgid "Contact Form"
28
- msgstr ""
29
-
30
- #: contact-form-7/settings.php:168
31
#, php-format
32
msgid "Contact form %d"
33
msgstr ""
34
35
- #: contact-form-7/admin/admin.php:114
36
- #: contact-form-7/admin/edit.php:5
37
msgid "Contact Form 7"
38
msgstr ""
39
40
- #: contact-form-7/admin/admin.php:114
41
msgid "Contact"
42
msgstr ""
43
44
- #: contact-form-7/admin/admin.php:118
45
msgid "Edit Contact Forms"
46
msgstr ""
47
48
- #: contact-form-7/admin/admin.php:118
49
msgid "Edit"
50
msgstr ""
51
52
- #: contact-form-7/admin/admin.php:167
53
- msgid "Generate Tag"
54
msgstr ""
55
56
- #: contact-form-7/admin/admin.php:244
57
- msgid "Settings"
58
msgstr ""
59
60
- #: contact-form-7/admin/admin.php:255
61
- msgid "http://contactform7.com/"
62
msgstr ""
63
64
- #: contact-form-7/admin/admin.php:256
65
- msgid "Contactform7.com"
66
msgstr ""
67
68
- #: contact-form-7/admin/admin.php:257
69
- msgid "http://contactform7.com/docs/"
70
msgstr ""
71
72
- #: contact-form-7/admin/admin.php:258
73
- msgid "Docs"
74
msgstr ""
75
76
- #: contact-form-7/admin/admin.php:259
77
- msgid "http://contactform7.com/faq/"
78
msgstr ""
79
80
- #: contact-form-7/admin/admin.php:260
81
- msgid "FAQ"
82
msgstr ""
83
84
- #: contact-form-7/admin/admin.php:261
85
- msgid "http://contactform7.com/support/"
86
msgstr ""
87
88
- #: contact-form-7/admin/admin.php:262
89
- msgid "Support"
90
msgstr ""
91
92
- #: contact-form-7/admin/admin.php:276
93
msgid "Contact form created."
94
msgstr ""
95
96
- #: contact-form-7/admin/admin.php:279
97
msgid "Contact form saved."
98
msgstr ""
99
100
- #: contact-form-7/admin/admin.php:282
101
msgid "Contact form deleted."
102
msgstr ""
103
104
- #: contact-form-7/admin/admin.php:316
105
msgid "Contact Form 7 needs your support. Please donate today."
106
msgstr ""
107
108
- #: contact-form-7/admin/admin.php:317
109
msgid "Your contribution is needed for making this plugin better."
110
msgstr ""
111
112
- #: contact-form-7/admin/admin.php:323
113
msgid "http://contactform7.com/donate/"
114
msgstr ""
115
116
- #: contact-form-7/admin/admin.php:323
117
msgid "Donate"
118
msgstr ""
119
120
- #: contact-form-7/admin/admin.php:343
121
#, php-format
122
msgid "<strong>Contact Form 7 %1$s requires WordPress %2$s or higher.</strong> Please <a href=\"%3$s\">update WordPress</a> first."
123
msgstr ""
124
125
- #: contact-form-7/admin/edit.php:20
126
- #: contact-form-7/admin/edit.php:142
127
- #: contact-form-7/admin/edit.php:155
128
- msgid "Add New"
129
- msgstr ""
130
-
131
- #: contact-form-7/admin/edit.php:41
132
msgid "Copy this code and paste it into your post, page or text widget content."
133
msgstr ""
134
135
- #: contact-form-7/admin/edit.php:47
136
msgid "Old code is also available."
137
msgstr ""
138
139
- #: contact-form-7/admin/edit.php:55
140
msgid "Save"
141
msgstr ""
142
143
- #: contact-form-7/admin/edit.php:62
144
msgid "Copy"
145
msgstr ""
146
147
- #: contact-form-7/admin/edit.php:67
148
msgid "Delete"
149
msgstr ""
150
151
- #: contact-form-7/admin/edit.php:69
152
msgid ""
153
"You are about to delete this contact form.\n"
154
" 'Cancel' to stop, 'OK' to delete."
155
msgstr ""
156
157
- #: contact-form-7/admin/edit.php:78
158
msgid "Form"
159
msgstr ""
160
161
- #: contact-form-7/admin/edit.php:81
162
msgid "Mail"
163
msgstr ""
164
165
- #: contact-form-7/admin/edit.php:84
166
msgid "Mail (2)"
167
msgstr ""
168
169
- #: contact-form-7/admin/edit.php:89
170
msgid "Use mail (2)"
171
msgstr ""
172
173
- #: contact-form-7/admin/edit.php:91
174
msgid "Messages"
175
msgstr ""
176
177
- #: contact-form-7/admin/edit.php:94
178
msgid "Additional Settings"
179
msgstr ""
180
181
- #: contact-form-7/admin/edit.php:141
182
#, php-format
183
- msgid "Use the default language (%s)"
184
msgstr ""
185
186
- #: contact-form-7/admin/edit.php:145
187
- msgid "Or"
188
msgstr ""
189
190
- #: contact-form-7/admin/edit.php:150
191
- msgid "(select language)"
192
msgstr ""
193
194
#: contact-form-7/admin/includes/meta-boxes.php:44
@@ -216,337 +266,350 @@ msgid "Use HTML content type"
216
msgstr ""
217
218
#: contact-form-7/admin/includes/meta-boxes.php:80
219
- #: contact-form-7/includes/functions.php:108
220
msgid "Message body:"
221
msgstr ""
222
223
- #: contact-form-7/includes/classes.php:664
224
msgid "Untitled"
225
msgstr ""
226
227
- #: contact-form-7/includes/controller.php:245
228
msgid "Sending ..."
229
msgstr ""
230
231
- #: contact-form-7/includes/functions.php:26
232
msgid "Sender's message was sent successfully"
233
msgstr ""
234
235
- #: contact-form-7/includes/functions.php:27
236
msgid "Your message was sent successfully. Thanks."
237
msgstr ""
238
239
- #: contact-form-7/includes/functions.php:31
240
msgid "Sender's message was failed to send"
241
msgstr ""
242
243
- #: contact-form-7/includes/functions.php:32
244
- #: contact-form-7/modules/akismet.php:109
245
msgid "Failed to send your message. Please try later or contact the administrator by another method."
246
msgstr ""
247
248
- #: contact-form-7/includes/functions.php:36
249
msgid "Validation errors occurred"
250
msgstr ""
251
252
- #: contact-form-7/includes/functions.php:37
253
msgid "Validation errors occurred. Please confirm the fields and submit it again."
254
msgstr ""
255
256
- #: contact-form-7/includes/functions.php:41
257
msgid "There are terms that the sender must accept"
258
msgstr ""
259
260
- #: contact-form-7/includes/functions.php:42
261
msgid "Please accept the terms to proceed."
262
msgstr ""
263
264
- #: contact-form-7/includes/functions.php:46
265
msgid "Email address that the sender entered is invalid"
266
msgstr ""
267
268
- #: contact-form-7/includes/functions.php:47
269
msgid "Email address seems invalid."
270
msgstr ""
271
272
- #: contact-form-7/includes/functions.php:51
273
msgid "There is a field that the sender must fill in"
274
msgstr ""
275
276
- #: contact-form-7/includes/functions.php:52
277
msgid "Please fill the required field."
278
msgstr ""
279
280
- #: contact-form-7/includes/functions.php:76
281
msgid "Your Name"
282
msgstr ""
283
284
- #: contact-form-7/includes/functions.php:76
285
- #: contact-form-7/includes/functions.php:78
286
msgid "(required)"
287
msgstr ""
288
289
- #: contact-form-7/includes/functions.php:78
290
msgid "Your Email"
291
msgstr ""
292
293
- #: contact-form-7/includes/functions.php:80
294
msgid "Subject"
295
msgstr ""
296
297
- #: contact-form-7/includes/functions.php:82
298
msgid "Your Message"
299
msgstr ""
300
301
- #: contact-form-7/includes/functions.php:84
302
msgid "Send"
303
msgstr ""
304
305
- #: contact-form-7/includes/functions.php:92
306
#, php-format
307
msgid "From: %s"
308
msgstr ""
309
310
- #: contact-form-7/includes/functions.php:93
311
#, php-format
312
msgid "Subject: %s"
313
msgstr ""
314
315
- #: contact-form-7/includes/functions.php:94
316
msgid "Message Body:"
317
msgstr ""
318
319
- #: contact-form-7/includes/functions.php:95
320
- #: contact-form-7/includes/functions.php:109
321
#, php-format
322
msgid "This mail is sent via contact form on %1$s %2$s"
323
msgstr ""
324
325
- #: contact-form-7/includes/functions.php:185
326
msgid "Afrikaans"
327
msgstr ""
328
329
- #: contact-form-7/includes/functions.php:186
330
msgid "Albanian"
331
msgstr ""
332
333
- #: contact-form-7/includes/functions.php:187
334
msgid "Arabic"
335
msgstr ""
336
337
- #: contact-form-7/includes/functions.php:188
338
msgid "Armenian"
339
msgstr ""
340
341
- #: contact-form-7/includes/functions.php:189
342
msgid "Azerbaijani"
343
msgstr ""
344
345
- #: contact-form-7/includes/functions.php:190
346
msgid "Bangla"
347
msgstr ""
348
349
- #: contact-form-7/includes/functions.php:191
350
msgid "Belarusian"
351
msgstr ""
352
353
- #: contact-form-7/includes/functions.php:192
354
msgid "Bosnian"
355
msgstr ""
356
357
- #: contact-form-7/includes/functions.php:193
358
msgid "Brazilian Portuguese"
359
msgstr ""
360
361
- #: contact-form-7/includes/functions.php:194
362
msgid "Bulgarian"
363
msgstr ""
364
365
- #: contact-form-7/includes/functions.php:195
366
msgid "Catalan"
367
msgstr ""
368
369
- #: contact-form-7/includes/functions.php:196
370
msgid "Chinese (Simplified)"
371
msgstr ""
372
373
- #: contact-form-7/includes/functions.php:197
374
msgid "Chinese (Traditional)"
375
msgstr ""
376
377
- #: contact-form-7/includes/functions.php:198
378
msgid "Croatian"
379
msgstr ""
380
381
- #: contact-form-7/includes/functions.php:199
382
msgid "Czech"
383
msgstr ""
384
385
- #: contact-form-7/includes/functions.php:200
386
msgid "Danish"
387
msgstr ""
388
389
- #: contact-form-7/includes/functions.php:201
390
msgid "Dutch"
391
msgstr ""
392
393
- #: contact-form-7/includes/functions.php:202
394
msgid "English"
395
msgstr ""
396
397
- #: contact-form-7/includes/functions.php:203
398
msgid "Esperanto"
399
msgstr ""
400
401
- #: contact-form-7/includes/functions.php:204
402
msgid "Estonian"
403
msgstr ""
404
405
- #: contact-form-7/includes/functions.php:205
406
msgid "Finnish"
407
msgstr ""
408
409
- #: contact-form-7/includes/functions.php:206
410
msgid "French"
411
msgstr ""
412
413
- #: contact-form-7/includes/functions.php:207
414
msgid "Galician"
415
msgstr ""
416
417
- #: contact-form-7/includes/functions.php:208
418
msgid "Georgian"
419
msgstr ""
420
421
- #: contact-form-7/includes/functions.php:209
422
msgid "German"
423
msgstr ""
424
425
- #: contact-form-7/includes/functions.php:210
426
msgid "Greek"
427
msgstr ""
428
429
- #: contact-form-7/includes/functions.php:211
430
msgid "Hebrew"
431
msgstr ""
432
433
- #: contact-form-7/includes/functions.php:212
434
msgid "Hindi"
435
msgstr ""
436
437
- #: contact-form-7/includes/functions.php:213
438
msgid "Hungarian"
439
msgstr ""
440
441
- #: contact-form-7/includes/functions.php:214
442
msgid "Indonesian"
443
msgstr ""
444
445
- #: contact-form-7/includes/functions.php:215
446
msgid "Italian"
447
msgstr ""
448
449
- #: contact-form-7/includes/functions.php:216
450
msgid "Japanese"
451
msgstr ""
452
453
- #: contact-form-7/includes/functions.php:217
454
msgid "Korean"
455
msgstr ""
456
457
- #: contact-form-7/includes/functions.php:218
458
msgid "Latvian"
459
msgstr ""
460
461
- #: contact-form-7/includes/functions.php:219
462
msgid "Lithuanian"
463
msgstr ""
464
465
- #: contact-form-7/includes/functions.php:220
466
msgid "Macedonian"
467
msgstr ""
468
469
- #: contact-form-7/includes/functions.php:221
470
msgid "Malay"
471
msgstr ""
472
473
- #: contact-form-7/includes/functions.php:222
474
msgid "Malayalam"
475
msgstr ""
476
477
- #: contact-form-7/includes/functions.php:223
478
msgid "Maltese"
479
msgstr ""
480
481
- #: contact-form-7/includes/functions.php:224
482
msgid "Norwegian"
483
msgstr ""
484
485
- #: contact-form-7/includes/functions.php:225
486
msgid "Persian"
487
msgstr ""
488
489
- #: contact-form-7/includes/functions.php:226
490
msgid "Polish"
491
msgstr ""
492
493
- #: contact-form-7/includes/functions.php:227
494
msgid "Portuguese"
495
msgstr ""
496
497
- #: contact-form-7/includes/functions.php:228
498
msgid "Russian"
499
msgstr ""
500
501
- #: contact-form-7/includes/functions.php:229
502
msgid "Romanian"
503
msgstr ""
504
505
- #: contact-form-7/includes/functions.php:230
506
msgid "Serbian"
507
msgstr ""
508
509
- #: contact-form-7/includes/functions.php:231
510
msgid "Sinhala"
511
msgstr ""
512
513
- #: contact-form-7/includes/functions.php:232
514
msgid "Slovak"
515
msgstr ""
516
517
- #: contact-form-7/includes/functions.php:233
518
msgid "Slovene"
519
msgstr ""
520
521
- #: contact-form-7/includes/functions.php:234
522
msgid "Spanish"
523
msgstr ""
524
525
- #: contact-form-7/includes/functions.php:235
526
msgid "Swedish"
527
msgstr ""
528
529
- #: contact-form-7/includes/functions.php:236
530
msgid "Tamil"
531
msgstr ""
532
533
- #: contact-form-7/includes/functions.php:237
534
msgid "Thai"
535
msgstr ""
536
537
- #: contact-form-7/includes/functions.php:238
538
msgid "Tagalog"
539
msgstr ""
540
541
- #: contact-form-7/includes/functions.php:239
542
msgid "Turkish"
543
msgstr ""
544
545
- #: contact-form-7/includes/functions.php:240
546
msgid "Ukrainian"
547
msgstr ""
548
549
- #: contact-form-7/includes/functions.php:241
550
msgid "Vietnamese"
551
msgstr ""
552
@@ -556,6 +619,12 @@ msgstr ""
556
557
#: contact-form-7/modules/acceptance.php:162
558
#: contact-form-7/modules/captcha.php:212
559
msgid "Name"
560
msgstr ""
561
@@ -570,6 +639,32 @@ msgstr ""
570
#: contact-form-7/modules/captcha.php:248
571
#: contact-form-7/modules/captcha.php:253
572
#: contact-form-7/modules/captcha.php:256