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

227 lines 8.0 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 MarketingConferenceRegistrationFormTemplate
13 {
14 /**
15 * Get the marketing conference registration form template
16 *
17 * @return array<string, mixed>
18 */
19 public static function getTemplate(): array
20 {
21 return [
22 'id' => 'marketing_conference_registration_form',
23 'name' => BackendStrings::getTemplateStrings()['marketing_conference_registration_form'],
24 'description' => BackendStrings::getTemplateStrings()['marketing_conference_registration_form_desc'],
25 'category' => 'event-registration-forms',
26 'subcategory' => 'conference-registration-forms',
27 'is_pro' => false,
28 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'marketing-conference-registration-form.svg',
29 'form_data' => [
30 'name' => BackendStrings::getTemplateStrings()['marketing_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::getConferencePreferencesFields(),
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' => 0,
56 'fieldIndex' => 1,
57 'type' => 'text',
58 'label' => BackendStrings::getTemplateStrings()['full_name'],
59 'placeholder' => BackendStrings::getTemplateStrings()['enter_full_name'] ?? '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' => 0,
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 ];
85 }
86
87 /**
88 * Get conference preferences fields
89 *
90 * @return array<int, array<string, mixed>>
91 */
92 private static function getConferencePreferencesFields(): array
93 {
94 return [
95 // Role/Position Dropdown
96 [
97 'id' => 0,
98 'fieldIndex' => 3,
99 'type' => 'select',
100 'label' => BackendStrings::getTemplateStrings()['role_position'],
101 'placeholder' => BackendStrings::getTemplateStrings()['select_role_position'],
102 'required' => true,
103 'parentId' => null,
104 'defaultValue' => '',
105 'position' => 3,
106 'fieldOptions' => [
107 [
108 'id' => 0,
109 'label' => BackendStrings::getTemplateStrings()['marketer'],
110 'value' => 'marketer',
111 'isDefault' => false,
112 'position' => 1,
113 ],
114 [
115 'id' => 0,
116 'label' => BackendStrings::getTemplateStrings()['manager'],
117 'value' => 'manager',
118 'isDefault' => false,
119 'position' => 2,
120 ],
121 [
122 'id' => 0,
123 'label' => BackendStrings::getTemplateStrings()['ceo'],
124 'value' => 'ceo',
125 'isDefault' => false,
126 'position' => 3,
127 ],
128 [
129 'id' => 0,
130 'label' => BackendStrings::getTemplateStrings()['other'],
131 'value' => 'other',
132 'isDefault' => false,
133 'position' => 4,
134 ],
135 ],
136 ],
137 // Workshops to Attend (Checkbox - multi-select alternative)
138 [
139 'id' => 0,
140 'fieldIndex' => 4,
141 'type' => 'checkbox',
142 'label' => BackendStrings::getTemplateStrings()['workshops_to_attend'],
143 'placeholder' => '',
144 'required' => false,
145 'parentId' => null,
146 'defaultValue' => '',
147 'position' => 4,
148 'fieldOptions' => [
149 [
150 'id' => 0,
151 'label' => BackendStrings::getTemplateStrings()['workshop_1'],
152 'value' => 'workshop_1',
153 'isDefault' => false,
154 'position' => 1,
155 ],
156 [
157 'id' => 0,
158 'label' => BackendStrings::getTemplateStrings()['workshop_2'],
159 'value' => 'workshop_2',
160 'isDefault' => false,
161 'position' => 2,
162 ],
163 [
164 'id' => 0,
165 'label' => BackendStrings::getTemplateStrings()['workshop_3'],
166 'value' => 'workshop_3',
167 'isDefault' => false,
168 'position' => 3,
169 ],
170 ],
171 ],
172 // Attendance Type (Radio)
173 [
174 'id' => 0,
175 'fieldIndex' => 5,
176 'type' => 'radio',
177 'label' => BackendStrings::getTemplateStrings()['attendance_type'],
178 'placeholder' => '',
179 'required' => true,
180 'parentId' => null,
181 'defaultValue' => '',
182 'position' => 5,
183 'fieldOptions' => [
184 [
185 'id' => 0,
186 'label' => BackendStrings::getTemplateStrings()['in_person'],
187 'value' => 'in_person',
188 'isDefault' => false,
189 'position' => 1,
190 ],
191 [
192 'id' => 0,
193 'label' => BackendStrings::getTemplateStrings()['virtual'],
194 'value' => 'virtual',
195 'isDefault' => false,
196 'position' => 2,
197 ],
198 ],
199 ],
200 ];
201 }
202
203 /**
204 * Get additional information fields
205 *
206 * @return array<int, array<string, mixed>>
207 */
208 private static function getAdditionalInformationFields(): array
209 {
210 return [
211 // Questions or Comments (Paragraph)
212 [
213 'id' => 0,
214 'fieldIndex' => 6,
215 'type' => 'textarea',
216 'label' => BackendStrings::getTemplateStrings()['questions_comments'],
217 'placeholder' => BackendStrings::getTemplateStrings()['write_questions_comments'],
218 'required' => false,
219 'parentId' => null,
220 'defaultValue' => '',
221 'position' => 6,
222 'rows' => 4,
223 ],
224 ];
225 }
226 }
227