PluginProbe
The Innovative Form Builder – IvyForms / 0.8.1
The Innovative Form Builder – IvyForms v0.8.1
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / ContactFormTemplate.php

ContactFormTemplate.php in The Innovative Form Builder – IvyForms 0.8.1, at backend/src/Services/Template/ContactFormTemplate.php

131 lines 5.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Template;
4
5 // phpcs:disable PSR1.Files.SideEffects
6 if (!defined('ABSPATH')) {
7 exit; // Exit if accessed directly
8 }
9
10 use IvyForms\Services\Translations\BackendStrings;
11
12 class ContactFormTemplate
13 {
14 /**
15 * Get the contact form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'contact_form',
23 'name' => BackendStrings::getTemplateStrings()['contact_form'],
24 'description' => BackendStrings::getTemplateStrings()['contact_form_desc'],
25 'category' => 'contact-forms',
26 'subcategory' => 'emergency-contact-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'contact-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['contact_form'],
31 'published' => 1,
32 'showTitle' => 1,
33 'storeEntries' => 1,
34 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
35 'fields' => [
36 // Name Field - Parent
37 [
38 'id' => 0,
39 'fieldIndex' => 1,
40 'type' => 'name',
41 'label' => BackendStrings::getTemplateStrings()['full_name'],
42 'parentId' => null,
43 'defaultValue' => '',
44 'placeholder' => '',
45 'required' => true,
46 'readonly' => false,
47 'position' => 1,
48 ],
49 // First Name - Child of Name Field
50 [
51 'id' => 0,
52 'type' => 'text',
53 'label' => BackendStrings::getTemplateStrings()['first_name'],
54 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
55 'required' => true,
56 'parentId' => 0,
57 'fieldIndex' => 1,
58 'defaultValue' => '',
59 'position' => 1,
60 'optionHide' => false,
61 'description' => '',
62 'settings' => json_encode(['nameFieldType' => 'nameField1']),
63 ],
64 // Last Name - Child of Name Field
65 [
66 'id' => 0,
67 'type' => 'text',
68 'label' => BackendStrings::getTemplateStrings()['last_name'],
69 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
70 'required' => true,
71 'parentId' => 0,
72 'fieldIndex' => 1,
73 'defaultValue' => '',
74 'position' => 2,
75 'optionHide' => false,
76 'description' => '',
77 'settings' => json_encode(['nameFieldType' => 'nameField2']),
78 ],
79 [
80 'id' => 'email',
81 'fieldIndex' => 2,
82 'type' => 'email',
83 'label' => BackendStrings::getTemplateStrings()['email_address'],
84 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_email_address'],
85 'required' => true,
86 'validation' => [
87 'required' => true,
88 'email' => true
89 ],
90 'settings' => [
91 'css_class' => 'ivyforms-field-email'
92 ],
93 'position' => 2,
94 ],
95 [
96 'id' => 'subject',
97 'fieldIndex' => 3,
98 'type' => 'text',
99 'label' => BackendStrings::getTemplateStrings()['subject'],
100 'placeholder' => BackendStrings::getTemplateStrings()['what_is_this_regarding'],
101 'required' => false,
102 'validation' => [
103 'required' => false,
104 ],
105 'settings' => [
106 'css_class' => 'ivyforms-field-subject'
107 ],
108 'position' => 3,
109 ],
110 [
111 'id' => 'message',
112 'fieldIndex' => 4,
113 'type' => 'textarea',
114 'label' => BackendStrings::getTemplateStrings()['message'],
115 'placeholder' => BackendStrings::getTemplateStrings()['please_enter_your_message_here'],
116 'required' => false,
117 'validation' => [
118 'required' => false,
119 ],
120 'settings' => [
121 'css_class' => 'ivyforms-field-message'
122 ],
123 'position' => 4,
124 ]
125 ],
126 'settings' => []
127 ]
128 ];
129 }
130 }
131