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.7 0.2 0.2.1 0.2.2 0.2.3
cf7-conditional-fields / tg_pane_group.php
cf7-conditional-fields Last commit date
js 19 hours ago jsdoc-out 19 hours ago test-results 2 months ago Wpcf7cfMailParser.php 3 days ago admin-style.css 2 years ago admin-style.css.map 2 years ago admin-style.scss 4 years ago admin.php 19 hours ago cf7cf.php 2 weeks ago conditional-fields.php 19 hours ago contact-form-7-conditional-fields.php 1 year ago init.php 19 hours ago readme.txt 19 hours ago style.css 2 months ago tg_pane_group.php 2 months ago wpcf7cf-options.php 2 months ago
tg_pane_group.php
153 lines
1 <?php
2 /**
3 ** A base module for [group]
4 **/
5
6 /* form_tag handler */
7
8 add_action( 'wpcf7_init', 'wpcf7_add_form_tag_group', 10, 0 );
9
10 function wpcf7_add_form_tag_group() {
11 wpcf7_add_form_tag( 'group',
12 'wpcf7_group_form_tag_handler',
13 array(
14 'name-attr' => true,
15 'selectable-values' => true,
16 )
17 );
18 }
19
20 function wpcf7_group_form_tag_handler( $tag ) {
21 // Frontend output code comes here
22 }
23
24
25 /* Validation filter */
26
27 add_filter( 'wpcf7_validate_group',
28 'wpcf7_group_validation_filter', 10, 2 );
29
30 function wpcf7_group_validation_filter( $result, $tag ) {
31 // Frontend validation code comes here
32 }
33
34
35 /* Tag generator */
36
37 add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_group', 600, 0 );
38
39 function wpcf7_add_tag_generator_group() {
40 $tag_generator = WPCF7_TagGenerator::get_instance();
41
42 do_action('wpcf7cf_tag_generator');
43
44 $tag_generator->add( 'group', __( 'Conditional group', 'cf7-conditional-fields' ),
45 'wpcf7_tag_generator_group',
46 array( 'version' => '2' )
47 );
48 }
49
50 function wpcf7_tag_generator_group( $contact_form, $options ) {
51 $field_types = array(
52 'group' => array(
53 'display_name' => __( 'Conditional group', 'cf7-conditional-fields' ),
54 'heading' => __( 'Conditional group form-tag generator', 'cf7-conditional-fields' ),
55 'description' => __( 'Generates the opening and closing form-tag for a Conditional group.', 'cf7-conditional-fields' ),
56 ),
57 );
58
59 $tgg = new WPCF7_TagGeneratorGenerator( $options['content'] );
60
61 ?>
62 <header class="description-box">
63 <h3><?php
64 echo esc_html( $field_types['group']['heading'] );
65 ?></h3>
66
67 <p><?php
68 $description = wp_kses(
69 $field_types['group']['description'],
70 array(
71 'a' => array( 'href' => true ),
72 'strong' => array(),
73 ),
74 array( 'http', 'https' )
75 );
76
77 echo $description;
78 ?></p>
79 </header>
80
81 <div class="control-box">
82 <fieldset style="display:none;">
83 <legend id="<?php echo esc_attr( $tgg->ref( 'type-legend' ) ); ?>"><?php
84 echo esc_html( __( 'Field type', 'contact-form-7' ) );
85 ?></legend>
86
87 <select data-tag-part="basetype" aria-labelledby="<?php echo esc_attr( $tgg->ref( 'type-legend' ) ); ?>"><?php
88 echo sprintf(
89 '<option %1$s>%2$s</option>',
90 wpcf7_format_atts( array(
91 'value' => 'group',
92 ) ),
93 esc_html( $field_types['group']['display_name'] )
94 );
95 ?></select>
96
97 </fieldset>
98
99 <fieldset>
100 <legend id="tag-generator-panel-group-name-legend">Group name</legend>
101 <input type="text" data-tag-part="name" pattern="[A-Za-z][A-Za-z0-9_\-]*" aria-labelledby="tag-generator-panel-group-name-legend">
102 </fieldset>
103
104
105 <fieldset>
106 <legend id="<?php echo esc_attr( $tgg->ref( 'type-legend' ) ); ?>"><?php
107 echo esc_html( __( 'Options', 'cf7-conditional-fields' ) );
108 ?></legend>
109 <label>
110 <input type="checkbox" data-tag-part="option" data-tag-option="clear_on_hide" />
111 <strong>clear_on_hide</strong> (<?php echo esc_html( __( "clear inner fields when this group is hidden", 'cf7-conditional-fields' ) ); ?>)
112 </label>
113 <br>
114 <label>
115 <input type="checkbox" data-tag-part="option" data-tag-option="inline" />
116 <strong>inline</strong> (<?php echo esc_html( __( "use <span> instead of <div>", 'cf7-conditional-fields' ) ); ?>)
117 </label>
118 <?php if (WPCF7CF_IS_PRO) { ?>
119 <br>
120 <label>
121 <input type="checkbox" data-tag-part="option" data-tag-option="disable_on_hide" />
122 <strong>disable_on_hide</strong> (<?php echo esc_html( __( "disable inner fields when this group is hidden", 'cf7-conditional-fields' ) ); ?>)
123 </label>
124 <?php } ?>
125 </fieldset>
126
127 <?php
128
129 $tgg->print( 'class_attr' );
130 ?>
131
132 <?php
133 echo sprintf(
134 '<input %s />',
135 wpcf7_format_atts( array(
136 'type' => 'hidden',
137 'required' => false,
138 'value' => '',
139 'data-tag-part' => 'content',
140 ) )
141 );
142 ?>
143 </div>
144
145 <footer class="insert-box">
146 <?php
147 $tgg->print( 'insert_box_content' );
148 ?>
149 <p class="mail-tag-tip">To show conditional information in the email, put it between <strong data-tag-part="mail-tag">[group-455]</strong> and <strong data-tag-part="mail-tag-closed">[/group-455]</strong> in the email template.</p>
150 </footer>
151 <?php
152 }
153