PluginProbe
The Innovative Form Builder – IvyForms / 0.9.1
The Innovative Form Builder – IvyForms v0.9.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 / MedicalConferenceRegistrationFormTemplate.php

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

219 lines 7.6 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 MedicalConferenceRegistrationFormTemplate
13 {
14 /**
15 * Get the medical conference registration form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'medical_conference_registration_form',
23 'name' => BackendStrings::getTemplateStrings()['medical_conference_registration_form'],
24 'description' => BackendStrings::getTemplateStrings()['medical_conference_registration_form_desc'],
25 'category' => 'event-registration-forms',
26 'subcategory' => 'conference-registration-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'medical-conference-registration-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['medical_conference_registration_form'],
31 'published' => 1,
32 'showTitle' => 1,
33 'storeEntries' => 1,
34 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
35 'fields' => array_merge(
36 self::getParticipantInformationFields(),
37 self::getMedicalPreferencesFields(),
38 self::getAdditionalInformationFields()
39 ),
40 'settings' => []
41 ]
42 ];
43 }
44
45 /**
46 * Get participant information fields
47 *
48 * @return array<int, array<string, mixed>>
49 */
50 private static function getParticipantInformationFields(): array
51 {
52 return [
53 // Full Name
54 [
55 'id' => 1,
56 'fieldIndex' => 1,
57 'type' => 'text',
58 'label' => BackendStrings::getTemplateStrings()['full_name'],
59 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_full_name'],
60 'required' => true,
61 'parentId' => null,
62 'defaultValue' => '',
63 'position' => 1,
64 'validation' => [
65 'required' => true,
66 ],
67 ],
68 // Email Address
69 [
70 'id' => 2,
71 'fieldIndex' => 2,
72 'type' => 'email',
73 'label' => BackendStrings::getTemplateStrings()['email_address'],
74 'placeholder' => '[email protected]',
75 'required' => true,
76 'parentId' => null,
77 'defaultValue' => '',
78 'position' => 2,
79 'validation' => [
80 'required' => true,
81 'email' => true
82 ],
83 ],
84 // Phone Number
85 [
86 'id' => 3,
87 'fieldIndex' => 3,
88 'type' => 'phone',
89 'label' => BackendStrings::getTemplateStrings()['phone_number'],
90 'placeholder' => '+1 (_) _-_',
91 'required' => false,
92 'parentId' => null,
93 'defaultValue' => '',
94 'position' => 3,
95 'phoneAutoDetect' => true,
96 ],
97 ];
98 }
99
100 /**
101 * Get medical preferences fields
102 *
103 * @return array<int, array<string, mixed>>
104 */
105 private static function getMedicalPreferencesFields(): array
106 {
107 return [
108 // Specialization Dropdown
109 [
110 'id' => 9,
111 'fieldIndex' => 4,
112 'type' => 'select',
113 'label' => BackendStrings::getTemplateStrings()['specialization'],
114 'placeholder' => BackendStrings::getTemplateStrings()['select_specialization'],
115 'required' => true,
116 'parentId' => null,
117 'defaultValue' => '',
118 'position' => 4,
119 'fieldOptions' => [
120 [
121 'id' => 4,
122 'label' => BackendStrings::getTemplateStrings()['cardiology'],
123 'value' => 'cardiology',
124 'isDefault' => false,
125 'position' => 1,
126 ],
127 [
128 'id' => 5,
129 'label' => BackendStrings::getTemplateStrings()['neurology'],
130 'value' => 'neurology',
131 'isDefault' => false,
132 'position' => 2,
133 ],
134 [
135 'id' => 6,
136 'label' => BackendStrings::getTemplateStrings()['pediatrics'],
137 'value' => 'pediatrics',
138 'isDefault' => false,
139 'position' => 3,
140 ],
141 [
142 'id' => 7,
143 'label' => BackendStrings::getTemplateStrings()['oncology'],
144 'value' => 'oncology',
145 'isDefault' => false,
146 'position' => 4,
147 ],
148 [
149 'id' => 8,
150 'label' => BackendStrings::getTemplateStrings()['other'],
151 'value' => 'other',
152 'isDefault' => false,
153 'position' => 5,
154 ],
155 ],
156 ],
157 // Seminars to Attend (Checkbox)
158 [
159 'id' => 13,
160 'fieldIndex' => 5,
161 'type' => 'checkbox',
162 'label' => BackendStrings::getTemplateStrings()['seminars_to_attend'],
163 'placeholder' => '',
164 'required' => false,
165 'parentId' => null,
166 'defaultValue' => '',
167 'position' => 5,
168 'fieldOptions' => [
169 [
170 'id' => 10,
171 'label' => BackendStrings::getTemplateStrings()['seminar_1'],
172 'value' => 'seminar_1',
173 'isDefault' => false,
174 'position' => 1,
175 ],
176 [
177 'id' => 11,
178 'label' => BackendStrings::getTemplateStrings()['seminar_2'],
179 'value' => 'seminar_2',
180 'isDefault' => false,
181 'position' => 2,
182 ],
183 [
184 'id' => 12,
185 'label' => BackendStrings::getTemplateStrings()['seminar_3'],
186 'value' => 'seminar_3',
187 'isDefault' => false,
188 'position' => 3,
189 ],
190 ],
191 ],
192 ];
193 }
194
195 /**
196 * Get additional information fields
197 *
198 * @return array<int, array<string, mixed>>
199 */
200 private static function getAdditionalInformationFields(): array
201 {
202 return [
203 // Additional Notes
204 [
205 'id' => 14,
206 'fieldIndex' => 6,
207 'type' => 'textarea',
208 'label' => BackendStrings::getTemplateStrings()['additional_notes'],
209 'placeholder' => BackendStrings::getTemplateStrings()['write_additional_notes'],
210 'required' => false,
211 'parentId' => null,
212 'defaultValue' => '',
213 'position' => 6,
214 'rows' => 4,
215 ],
216 ];
217 }
218 }
219