GravityView  2.17
The best, easiest way to display Gravity Forms entries on your website.
deprecated/table-body.php
Go to the documentation of this file.
1 <?php
2 /**
3  * Display the entry loop when using a table template
4  *
5  * @package GravityView
6  * @subpackage GravityView/templates
7  *
8  * @global GravityView_View $this
9  */
10 ?>
11  <tbody>
12  <?php
13 
14  /**
15  * @action `gravityview_table_body_before` Inside the `tbody`, before any rows are rendered. Can be used to insert additional rows.
16  * @since 1.0.7
17  * @param \GravityView_View $this Current GravityView_View object
18  */
19  do_action('gravityview_table_body_before', $this );
20 
21  if( 0 === $this->getTotalEntries() ) {
22 
23  $directory_table_columns = $this->getFields('directory_table-columns');
24  ?>
25  <tr>
26  <?php do_action('gravityview_table_tr_before', $this ); ?>
27  <td colspan="<?php echo $directory_table_columns ? sizeof( $directory_table_columns ) : ''; ?>" class="gv-no-results">
28  <?php echo gv_no_results(); ?>
29  </td>
30  <?php do_action('gravityview_table_tr_after', $this ); ?>
31  </tr>
32  <?php
33  } else {
34 
35  foreach( $this->getEntries() as $entry ) :
36 
37  $this->setCurrentEntry( $entry );
38 
39  // Add `alt` class to alternate rows
40  $alt = empty( $alt ) ? 'alt' : '';
41 
42  /**
43  * @filter `gravityview_entry_class` Modify the class applied to the entry row
44  * @param string $alt Existing class. Default: if odd row, `alt`, otherwise empty string.
45  * @param array $entry Current entry being displayed
46  * @param \GravityView_View $this Current GravityView_View object
47  */
48  $class = apply_filters( 'gravityview_entry_class', $alt, $entry, $this );
49  ?>
50  <tr<?php echo ' class="'.esc_attr( $class ).'"'; ?>>
51  <?php
52  /**
53  * @action `gravityview_table_cells_before` Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
54  * @since 1.0.7
55  * @param \GravityView_View $this Current GravityView_View object
56  */
57  do_action('gravityview_table_cells_before', $this );
58 
59  $this->renderZone( 'columns', array(
60  'markup' => '<td id="{{ field_id }}" class="{{class}}">{{value}}</td>',
61  'hide_empty' => false, // Always show <td>
62  ));
63 
64  /**
65  * @action gravityview_table_cells_after Inside the `tr` while rendering each entry in the loop. Can be used to insert additional table cells.
66  *
67  * @since 1.0.7
68  *
69  * @param \GravityView_View $this Current GravityView_View object
70  */
71  do_action('gravityview_table_cells_after', $this );
72  ?>
73  </tr>
74  <?php
76 
77  }
78 
79  /**
80  * @action `gravityview_table_body_after` Inside the `tbody`, after all rows are rendered. Can be used to insert additional rows.
81  * @since 1.0.7
82  */
83  do_action('gravityview_table_body_after', $this );
84  ?>
85  </tbody>
gv_no_results( $wpautop=true, $context=null)
Definition: class-api.php:942
$entry
Definition: notes.php:27