PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.1
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.1
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / assets / components / template-modal / template.php

template.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.1, at assets/components/template-modal/template.php

113 lines 5.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <div class="wefroms-form-templates">
2 <wpuf-modal :show.sync="show" :onClose="onClose">
3 <h2 slot="header">
4 <?php _e( 'Select a Template', 'weforms' ); ?>
5 <small><?php printf( __( 'Select from a pre-defined template or from a <a href="#" %s>blank form</a>', 'weforms' ), '@click.prevent="blankForm()"' ); ?></small>
6
7 <span class="choose-form-categroy">
8 <?php _e( 'Select Category', 'weforms' ); ?> &nbsp;
9 <select v-model="category">
10 <option value="all">All</option>
11 <?php
12 $registry = weforms()->templates->get_templates();
13 $categories = weforms_get_form_template_categories();
14 $colors = weforms_get_flat_ui_colors();
15
16 foreach ( $categories as $key => $category ) {
17 printf( '<option value="%s">%s</option>', $key, $category['name'] );
18 }
19 ?>
20 </select>
21 </span>
22 </h2>
23
24 <div slot="body">
25
26 <?php
27
28 // remove the blank form from index as it's handled separately
29 if ( array_key_exists( 'blank', $registry ) ) {
30 unset( $registry['blank'] );
31 }
32
33 foreach ( $categories as $category_id => $category ) {
34 ?>
35 <div class="clearfix" v-if="category=='<?php echo $category_id; ?>' || category=='all'">
36
37 <?php
38
39 printf( '<h2><i class="%s" style="color: %s"></i> &nbsp; %s</h2> <ul class="clearfix">', $category['icon'], $colors[array_rand( $colors )], $category['name'] );
40
41 if ( $category_id == 'default' ) {
42 ?>
43
44 <li class="blank-form">
45 <h3><?php _e( 'Blank Form', 'weforms' ); ?></h3>
46
47 <div class="blank-form-text">
48 <span class="dashicons dashicons-plus"></span>
49 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
50 </div>
51
52 <div class="form-create-overlay">
53
54 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
55 <br>
56 <button class="button button-primary" @click.prevent="blankForm($event.target)" title="<?php echo esc_attr( 'Blank Form' ); ?>">
57 <?php _e( 'Create Form', 'weforms' ); ?>
58 </button>
59 </div>
60 </li>
61
62 <?php
63 }
64
65 foreach ( $registry as $key => $template ) {
66 if ( $category_id !== $template->category ) {
67 continue;
68 }
69
70 $is_available = true;
71 $class = 'template-active';
72 $title = $template->title;
73 $image = $template->image ? $template->image : '';
74
75 if ( !$template->is_enabled() ) {
76 $title = __( 'This integration is not installed.', 'weforms' );
77 $class = 'template-inactive';
78 $is_available = false;
79 } ?>
80
81 <li class="<?php echo $class; ?>">
82 <h3><?php _e( $title, 'weforms' ); ?></h3>
83
84 <?php if ( $image ) {
85 printf( '<img src="%s" alt="%s">', $image, $title );
86 } ?>
87
88 <div class="form-create-overlay">
89
90 <div class="title"><?php echo $template->get_title(); ?></div>
91 <div class="description"><?php echo $template->get_description(); ?></div>
92 <br>
93
94 <button class="button button-primary" @click.prevent="createForm('<?php echo $key; ?>', $event.target)" title="<?php echo esc_attr( $title ); ?>" <?php echo $is_available ? '' : 'disabled="disabled"'; ?>>
95 <?php if ( $is_available ) { ?>
96 <?php _e( 'Create Form', 'weforms' ); ?>
97 <?php } else { ?>
98 <?php _e( 'Require Pro Upgrade', 'weforms' ); ?>
99 <?php } ?>
100 </button>
101 </div>
102 </li>
103 <?php
104 } ?>
105
106 </ul></div>
107
108 <?php
109 }
110 ?>
111 </div>
112 </wpuf-modal>
113 </div>