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

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