GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
radio.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the radio field type
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates/fields
7  */
8 
10 
11 extract( $gravityview_view->getCurrentField() );
12 
13 $display_type = isset( $field_settings['choice_display'] ) ? $field_settings['choice_display'] : 'value';
14 
15 $output = '';
16 
17 if( floatval( $field_id ) === floor( floatval( $field_id ) ) ) {
18 
19  if( 'value' === $display_type ) {
20  // For the complete field value
21  $output = $display_value;
22  } else {
23  $output = RGFormsModel::get_choice_text( $field, $display_value );
24  }
25 } else {
26  // For part of the field value
27  $entry_keys = array_keys( $entry );
28  foreach( $entry_keys as $input_key ) {
29  if( is_numeric( $input_key ) && floatval( $input_key ) === floatval( $field_id ) ) {
30  if( in_array( $field['type'], array( 'radio', 'checkbox' ) ) && !empty( $entry[ $input_key ] ) ) {
31  $output = apply_filters( 'gravityview_field_tick', '<span class="dashicons dashicons-yes"></span>', $entry, $field);
32  } else {
33  $output = $entry[ $input_key ];
34  }
35  }
36  }
37 }
38 
39 echo $output;
$output
Definition: radio.php:15
$field_settings['content']
Definition: custom.php:27
$gravityview_view
Definition: radio.php:9
$display_type
Definition: radio.php:13
$field_id
Definition: time.php:17
static getInstance($passed_post=NULL)
$entry
Definition: notes.php:27
$field
Definition: gquiz_grade.php:11