PluginProbe
The Innovative Form Builder – IvyForms / 1.1.1
The Innovative Form Builder – IvyForms v1.1.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 / MarketingConferenceRegistrationFormTemplate.php

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

236 lines 8.1 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 use IvyForms\Services\Translations\BackendStrings;
6
7 class MarketingConferenceRegistrationFormTemplate
8 {
9 /**
10 * Get template metadata (without form_data)
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplateMeta(): array
15 {
16 return [
17 'id' => 'marketing_conference_registration_form',
18 'name' => BackendStrings::getTemplateStrings()['marketing_conference_registration_form'],
19 'description' => BackendStrings::getTemplateStrings()['marketing_conference_registration_form_desc'],
20 'category' => 'event-registration-forms',
21 'subcategory' => 'conference-registration-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'marketing-conference-registration-form.svg'
24 ];
25 }
26
27 /**
28 * Get the full template including form data
29 *
30 * @return array<string, mixed>
31 */
32 public static function getTemplate(): array
33 {
34 return array_merge(
35 self::getTemplateMeta(),
36 [
37 'form_data' => [
38 'name' => BackendStrings::getTemplateStrings()['marketing_conference_registration_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getParticipantInformationFields(),
45 self::getConferencePreferencesFields(),
46 self::getAdditionalInformationFields()
47 ),
48 'settings' => []
49 ]
50 ]
51 );
52 }
53
54 /**
55 * Get participant information fields
56 *
57 * @return array<int, array<string, mixed>>
58 */
59 private static function getParticipantInformationFields(): array
60 {
61 return [
62 // Full Name
63 [
64 'id' => 1,
65 'fieldIndex' => 1,
66 'type' => 'text',
67 'label' => BackendStrings::getTemplateStrings()['full_name'],
68 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_full_name'],
69 'required' => true,
70 'parentId' => null,
71 'defaultValue' => '',
72 'position' => 1,
73 'validation' => [
74 'required' => true,
75 ],
76 ],
77 // Email Address
78 [
79 'id' => 2,
80 'fieldIndex' => 2,
81 'type' => 'email',
82 'label' => BackendStrings::getTemplateStrings()['email_address'],
83 'placeholder' => '[email protected]',
84 'required' => true,
85 'parentId' => null,
86 'defaultValue' => '',
87 'position' => 2,
88 'validation' => [
89 'required' => true,
90 'email' => true
91 ],
92 ],
93 ];
94 }
95
96 /**
97 * Get conference preferences fields
98 *
99 * @return array<int, array<string, mixed>>
100 */
101 private static function getConferencePreferencesFields(): array
102 {
103 return [
104 // Role/Position Dropdown
105 [
106 'id' => 7,
107 'fieldIndex' => 3,
108 'type' => 'select',
109 'label' => BackendStrings::getTemplateStrings()['role_position'],
110 'placeholder' => BackendStrings::getTemplateStrings()['select_role_position'],
111 'required' => true,
112 'parentId' => null,
113 'defaultValue' => '',
114 'position' => 3,
115 'fieldOptions' => [
116 [
117 'id' => 3,
118 'label' => BackendStrings::getTemplateStrings()['marketer'],
119 'value' => 'marketer',
120 'isDefault' => false,
121 'position' => 1,
122 ],
123 [
124 'id' => 4,
125 'label' => BackendStrings::getTemplateStrings()['manager'],
126 'value' => 'manager',
127 'isDefault' => false,
128 'position' => 2,
129 ],
130 [
131 'id' => 5,
132 'label' => BackendStrings::getTemplateStrings()['ceo'],
133 'value' => 'ceo',
134 'isDefault' => false,
135 'position' => 3,
136 ],
137 [
138 'id' => 6,
139 'label' => BackendStrings::getTemplateStrings()['other'],
140 'value' => 'other',
141 'isDefault' => false,
142 'position' => 4,
143 ],
144 ],
145 ],
146 // Workshops to Attend (Checkbox - multi-select alternative)
147 [
148 'id' => 11,
149 'fieldIndex' => 4,
150 'type' => 'checkbox',
151 'label' => BackendStrings::getTemplateStrings()['workshops_to_attend'],
152 'placeholder' => '',
153 'required' => false,
154 'parentId' => null,
155 'defaultValue' => '',
156 'position' => 4,
157 'fieldOptions' => [
158 [
159 'id' => 8,
160 'label' => BackendStrings::getTemplateStrings()['workshop_1'],
161 'value' => 'workshop_1',
162 'isDefault' => false,
163 'position' => 1,
164 ],
165 [
166 'id' => 9,
167 'label' => BackendStrings::getTemplateStrings()['workshop_2'],
168 'value' => 'workshop_2',
169 'isDefault' => false,
170 'position' => 2,
171 ],
172 [
173 'id' => 10,
174 'label' => BackendStrings::getTemplateStrings()['workshop_3'],
175 'value' => 'workshop_3',
176 'isDefault' => false,
177 'position' => 3,
178 ],
179 ],
180 ],
181 // Attendance Type (Radio)
182 [
183 'id' => 14,
184 'fieldIndex' => 5,
185 'type' => 'radio',
186 'label' => BackendStrings::getTemplateStrings()['attendance_type'],
187 'placeholder' => '',
188 'required' => true,
189 'parentId' => null,
190 'defaultValue' => '',
191 'position' => 5,
192 'fieldOptions' => [
193 [
194 'id' => 12,
195 'label' => BackendStrings::getTemplateStrings()['in_person'],
196 'value' => 'in_person',
197 'isDefault' => false,
198 'position' => 1,
199 ],
200 [
201 'id' => 13,
202 'label' => BackendStrings::getTemplateStrings()['virtual'],
203 'value' => 'virtual',
204 'isDefault' => false,
205 'position' => 2,
206 ],
207 ],
208 ],
209 ];
210 }
211
212 /**
213 * Get additional information fields
214 *
215 * @return array<int, array<string, mixed>>
216 */
217 private static function getAdditionalInformationFields(): array
218 {
219 return [
220 // Questions or Comments (Paragraph)
221 [
222 'id' => 15,
223 'fieldIndex' => 6,
224 'type' => 'textarea',
225 'label' => BackendStrings::getTemplateStrings()['questions_comments'],
226 'placeholder' => BackendStrings::getTemplateStrings()['write_questions_comments'],
227 'required' => false,
228 'parentId' => null,
229 'defaultValue' => '',
230 'position' => 6,
231 'rows' => 4,
232 ],
233 ];
234 }
235 }
236