PluginProbe
The Innovative Form Builder – IvyForms / 0.8
The Innovative Form Builder – IvyForms v0.8
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.8, at backend/src/Services/Template/MedicalConferenceRegistrationFormTemplate.php

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