PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.2.1
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.2.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 / js-templates / form-components.php

form-components.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.2.1, at assets/js-templates/form-components.php

670 lines 30.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <script type="text/x-template" id="tmpl-wpuf-dynamic-field">
2 <div>
3
4 <div class="panel-field-opt panel-field-opt-text">
5 <label><input type="checkbox" value="yes" v-model="dynamic.status"> Allow field to be populated dynamically</label>
6 </div>
7
8 <template v-if="dynamic.status">
9
10 <div class="panel-field-opt panel-field-opt-text"><label>
11 Parameter Name
12 <help-text text="<?php _e( "Enter a Parameter Name, using that the field value can be populated through filter hook or query string", 'weforms' ) ?>"></help-text>
13 <input type="text" v-model="dynamic.param_name">
14 </label>
15 </div>
16 </template>
17
18 </div></script>
19
20 <script type="text/x-template" id="tmpl-wpuf-field-name">
21 <div>
22 <div class="panel-field-opt panel-field-name clearfix">
23
24 <label>
25 <?php _e( 'First Name', 'weforms' ); ?>
26 </label>
27
28 <div class="name-field-placeholder">
29 <input type="text" v-model="editing_form_field.first_name.placeholder">
30 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
31 </div>
32
33 <div class="name-field-value">
34 <input type="text" v-model="editing_form_field.first_name.default">
35 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
36 </div>
37 </div>
38
39 <div class="panel-field-opt panel-field-name clearfix" v-if="editing_form_field.format !== 'first-last'">
40
41 <label>
42 <?php _e( 'Middle Name', 'weforms' ); ?>
43 </label>
44
45 <div class="name-field-placeholder">
46 <input type="text" v-model="editing_form_field.middle_name.placeholder">
47 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
48 </div>
49
50 <div class="name-field-value">
51 <input type="text" v-model="editing_form_field.middle_name.default">
52 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
53 </div>
54 </div>
55
56 <div class="panel-field-opt panel-field-name clearfix">
57
58 <label>
59 <?php _e( 'Last Name', 'weforms' ); ?>
60 </label>
61
62 <div class="name-field-placeholder">
63 <input type="text" v-model="editing_form_field.last_name.placeholder">
64 <label><?php _e( 'Placeholder', 'weforms' ); ?></label>
65 </div>
66
67 <div class="name-field-value">
68 <input type="text" v-model="editing_form_field.last_name.default">
69 <label><?php _e( 'Default Value', 'weforms' ); ?></label>
70 </div>
71 </div>
72 </div></script>
73
74 <script type="text/x-template" id="tmpl-wpuf-form-date_field">
75 <div class="wpuf-fields">
76 <input
77 type="text"
78 :class="class_names('datepicker')"
79 :placeholder="field.format"
80 :value="field.default"
81 :size="field.size"
82 >
83 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
84 </div></script>
85
86 <script type="text/x-template" id="tmpl-wpuf-form-name_field">
87 <div class="wpuf-fields">
88
89 <div :class="['wpuf-name-field-wrap', 'format-' + field.format]">
90 <div class="wpuf-name-field-first-name">
91 <input
92 type="text"
93 :class="class_names('textfield')"
94 :placeholder="field.first_name.placeholder"
95 :value="field.first_name.default"
96 :size="field.size"
97 >
98 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.first_name.sub }}</label>
99 </div>
100
101 <div class="wpuf-name-field-middle-name">
102 <input
103 type="text"
104 :class="class_names('textfield')"
105 :placeholder="field.middle_name.placeholder"
106 :value="field.middle_name.default"
107 :size="field.size"
108 >
109 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.middle_name.sub }}</label>
110 </div>
111
112 <div class="wpuf-name-field-last-name">
113 <input
114 type="text"
115 :class="class_names('textfield')"
116 :placeholder="field.last_name.placeholder"
117 :value="field.last_name.default"
118 :size="field.size"
119 >
120 <label class="wpuf-form-sub-label" v-if="!field.hide_subs">{{ field.last_name.sub }}</label>
121 </div>
122 </div>
123
124 <span v-if="field.help" class="wpuf-help">{{ field.help }}</span>
125 </div>
126 </script>
127
128 <script type="text/x-template" id="tmpl-wpuf-form-notification">
129 <div>
130 <!-- <pre>{{ notifications.length }}</pre> -->
131 <a href="#" class="button button-secondary add-notification" v-on:click.prevent="addNew"><span class="dashicons dashicons-plus-alt"></span> <?php _e( 'Add Notification', 'weforms' ); ?></a>
132
133 <div :class="[editing ? 'editing' : '', 'notification-wrap']">
134 <!-- notification-wrap -->
135
136 <div class="notification-table-wrap">
137 <table class="wp-list-table widefat fixed striped posts wpuf-cf-notification-table">
138 <thead>
139 <tr>
140 <th class="col-toggle">&nbsp;</th>
141 <th class="col-name"><?php _e( 'Name', 'weforms' ); ?></th>
142 <th class="col-subject"><?php _e( 'Subject', 'weforms' ); ?></th>
143 <th class="col-action">&nbsp;</th>
144 </tr>
145 </thead>
146 <tbody>
147 <tr v-for="(notification, index) in notifications">
148 <td class="col-toggle">
149 <a href="#" v-on:click.prevent="toggelNotification(index)">
150 <img v-if="notification.active" src="<?php echo WPUF_ASSET_URI; ?>/images/active.png" width="24" alt="status">
151 <img v-else src="<?php echo WPUF_ASSET_URI; ?>/images/inactive.png" width="24" alt="status">
152 </a>
153 </td>
154 <td class="col-name"><a href="#" v-on:click.prevent="editItem(index)">{{ notification.name }}</a></td>
155 <td class="col-subject">{{ notification.type === 'email' ? notification.subject : notification.smsText }}</td>
156 <td class="col-action">
157 <a href="#" v-on:click.prevent="duplicate(index)" title="<?php esc_attr_e( 'Duplicate', 'weforms' ); ?>"><span class="dashicons dashicons-admin-page"></span></a>
158 <a href="#" v-on:click.prevent="editItem(index)" title="<?php esc_attr_e( 'Settings', 'weforms' ); ?>"><span class="dashicons dashicons-admin-generic"></span></a>
159 </td>
160 </tr>
161 <tr v-if="!notifications.length">
162 <td colspan="4"><?php _e( 'No notifications found', 'weforms' ); ?></td>
163 </tr>
164 </tbody>
165 </table>
166 </div><!-- .notification-table-wrap -->
167
168 <div class="notification-edit-area" v-if="notifications[editingIndex]">
169
170 <div class="notification-head">
171 <input type="text" name="" v-model="notifications[editingIndex].name" v-on:keyup.enter="editDone()" value="Admin Notification">
172 </div>
173
174 <div class="form-fields">
175
176 <div class="notification-row notification-field">
177 <label for="notification-title"><?php _e( 'Type', 'weforms' ); ?></label>
178 <select type="text" v-model="notifications[editingIndex].type">
179 <option value="email"><?php _e( 'Email Notification', 'weforms' ) ?></option>
180 <option value="sms"><?php _e( 'SMS Notification', 'weforms' ) ?></option>
181 </select>
182 </div>
183
184 <template v-if="notifications[editingIndex].type == 'email' ">
185 <div class="notification-row">
186 <div class="row-one-half notification-field first">
187 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
188 <input type="text" v-model="notifications[editingIndex].to">
189 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="to"></wpuf-merge-tags>
190 </div>
191
192 <div class="row-one-half notification-field">
193 <label for="notification-title"><?php _e( 'Reply To', 'weforms' ); ?></label>
194 <input type="email" v-model="notifications[editingIndex].replyTo">
195 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="replyTo"></wpuf-merge-tags>
196 </div>
197 </div>
198
199 <div class="notification-row notification-field">
200 <label for="notification-title"><?php _e( 'Subject', 'weforms' ); ?></label>
201 <input type="text" v-model="notifications[editingIndex].subject">
202 <wpuf-merge-tags v-on:insert="insertValue" field="subject"></wpuf-merge-tags>
203 </div>
204
205 <div class="notification-row notification-field">
206 <label for="notification-title"><?php _e( 'Email Message', 'weforms' ); ?></label>
207
208 <weforms-text-editor
209 v-model="notifications[editingIndex].message"
210 :i18n="i18n"
211 :editingIndex="editingIndex"
212 >
213 </weforms-text-editor>
214
215 <wpuf-merge-tags v-on:insert="insertValueEditor" field="message"></wpuf-merge-tags>
216 </div>
217 </template>
218 <template v-else>
219 <template v-if="has_sms">
220 <div class="notification-row notification-field">
221 <label for="notification-title"><?php _e( 'To', 'weforms' ); ?></label>
222 <input type="text" v-model="notifications[editingIndex].smsTo">
223 <wpuf-merge-tags v-on:insert="insertValue" field="smsTo"></wpuf-merge-tags>
224 </div>
225 <div class="notification-row notification-field">
226 <label for="notification-title"><?php _e( 'SMS Text', 'weforms' ); ?></label>
227 <textarea name="" rows="6" v-model="notifications[editingIndex].smsText"></textarea>
228 <wpuf-merge-tags v-on:insert="insertValue" field="smsText"></wpuf-merge-tags>
229 </div>
230 </template>
231 <template v-else>
232 <p>
233 <label class="wpuf-pro-text-alert">
234 <a :href="pro_link" target="_blank"><?php _e( 'SMS notification moule not found', 'wpuf' ); ?></a>
235 </label>
236 </p>
237 </template>
238 </template>
239
240 <section class="advanced-fields">
241 <a href="#" class="field-toggle" v-on:click.prevent="toggleAdvanced()"><span class="dashicons dashicons-arrow-right"></span><?php _e( ' Advanced', 'weforms' ); ?></a>
242
243 <div class="advanced-field-wrap">
244 <template v-if="notifications[editingIndex].type == 'email' ">
245 <div class="notification-row">
246 <div class="row-one-half notification-field first">
247 <label for="notification-title"><?php _e( 'From Name', 'weforms' ); ?></label>
248 <input type="text" v-model="notifications[editingIndex].fromName">
249 <wpuf-merge-tags v-on:insert="insertValue" field="fromName"></wpuf-merge-tags>
250 </div>
251
252 <div class="row-one-half notification-field">
253 <label for="notification-title"><?php _e( 'From Address', 'weforms' ); ?></label>
254 <input type="email" name="" v-model="notifications[editingIndex].fromAddress">
255 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="fromAddress"></wpuf-merge-tags>
256 </div>
257 </div>
258
259 <div class="notification-row">
260 <div class="row-one-half notification-field first">
261 <label for="notification-title"><?php _e( 'CC', 'weforms' ); ?></label>
262 <input type="email" name="" v-model="notifications[editingIndex].cc">
263 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="cc"></wpuf-merge-tags>
264 </div>
265
266 <div class="row-one-half notification-field">
267 <label for="notification-title"><?php _e( 'BCC', 'weforms' ); ?></label>
268 <input type="email" name="" v-model="notifications[editingIndex].bcc">
269 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="bcc"></wpuf-merge-tags>
270 </div>
271 </div>
272 </template>
273
274 <div class="notification-row notification-field">
275 <template v-if="is_pro">
276
277 <notification-conditional-logics
278 :notification="notifications[editingIndex]"
279 >
280 </notification-conditional-logics>
281
282 </template>
283 <template v-else>
284 <label class="wpuf-pro-text-alert">
285 <a :href="pro_link" target="_blank"><?php _e( 'Conditional Logics available in Pro Version', 'wpuf' ); ?></a>
286 </label>
287 </template>
288 </div>
289 </div>
290 </section><!-- .advanced-fields -->
291 </div>
292
293 <div class="submit-area">
294 <a href="#" v-on:click.prevent="deleteItem(editingIndex)" title="<?php esc_attr_e( 'Delete', 'weforms' ); ?>"><span class="dashicons dashicons-trash"></span></a>
295 <button class="button button-secondary" v-on:click.prevent="editDone()"><?php _e( 'Done', 'weforms' ); ?></button>
296 </div>
297 </div><!-- .notification-edit-area -->
298
299 </div><!-- .notification-wrap -->
300 </div>
301 </script>
302
303 <script type="text/x-template" id="tmpl-wpuf-integration">
304 <div class="wpuf-integrations-wrap">
305
306 <template v-if="hasIntegrations">
307 <div :class="['wpuf-integration', isAvailable(integration.id) ? '' : 'collapsed']" v-for="integration in integrations">
308 <div class="wpuf-integration-header">
309 <div class="wpuf-integration-header-toggle">
310 <span :class="['wpuf-toggle-switch', 'big', isActive(integration.id) ? 'checked' : '']" v-on:click="toggleState(integration.id, $event.target)"></span>
311 </div>
312 <div class="wpuf-integration-header-label">
313 <img class="icon" :src="integration.icon" :alt="integration.title">
314 {{ integration.title }} <span class="label-premium" v-if="!isAvailable(integration.id)"><?php _e( 'Premium Feature', 'best-contact-form' ); ?></span>
315 </div>
316
317 <div class="wpuf-integration-header-actions">
318 <button type="button" class="toggle-area" v-on:click="showHide($event.target)">
319 <span class="screen-reader-text"><?php _e( 'Toggle panel', 'best-contact-form' ); ?></span>
320 <span class="toggle-indicator"></span>
321 </button>
322 </div>
323 </div>
324
325 <div class="wpuf-integration-settings">
326
327 <div v-if="isAvailable(integration.id)">
328 <component :is="'wpuf-integration-' + integration.id" :id="integration.id"></component>
329 </div>
330 <div v-else>
331 <?php _e( 'This feature is available on the premium version only.', 'best-contact-form' ); ?>
332 <a class="button" :href="pro_link" target="_blank"><?php _e( 'Upgrade to Pro', 'best-contact-form' ); ?></a>
333 </div>
334
335 </div>
336 </div>
337 </template>
338
339 <div v-else>
340 <?php _e( 'No integration found.', 'best-contact-form' ); ?>
341 </div>
342 </div></script>
343
344 <script type="text/x-template" id="tmpl-wpuf-integration-erp">
345 <div>
346
347 <?php if ( !function_exists( 'erp_crm_get_contact_groups' ) ) : ?>
348
349 <p>
350 <?php printf( __( '<a href="%s" target="_blank">WP ERP</a> plugin is not installed. Please install the plugin first.', 'weforms' ), 'https://wordpress.org/plugins/erp/' ); ?>
351 </p>
352
353 <?php else : ?>
354 <?php
355 $erp_contact_groups = erp_crm_get_contact_groups( array(
356 'number' => -1,
357 'orderby' => 'name',
358 'order' => 'ASC',
359 ) );
360 ?>
361
362 <div class="wpuf-int-form-row">
363 <div class="wpuf-int-field-label">
364 <label for="erp-group-id"><?php _e( 'Contact Group', 'weforms' ); ?></label>
365 </div>
366 <div class="wpuf-int-field">
367 <ul style="margin: 0;">
368 <?php foreach ( $erp_contact_groups as $group ): ?>
369 <li>
370 <label>
371 <input type="checkbox" v-model="settings.group" class="checkbox" value="<?php echo $group->id; ?>">
372 <?php echo $group->name; ?>
373 </label>
374 </li>
375 <?php endforeach; ?>
376 </ul>
377 </div>
378 </div>
379
380 <div class="wpuf-int-form-row">
381 <div class="wpuf-int-field-label">
382 <label for="erp-group-id"><?php _e( 'Life Stage', 'weforms' ); ?></label>
383 </div>
384 <div class="wpuf-int-field">
385 <select v-model="settings.stage">
386 <?php echo erp_crm_get_life_stages_dropdown(); ?>
387 </select>
388 </div>
389 </div>
390
391 <fieldset>
392 <legend><?php _e( 'Mapping Fields', 'weforms' ); ?></legend>
393
394 <p class="description" style="padding: 0 0 10px 0;">
395 <?php _e( 'Please map the form input fields with ERP required fields', 'weforms' ); ?>
396 </p>
397
398 <div class="wpuf-int-form-row mapping-fields">
399 <div class="wpuf-int-field-label">
400 <label><?php _e( 'Email Address', 'default' ); ?> <span class="required">*</span></label>
401 </div>
402 <div class="wpuf-int-field">
403 <div class="wpuf-int-field-small">
404 <input type="email" class="regular-text" v-model="settings.fields.email">
405 <wpuf-merge-tags filter="email_address" v-on:insert="insertValue" field="email"></wpuf-merge-tags>
406 </div>
407 </div>
408 </div>
409
410 <div class="wpuf-int-form-row">
411 <div class="wpuf-int-field-label">
412 <label><?php _e( 'First Name', 'default' ); ?></label>
413 </div>
414 <div class="wpuf-int-field">
415 <div class="wpuf-int-field-small">
416 <input type="text" class="regular-text" v-model="settings.fields.first_name">
417 <wpuf-merge-tags v-on:insert="insertValue" field="first_name"></wpuf-merge-tags>
418 </div>
419 </div>
420 </div>
421
422 <div class="wpuf-int-form-row">
423 <div class="wpuf-int-field-label">
424 <label><?php _e( 'Last Name', 'default' ); ?></label>
425 </div>
426 <div class="wpuf-int-field">
427 <div class="wpuf-int-field-small">
428 <input type="text" class="regular-text" v-model="settings.fields.last_name">
429 <wpuf-merge-tags v-on:insert="insertValue" field="last_name"></wpuf-merge-tags>
430 </div>
431 </div>
432 </div>
433 </fieldset>
434
435 <?php endif; ?>
436 </div></script>
437
438 <script type="text/x-template" id="tmpl-wpuf-integration-slack">
439 <div>
440 <div class="wpuf-int-form-row">
441 <div class="wpuf-int-field-label">
442 <label for="mailchimp-list-id"><?php _e( 'Slack Webhook URL', 'weforms' ); ?></label>
443 </div>
444 <div class="wpuf-int-field">
445 <input type="url" class="regular-text" v-model="settings.url" placeholder="https://hooks.slack.com/services/...">
446 <p class="help"><?php printf( __( '%sSlack webhook URL%s to send our JSON payloads (%sView documentation%s)', 'weforms' ), '<a href="https://api.slack.com/incoming-webhooks" target="_blank" >', '</a>', '<a href="https://wedevs.com/docs/weforms/integrations/slack/" target="_blank" >', '</a>' ); ?></p>
447 </div>
448 </div>
449 </div></script>
450
451 <script type="text/x-template" id="tmpl-wpuf-merge-tags">
452 <div class="wpuf-merge-tag-wrap">
453 <a href="#" v-on:click.prevent="toggleFields($event)" class="merge-tag-link" title="<?php echo esc_attr( 'Click to toggle merge tags', 'wpuf' ); ?>"><span class="dashicons dashicons-editor-code"></span></a>
454
455 <!-- <pre>{{ form_fields.length }}</pre> -->
456
457 <div class="wpuf-merge-tags">
458 <div class="merge-tag-section">
459 <div class="merge-tag-head"><?php _e( 'Form Fields', 'wpuf' ); ?></div>
460
461 <ul>
462 <template v-if="form_fields.length">
463 <li v-for="field in form_fields">
464
465 <template v-if="field.template === 'name_field'">
466 <a href="#" v-on:click.prevent="insertField('name-full', field.name);">{{ field.label }}</a>
467 (
468 <a href="#" v-on:click.prevent="insertField('name-first', field.name);"><?php _e( 'first', 'wpuf' ); ?></a> |
469 <a href="#" v-on:click.prevent="insertField('name-middle', field.name);"><?php _e( 'middle', 'wpuf' ); ?></a> |
470 <a href="#" v-on:click.prevent="insertField('name-last', field.name);"><?php _e( 'last', 'wpuf' ); ?></a>
471 )
472 </template>
473
474 <template v-else-if="field.template === 'image_upload'">
475 <a href="#" v-on:click.prevent="insertField('image', field.name);">{{ field.label }}</a>
476 </template>
477
478 <template v-else-if="field.template === 'file_upload'">
479 <a href="#" v-on:click.prevent="insertField('file', field.name);">{{ field.label }}</a>
480 </template>
481
482 <a v-else href="#" v-on:click.prevent="insertField('field', field.name);">{{ field.label }} </a>
483
484 </li>
485 </template>
486 <li v-else><?php _e( 'No fields available', 'wpuf' ); ?></li>
487 </ul>
488 </div><!-- .merge-tag-section -->
489
490 <?php
491 if ( function_exists( 'weforms_get_merge_tags' ) ) {
492
493 $merge_tags = weforms_get_merge_tags();
494
495 foreach ($merge_tags as $section_key => $section) {
496 ?>
497
498 <div class="merge-tag-section">
499 <div class="merge-tag-head"><?php echo $section['title'] ?></div>
500
501 <ul>
502 <?php foreach ($section['tags'] as $key => $value) { ?>
503 <li>
504 <a href="#" v-on:click.prevent="insertField('<?php echo $key; ?>');"><?php echo $value; ?></a>
505 </li>
506 <?php } ?>
507 </ul>
508 </div><!-- .merge-tag-section -->
509
510 <?php
511 }
512 }
513 ?>
514 </div><!-- .merge-tags -->
515 </div></script>
516
517 <script type="text/x-template" id="tmpl-wpuf-modal">
518 <div>
519 <div :class="['wpuf-form-template-modal', show ? 'show' : 'hide' ]">
520
521 <span class="screen-reader-text"><?php _e( 'Modal window. Press escape to close.', 'wpuf' ); ?></span>
522 <a href="#" class="close" v-on:click.prevent="closeModal()">× <span class="screen-reader-text"><?php _e( 'Close modal window', 'wpuf' ); ?></span></a>
523
524 <header class="modal-header">
525 <slot name="header"></slot>
526 </header>
527
528 <div :class="['content-container', this.$slots.footer ? 'modal-footer' : 'no-footer']">
529 <div class="content">
530 <slot name="body"></slot>
531 </div>
532 </div>
533
534 <footer v-if="this.$slots.footer">
535 <slot name="footer"></slot>
536 </footer>
537 </div>
538 <div :class="['wpuf-form-template-modal-backdrop', show ? 'show' : 'hide' ]"></div>
539 </div>
540 </script>
541
542 <script type="text/x-template" id="tmpl-wpuf-template-modal">
543 <div class="wefroms-form-templates">
544 <wpuf-modal :show.sync="show" :onClose="onClose">
545 <h2 slot="header">
546 <?php _e( 'Select a Template', 'weforms' ); ?>
547 <small><?php printf( __( 'Select from a pre-defined template or from a <a href="#" %s>blank form</a>', 'weforms' ), '@click.prevent="blankForm()"' ); ?></small>
548
549 <span class="choose-form-categroy">
550 <?php _e( 'Select Category', 'weforms' ); ?> &nbsp;
551 <select v-model="category">
552 <option value="all">All</option>
553 <?php
554 $registry = weforms()->templates->get_templates();
555 $categories = weforms_get_form_template_categories();
556 $colors = weforms_get_flat_ui_colors();
557
558 foreach ( $categories as $key => $category ) {
559 printf( '<option value="%s">%s</option>', $key, $category['name'] );
560 }
561 ?>
562 </select>
563 </span>
564 </h2>
565
566 <div slot="body">
567
568 <?php
569
570 // remove the blank form from index as it's handled separately
571 if ( array_key_exists( 'blank', $registry ) ) {
572 unset( $registry['blank'] );
573 }
574
575 foreach ($categories as $category_id => $category) {
576
577 ?>
578 <div class="clearfix" v-if="category=='<?php echo $category_id; ?>' || category=='all'">
579
580 <?php
581
582 printf( '<h2><i class="%s" style="color: %s"></i> &nbsp; %s</h2> <ul class="clearfix">',$category['icon'], $colors[array_rand($colors)], $category['name'] );
583
584 if ( $category_id == 'default' ) {
585
586 ?>
587
588 <li class="blank-form">
589 <h3><?php _e( 'Blank Form', 'weforms' ); ?></h3>
590
591 <div class="blank-form-text">
592 <span class="dashicons dashicons-plus"></span>
593 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
594 </div>
595
596 <div class="form-create-overlay">
597
598 <div class="title"><?php _e( 'Blank Form', 'weforms' ); ?></div>
599 <br>
600 <button class="button button-primary" @click.prevent="blankForm($event.target)" title="<?php echo esc_attr('Blank Form'); ?>">
601 <?php _e('Create Form', 'weforms' ); ?>
602 </button>
603 </div>
604 </li>
605
606 <?php
607 }
608
609 foreach ( $registry as $key => $template ) {
610
611 if ( $category_id !== $template->category ) {
612 continue;
613 }
614
615 $is_available = true;
616 $class = 'template-active';
617 $title = $template->title;
618 $image = $template->image ? $template->image : '';
619
620 if ( ! $template->is_enabled() ) {
621
622 $title = __( 'This integration is not installed.', 'weforms' );
623 $class = 'template-inactive';
624 $is_available = false;
625 }
626
627
628 ?>
629
630 <li class="<?php echo $class; ?>">
631 <h3><?php _e( $title, 'weforms' ); ?></h3>
632
633 <?php if ( $image ) { printf( '<img src="%s" alt="%s">', $image, $title ); } ?>
634
635 <div class="form-create-overlay">
636
637 <div class="title"><?php echo $template->get_title(); ?></div>
638 <div class="description"><?php echo $template->get_description(); ?></div>
639 <br>
640
641 <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"'; ?>>
642 <?php if ( $is_available ) : ?>
643 <?php _e('Create Form', 'weforms' ); ?>
644 <?php else : ?>
645 <?php _e('Require Pro Upgrade', 'weforms' ); ?>
646 <?php endif; ?>
647 </button>
648 </div>
649 </li>
650 <?php
651 }
652
653
654 ?>
655
656 </ul></div>
657
658 <?php
659 }
660 ?>
661 </div>
662 </wpuf-modal>
663 </div></script>
664
665 <script type="text/x-template" id="tmpl-wpuf-weforms-text-editor">
666 <div>
667 <textarea :value="value" :id="'wefroms-tinymce-' + editorId" rows="5"></textarea>
668 </div>
669 </script>
670