PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.13
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.13
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / views / form-templates / template.php

template.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.13, at classes/views/form-templates/template.php

101 lines 3.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Form Templates - Template.
4 *
5 * @package Formidable
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 die( 'You are not allowed to call this page directly.' );
10 }
11
12 if ( ! is_array( $template ) ) {
13 return;
14 }
15
16 if ( ! empty( $template['message'] ) ) {
17 ?>
18 <li class="frm_error_style inline">
19 <?php
20 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
21 echo FrmAppHelper::kses( $template['message'], array( 'a', 'b', 'strong', 'br' ) );
22 ?>
23 </li>
24 <?php
25 return;
26 }
27
28 FrmFormTemplatesHelper::prepare_template_details( $template, $pricing, $license_type );
29 ?>
30 <li <?php FrmFormTemplatesHelper::add_template_attributes( $template, $expired ); ?>>
31 <?php if ( $template['is_featured'] ) : ?>
32 <div class="frm-form-templates-item-icon">
33 <?php FrmFormsHelper::template_icon( $template['categories'] ); ?>
34 </div>
35 <?php endif; ?>
36
37 <div class="frm-form-templates-item-body">
38 <h3 class="frm-form-templates-item-title frm-font-medium">
39 <span class="frm-form-templates-item-title-text">
40 <?php if ( $template['plan_required'] ) { ?>
41 <span class="frm-form-templates-item-lock-icon">
42 <?php FrmAppHelper::icon_by_class( 'frmfont frm_lock_icon', array( 'aria-label' => __( 'Lock icon', 'formidable' ) ) ); ?>
43 </span>
44 <?php } ?>
45
46 <span class="frm-form-template-name">
47 <?php echo esc_html( $template['name'] ); ?>
48 </span>
49 </span>
50
51 <span class="frm-flex-box frm-gap-xs frm-items-center frm-ml-auto">
52 <?php
53 if ( $template['is_custom'] ) {
54 $trash_links = FrmFormsHelper::delete_trash_links( $template['id'] );
55 ?>
56 <a href="<?php echo esc_url( $trash_links['trash']['url'] ); ?>" class="frm-form-templates-custom-item-trash-button frm-flex-center frm-fadein" data-frmverify="<?php esc_attr_e( 'Do you want to move this form template to the trash?', 'formidable' ); ?>" data-frmverify-btn="frm-button-red" role="button" aria-label="<?php esc_attr_e( 'Move to the trash button', 'formidable' ); ?>">
57 <?php FrmAppHelper::icon_by_class( 'frmfont frm_delete_icon', array( 'aria-label' => __( 'Move to Trash', 'formidable' ) ) ); ?>
58 </a>
59 <span class="frm-vertical-line frm-fadein"></span>
60 <?php } ?>
61
62 <a href="#" class="frm-form-templates-item-favorite-button frm-fadein" role="button" aria-label="<?php esc_attr_e( 'Add to favorites', 'formidable' ); ?>">
63 <?php
64 $favorite_button_icon = $template['is_favorite'] ? 'frm_heart_solid_icon' : 'frm_heart_icon';
65 FrmAppHelper::icon_by_class( 'frmfont ' . $favorite_button_icon );
66 ?>
67 </a>
68 </span>
69 </h3>
70
71 <div class="frm-form-templates-item-content">
72 <div class="frm-form-templates-item-buttons frm-fadein-down-short">
73 <a <?php FrmFormTemplatesHelper::add_template_link_attributes( $template ); ?>>
74 <?php echo $template['is_custom'] ? esc_html__( 'Edit', 'formidable' ) : esc_html__( 'View Demo', 'formidable' ); ?>
75 </a>
76 <a href="<?php echo esc_url( $template['use_template'] ); ?>" class="button button-primary frm-button-primary frm-small frm-form-templates-use-template-button" role="button">
77 <?php esc_html_e( 'Use Template', 'formidable' ); ?>
78 </a>
79 </div>
80
81 <p class="frm-form-templates-item-description">
82 <?php
83 if ( $template['description'] ) {
84 echo FrmAppHelper::kses( $template['description'], array( 'a', 'i', 'span', 'use', 'svg' ) ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
85 } elseif ( $template['is_custom'] ) {
86 echo '<i>';
87 printf(
88 /* translators: %s: date */
89 esc_html__( 'Created %s', 'formidable' ),
90 esc_html( date_i18n( get_option( 'date_format' ), strtotime( $template['created_at'] ) ) )
91 );
92 echo '</i>';
93 } else {
94 echo '<i>' . esc_html__( 'No description', 'formidable' ) . '</i>';
95 }
96 ?>
97 </p>
98 </div>
99 </div>
100 </li>
101