PluginProbe ʕ •ᴥ•ʔ
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More / 1.9.7.2
WPForms – Easy Form Builder for WordPress – Contact Forms, Payment Forms, Surveys, & More v1.9.7.2
1.10.1.1 1.10.1 1.10.0.5 trunk 1.1.4 1.1.4.2 1.1.5 1.1.5.1 1.1.6 1.1.6.1 1.1.7 1.1.7.1 1.1.7.2 1.1.8 1.1.8.1 1.1.8.2 1.1.8.3 1.1.8.4 1.10.0.1 1.10.0.2 1.10.0.3 1.10.0.4 1.2.0 1.2.0.1 1.2.1 1.2.2 1.2.2.1 1.2.2.2 1.2.3 1.2.3.1 1.2.3.2 1.2.4 1.2.4.1 1.2.5 1.2.5.1 1.2.6 1.2.7 1.2.8 1.2.8.1 1.2.9 1.3.0 1.3.1 1.3.1.1 1.3.1.2 1.3.2 1.3.3 1.3.5 1.3.6 1.3.6.1 1.3.6.2 1.3.7.2 1.3.7.3 1.3.7.4 1.3.8 1.3.9.1 1.4.0.1 1.4.1.1 1.4.2 1.4.2.1 1.4.2.2 1.4.3 1.4.4 1.4.4.1 1.4.5 1.4.5.1 1.4.5.2 1.4.5.3 1.4.6 1.4.7.1 1.4.7.2 1.4.8.1 1.4.9 1.5.0.1 1.5.0.3 1.5.0.4 1.5.1 1.5.1.1 1.5.1.3 1.5.2.1 1.5.2.2 1.5.2.3 1.5.3 1.5.3.1 1.5.4.1 1.5.4.2 1.5.5 1.5.5.1 1.5.6 1.5.6.2 1.5.7 1.5.8.2 1.5.9.1 1.5.9.4 1.5.9.5 1.6.0.1 1.6.0.2 1.6.1 1.6.2.2 1.6.2.3 1.6.3.1 1.6.4 1.6.4.1 1.6.5 1.6.6 1.6.7 1.6.7.1 1.6.7.2 1.6.7.3 1.6.8 1.6.8.1 1.6.9 1.7.0 1.7.1.1 1.7.1.2 1.7.2 1.7.2.1 1.7.3 1.7.4 1.7.4.1 1.7.4.2 1.7.5.1 1.7.5.2 1.7.5.3 1.7.5.5 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.7.9.1 1.8.0.1 1.8.0.2 1.8.1.1 1.8.1.2 1.8.1.3 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.3.1 1.8.4 1.8.4.1 1.8.5.2 1.8.5.3 1.8.5.4 1.8.6.2 1.8.6.3 1.8.6.4 1.8.7.2 1.8.8.2 1.8.8.3 1.8.9.1 1.8.9.2 1.8.9.4 1.8.9.5 1.8.9.6 1.9.0.1 1.9.0.2 1.9.0.3 1.9.0.4 1.9.1.1 1.9.1.2 1.9.1.3 1.9.1.4 1.9.1.5 1.9.1.6 1.9.2.1 1.9.2.2 1.9.2.3 1.9.3.1 1.9.3.2 1.9.4.1 1.9.4.2 1.9.5 1.9.5.1 1.9.5.2 1.9.6 1.9.6.1 1.9.6.2 1.9.7.1 1.9.7.2 1.9.7.3 1.9.8.1 1.9.8.2 1.9.8.4 1.9.8.7 1.9.9.2 1.9.9.3 1.9.9.4
wpforms-lite / templates / builder / templates-item.php
wpforms-lite / templates / builder Last commit date
antispam 3 years ago fullscreen 2 years ago notifications 2 years ago payment 1 year ago revisions 2 years ago themes 10 months ago field-context-menu.php 2 years ago help.php 3 years ago templates-item.php 2 years ago
templates-item.php
131 lines
1 <?php
2 /**
3 * Panel Setup (form templates).
4 * Form templates list item template.
5 *
6 * @since 1.6.8
7 * @since 1.8.4 Added subcategories attribute.
8 * @since 1.8.6 Added fields attribute.
9 * @since 1.8.8 Added edit button attributes.
10 *
11 * @var bool $selected Is template selected.
12 * @var string $license_class License class (in the case of higher license needed).
13 * @var string $categories Categories, coma separated.
14 * @var string $subcategories Subcategories, comma separated.
15 * @var string $fields Fields, comma separated.
16 * @var string $badge_text Badge text.
17 * @var string $demo_url Template demo URL.
18 * @var string $template_id Template ID (Slug or ID if available).
19 * @var string $education_class Education class (in the case of higher license needed).
20 * @var string $education_attributes Education attributes.
21 * @var string $addons_attributes Required addons attributes.
22 * @var array $template Template data.
23 * @var string $action_text Template action button text.
24 * @var string $create_url User template creation URL.
25 * @var string $edit_url User template edit URL.
26 * @var string $edit_action_text User template edit button text.
27 * @var string $badge_class Badge class in case if there is any badge text exists.
28 * @var bool $can_create Capability to create forms.
29 * @var bool $can_edit Capability to edit forms (more granular for template - own, others).
30 * @var bool $can_delete Capability to delete forms (more granular for template - own, others).
31 * @var bool $is_open Is user template currently open in the builder.
32 * @var int $post_id Post ID.
33 */
34
35 use WPForms\Admin\Education\Helpers;
36
37 if ( ! defined( 'ABSPATH' ) ) {
38 exit;
39 }
40
41 $user_template_class = $template['source'] === 'wpforms-user-template' ? ' wpforms-user-template' : '';
42
43 ?>
44 <div class="wpforms-template<?php echo esc_attr( $user_template_class ); ?><?php echo esc_attr( $license_class ); ?><?php echo esc_attr( $badge_class ); ?>"
45 id="wpforms-template-<?php echo sanitize_html_class( $template['slug'] ); ?>"
46 <?php echo $template['source'] === 'wpforms-user-template' ? 'data-template-id="' . esc_attr( $post_id ) . '"' : ''; ?>>
47
48 <div class="wpforms-template-thumbnail">
49 <?php if ( empty( $template['thumbnail'] ) ) { ?>
50 <div class="wpforms-template-thumbnail-placeholder">
51 <?php if ( $template['slug'] === 'blank' ) { ?>
52 <img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-file.svg' ); ?>" alt="Blank Form Template" loading="lazy" />
53 <?php } elseif ( $template['source'] === 'wpforms-user-template' ) { ?>
54 <img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-user-template.svg' ); ?>" alt="User Form Template" loading="lazy" />
55 <?php } else { ?>
56 <img src="<?php echo esc_url( WPFORMS_PLUGIN_URL . 'assets/images/icon-wpforms.svg' ); ?>" alt="Customizable Form Template" loading="lazy" />
57 <?php } ?>
58 </div>
59 <?php } else { ?>
60 <img src="<?php echo esc_url( $template['thumbnail'] ); ?>" alt="<?php echo esc_attr( $template['name'] ); ?> Template" loading="lazy" />
61 <?php } ?>
62 </div>
63
64 <!-- As requirement for Lists.js library data attribute slug is used in classes list. -->
65 <h3 class="wpforms-template-name categories has-access favorite slug subcategories fields"
66 data-categories="<?php echo esc_attr( $categories ); ?>"
67 data-subcategories="<?php echo esc_attr( $subcategories ); ?>"
68 data-fields="<?php echo esc_attr( $fields ); ?>"
69 data-has-access="<?php echo esc_attr( $template['has_access'] ); ?>"
70 data-favorite="<?php echo esc_attr( $template['favorite'] ); ?>"
71 data-slug="<?php echo esc_attr( $template['slug'] ); ?>"
72 >
73 <?php echo esc_html( $template['name'] ); ?>
74 </h3>
75
76 <?php if ( $template['source'] === 'wpforms-user-template' && $can_delete ) : ?>
77 <span class="wpforms-template-remove" data-template="<?php echo esc_attr( $post_id ); ?>">
78 <i class="fa fa-trash-o" title="<?php esc_attr_e( 'Delete', 'wpforms-lite' ); ?>"></i>
79 </span>
80 <?php elseif ( $template['source'] !== 'wpforms-user-template' ) : ?>
81 <span class="wpforms-template-favorite">
82 <?php if ( $can_create ) : ?>
83 <i class="fa fa-heart <?php echo $template['favorite'] ? '' : 'wpforms-hidden'; ?>" title="<?php esc_attr_e( 'Remove from Favorites', 'wpforms-lite' ); ?>"></i>
84 <i class="fa fa-heart-o <?php echo $template['favorite'] ? 'wpforms-hidden' : ''; ?>" title="<?php esc_attr_e( 'Mark as Favorite', 'wpforms-lite' ); ?>"></i>
85 <?php endif; ?>
86 </span>
87 <?php endif; ?>
88
89 <?php
90 if ( ! empty( $badge_text ) && ! $selected ) {
91 Helpers::print_badge( $badge_text, 'sm', 'corner', 'steel', 'rounded-bl' );
92 }
93 ?>
94
95 <p class='wpforms-template-desc'>
96 <?php echo esc_html( $template['description'] ); ?>
97 </p>
98
99 <?php if ( $can_create ) : ?>
100 <div class="wpforms-template-buttons">
101 <a href="#" class="wpforms-template-select wpforms-btn wpforms-btn-md wpforms-btn-orange<?php echo esc_attr( $education_class ); ?>"
102 data-template-name-raw="<?php echo esc_attr( $template['name'] ); ?>"
103 data-template="<?php echo esc_attr( $template_id ); ?>"
104 data-slug="<?php echo esc_attr( $template['slug'] ); ?>"
105 data-create-url="<?php echo esc_url( $create_url ); ?>"
106 <?php echo $education_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
107 <?php echo $addons_attributes; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>>
108 <?php echo esc_html( $action_text ); ?>
109 </a>
110
111 <?php if ( $template['url'] !== '' ) : ?>
112 <a class="wpforms-template-demo wpforms-btn wpforms-btn-md wpforms-btn-light-grey"
113 href="<?php echo esc_url( $demo_url ); ?>"
114 target="_blank" rel="noopener noreferrer">
115 <?php esc_html_e( 'View Demo', 'wpforms-lite' ); ?>
116 </a>
117 <?php endif; ?>
118
119 <?php if ( ! empty( $edit_url ) && $can_edit ) : ?>
120 <a class="wpforms-template-edit wpforms-btn wpforms-btn-md wpforms-btn-light-grey"
121 href="<?php echo esc_url( $edit_url ); ?>">
122 <?php echo esc_html( $edit_action_text ); ?>
123 </a>
124 <?php endif; ?>
125 </div>
126 <?php else : ?>
127 <span class="wpforms-template-select" data-template="<?php echo esc_attr( $template_id ); ?>"></span>
128 <?php endif; ?>
129
130 </div>
131