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.8.1 3.9 3.9-beta 3.9.1 3.9.2 3.9.3 4.0 4.0.1 4.0.2 4.0.3 4.1 4.1-beta 4.1.1 4.1.2 4.2 4.2-beta 4.2.1 4.2.2 4.3 4.3.1 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6 4.6.1 4.7 4.8 4.8.1 4.9 4.9.1 4.9.2 5.0 5.0.1
contact-form-7 / modules / submit.php
contact-form-7 / modules Last commit date
acceptance.php 15 years ago akismet.php 14 years ago captcha.php 15 years ago checkbox.php 15 years ago file.php 14 years ago quiz.php 15 years ago response.php 15 years ago select.php 14 years ago special-mail-tags.php 14 years ago submit.php 15 years ago text.php 15 years ago textarea.php 14 years ago
submit.php
97 lines
1 <?php
2 /**
3 ** A base module for [submit]
4 **/
5
6 /* Shortcode handler */
7
8 wpcf7_add_shortcode( 'submit', 'wpcf7_submit_shortcode_handler' );
9
10 function wpcf7_submit_shortcode_handler( $tag ) {
11 if ( ! is_array( $tag ) )
12 return '';
13
14 $options = (array) $tag['options'];
15 $values = (array) $tag['values'];
16
17 $atts = '';
18 $id_att = '';
19 $class_att = '';
20 $tabindex_att = '';
21
22 $class_att .= ' wpcf7-submit';
23
24 foreach ( $options as $option ) {
25 if ( preg_match( '%^id:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
26 $id_att = $matches[1];
27
28 } elseif ( preg_match( '%^class:([-0-9a-zA-Z_]+)$%', $option, $matches ) ) {
29 $class_att .= ' ' . $matches[1];
30
31 } elseif ( preg_match( '%^tabindex:(\d+)$%', $option, $matches ) ) {
32 $tabindex_att = (int) $matches[1];
33
34 }
35 }
36
37 if ( $id_att )
38 $atts .= ' id="' . trim( $id_att ) . '"';
39
40 if ( $class_att )
41 $atts .= ' class="' . trim( $class_att ) . '"';
42
43 if ( '' !== $tabindex_att )
44 $atts .= sprintf( ' tabindex="%d"', $tabindex_att );
45
46 $value = isset( $values[0] ) ? $values[0] : '';
47 if ( empty( $value ) )
48 $value = __( 'Send', 'wpcf7' );
49
50 $html = '<input type="submit" value="' . esc_attr( $value ) . '"' . $atts . ' />';
51
52 if ( wpcf7_script_is() ) {
53 $src = apply_filters( 'wpcf7_ajax_loader', wpcf7_plugin_url( 'images/ajax-loader.gif' ) );
54 $html .= '<img class="ajax-loader" style="visibility: hidden;" alt="' . esc_attr( __( 'Sending ...', 'wpcf7' ) ) . '" src="' . esc_url_raw( $src ) . '" />';
55 }
56
57 return $html;
58 }
59
60
61 /* Tag generator */
62
63 add_action( 'admin_init', 'wpcf7_add_tag_generator_submit', 55 );
64
65 function wpcf7_add_tag_generator_submit() {
66 wpcf7_add_tag_generator( 'submit', __( 'Submit button', 'wpcf7' ),
67 'wpcf7-tg-pane-submit', 'wpcf7_tg_pane_submit', array( 'nameless' => 1 ) );
68 }
69
70 function wpcf7_tg_pane_submit( &$contact_form ) {
71 ?>
72 <div id="wpcf7-tg-pane-submit" class="hidden">
73 <form action="">
74 <table>
75 <tr>
76 <td><code>id</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
77 <input type="text" name="id" class="idvalue oneline option" /></td>
78
79 <td><code>class</code> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
80 <input type="text" name="class" class="classvalue oneline option" /></td>
81 </tr>
82
83 <tr>
84 <td><?php echo esc_html( __( 'Label', 'wpcf7' ) ); ?> (<?php echo esc_html( __( 'optional', 'wpcf7' ) ); ?>)<br />
85 <input type="text" name="values" class="oneline" /></td>
86
87 <td></td>
88 </tr>
89 </table>
90
91 <div class="tg-tag"><?php echo esc_html( __( "Copy this code and paste it into the form left.", 'wpcf7' ) ); ?><br /><input type="text" name="submit" class="tag" readonly="readonly" onfocus="this.select()" /></div>
92 </form>
93 </div>
94 <?php
95 }
96
97 ?>