GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
type_checkbox.php
Go to the documentation of this file.
1 <?php
2 /**
3  * checkbox input type
4  */
6 
7  function render_option() {
8  ?>
9  <label for="<?php echo $this->get_field_id(); ?>" class="<?php echo $this->get_label_class(); ?>">
10  <?php $this->render_input(); ?>
11  &nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
12  </label>
13  <?php
14  }
15 
16  function render_setting( $override_input = NULL ) {
17 
18  if( $this->get_field_left_label() ) { ?>
19 
20  <td scope="row">
21  <label for="<?php echo $this->get_field_id(); ?>">
22  <?php echo $this->get_field_left_label() . $this->get_tooltip(); ?>
23  </label>
24  </td>
25  <td>
26  <label>
27  <?php $this->render_input( $override_input ); ?>
28  &nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
29  </label>
30  </td>
31 
32  <?php } else { ?>
33 
34  <td scope="row" colspan="2">
35  <label for="<?php echo $this->get_field_id(); ?>">
36  <?php $this->render_input( $override_input ); ?>
37  &nbsp;<?php echo $this->get_field_label() . $this->get_tooltip() . $this->get_field_desc(); ?>
38  </label>
39  </td>
40 
41  <?php }
42  }
43 
44  function render_input( $override_input = NULL ) {
45  if( isset( $override_input ) ) {
46  echo $override_input;
47  return;
48  }
49 
50  ?>
51  <input name="<?php echo esc_attr( $this->name ); ?>" type="hidden" value="0" />
52  <input name="<?php echo esc_attr( $this->name ); ?>" id="<?php echo $this->get_field_id(); ?>" type="checkbox" value="1" <?php checked( $this->value, '1', true ); ?> />
53  <?php
54  }
55 
56 }
get_field_desc()
Retrieve field description.
render_input($override_input=NULL)
Modify option field type by extending this class.
get_field_left_label()
Retrieve field left label.
render_setting($override_input=NULL)
get_field_label()
Retrieve field label.