GravityView  1.19.4
The best, easiest way to display Gravity Forms entries on your website.
select-template.php
Go to the documentation of this file.
1 <?php
2 /**
3  * @file select-template.php
4  * @package GravityView
5  * @subpackage Gravityview/admin/metaboxes/partials
6  * @global WP_Post $post
7  */
8 
9 global $post;
10 
11 // Use nonce for verification
12 wp_nonce_field( 'gravityview_select_template', 'gravityview_select_template_nonce' );
13 
14 //current value
16 
18 
19 // current input
20 ?>
21 <input type="hidden" id="gravityview_directory_template" name="gravityview_directory_template" value="<?php echo esc_attr( $current_template ); ?>" />
22 
23 <?php // list all the available templates (type= fresh or custom ) ?>
24 <div class="gv-grid">
25  <?php foreach( $templates as $id => $template ) {
26  $selected = ( $id == $current_template ) ? ' gv-selected' : ''; ?>
27 
28  <div class="gv-grid-col-1-3">
29  <div class="gv-view-types-module<?php echo $selected; ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
30  <div class="gv-view-types-hover">
31  <div>
32  <?php if( !empty( $template['buy_source'] ) ) { ?>
33  <p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button-primary button-buy-now"><?php esc_html_e( 'Buy Now', 'gravityview'); ?></a></p>
34  <?php } else { ?>
35  <p><a href="#gv_select_template" class="button button-large button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gravityview'); ?></a></p>
36  <?php if( !empty( $template['preview'] ) ) { ?>
37  <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-admin-links" title="<?php esc_html_e( 'View a live demo of this preset', 'gravityview'); ?>"></i></a>
38  <?php } ?>
39  <?php } ?>
40  </div>
41  </div>
42  <div class="gv-view-types-normal">
43  <img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
44  <h5><?php echo esc_attr( $template['label'] ); ?></h5>
45  <p class="description"><?php echo esc_attr( $template['description'] ); ?></p>
46  </div>
47  </div>
48  </div>
49  <?php } ?>
50 </div>
gravityview_get_template_id($post_id)
Get the template ID (list, table, datatables, map) for a View.
$templates
$current_template
gravityview_get_registered_templates()
Get all available preset templates.
global $post