GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
type_checkboxes.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Checkboxes input type - show a group of checkboxes
4  * Supports a "requires", which is the name of another checkbox in the same setting. If set, the checkbox will be shown only if "requires" checkbox is checked as well.
5  * @since 1.17
6  */
8 
9  function render_option() {
10  ?>
11  <fieldset class="<?php echo $this->get_label_class(); ?>">
12  <legend><span class="gv-label"><?php echo $this->get_field_label(); ?></span></legend>
13  <?php
14 
15  echo $this->get_tooltip() . $this->get_field_desc();
16 
17  $this->render_input();
18 
19  ?>
20  </fieldset>
21  <?php
22  }
23 
24  function render_input( $override_input = null ) {
25  if( isset( $override_input ) ) {
26  echo $override_input;
27  return;
28  }
29 
30  ?>
31  <ul class="gv-setting-list">
32  <?php
33  foreach( $this->field['options'] as $value => $label ) { ?>
34  <li <?php if( isset( $label['requires'] ) ) { printf( 'class="gv-sub-setting" data-requires="%s"', $label['requires'] ); } ?>>
35  <label>
36  <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>" type="hidden"
37  value="0"/>
38  <input name="<?php printf( '%s[%s]', esc_attr( $this->name ), esc_attr( $value ) ); ?>"
39  id="<?php echo $this->get_field_id(); ?>" type="checkbox"
40  value="1" <?php checked( ! empty( $this->value[ $value ] ) ); ?> />
41  <?php echo esc_html( $label['label'] ); ?>
42  </label>
43  <?php if( ! empty( $label['desc'] ) ) {
44  printf( '<span class="howto">%s</span>', $label['desc'] );
45  }
46  ?>
47  </li>
48  <?php
49  }
50  ?>
51  </ul>
52  <?php
53  }
54 
55 }
get_field_desc()
Retrieve field description.
Checkboxes input type - show a group of checkboxes Supports a "requires", which is the name of anothe...
Modify option field type by extending this class.
scale description ul
render_input( $override_input=null)
get_field_label()
Retrieve field label.