PluginProbe
Smart Grid-Layout Design for Contact Form 7 / 3.3.3
Smart Grid-Layout Design for Contact Form 7 v3.3.3
4.18.0 4.17.0 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 4.0.0 4.0.1 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4 4.10 4.11 4.12 4.13 4.14 All 119 releases
cf7-grid-layout / public / partials / cf7-benchmark-tag.php

cf7-benchmark-tag.php in Smart Grid-Layout Design for Contact Form 7 3.3.3, at public/partials/cf7-benchmark-tag.php

52 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Provide a public-facing view for the plugin
5 *
6 * This file is used to markup the public-facing aspects of the plugin.
7 *
8 * @link http://syllogic.in
9 * @since 1.0.0
10 *
11 * @package Cf7_Grid_Layout
12 * @subpackage Cf7_Grid_Layout/public/partials
13 */
14 $validation_error = wpcf7_get_validation_error( $tag->name );
15 $class = wpcf7_form_controls_class( $tag->type, 'cf7sg-benchmark' );
16 if ( $validation_error ) {
17 $class .= ' wpcf7-not-valid';
18 }
19 $class = $tag->get_class_option( $class );
20 $id = $tag->get_id_option();
21 if(!empty($id)) $id = 'id="'.$id.'"';
22 $data_limit = '';
23 $data_warn = '';
24 $input_type = 'number';
25 if(!empty($tag->values)){
26 foreach($tag->values as $values){
27 if(0 === strpos($values, 'above:') ){
28 $data_limit = 'data-cf7sg-benchmark="above" data-cf7sg-benchmark-limit="'.str_replace('above:', '', $values).'"';
29 }
30 if(0 === strpos($values, 'below:')){
31 $data_limit = 'data-cf7sg-benchmark="below" data-cf7sg-benchmark-limit="'.str_replace('below:', '', $values).'"';
32 }
33 if(0 === strpos($values, 'between:')){
34 $range = explode(":", str_replace('between:', '', $values));
35 $data_limit = 'data-cf7sg-benchmark="range" data-cf7sg-benchmark-min="'.$range[0].'" data-cf7sg-benchmark-max="'.$range[1].'"';
36 }
37 if(0 === strpos($values, 'warn:')){
38 $data_warn = 'data-cf7sg-benchmark-msg="'.str_replace('warn:', '', $values).'"';
39 }
40 if(0 === strpos($values, 'hidden:')){
41 $input_type = ("true" === str_replace('hidden:', '', $values))?'hidden':'number';
42 }
43 }
44
45 }
46 //debug_msg($tag->name." input:".'<input '.$id.' name="'. $tag->name .'" class="'. $class.'" '. $data_limit.' '. $data_warn.' type="'. $input_type .'" />');
47 $tag_name = sanitize_html_class( $tag->name );
48 ?>
49 <span class="wpcf7-form-control-wrap <?= $tag_name ?>">
50 <input <?= $id?> name="<?= $tag->name ?>" class="<?= $class?>" <?= $data_limit?> <?= $data_warn?> type="<?= $input_type ?>" />
51 </span>
52