PluginProbe
The Innovative Form Builder – IvyForms / 1.5
The Innovative Form Builder – IvyForms v1.5
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
← All changes | backend/src/Services/Template/TechConferenceRegistrationFormTemplate.php +36 -27 0.8.2 → 1.5 View file →
@@ -1,23 +1,18 @@
1 1 <?php
2 2
3 3 namespace IvyForms\Services\Template;
4 4
5 -// phpcs:disable PSR1.Files.SideEffects
6 -if (!defined('ABSPATH')) {
7 - exit; // Exit if accessed directly
8 -}
9 -
10 5 use IvyForms\Services\Translations\BackendStrings;
11 6
12 7 class TechConferenceRegistrationFormTemplate
13 8 {
14 9 /**
15 - * Get the tech conference registration form template
10 + * Get template metadata (without form_data)
16 11 *
17 12 * @return array<string, mixed>
18 13 */
19 - public static function getTemplate(): array
14 + public static function getTemplateMeta(): array
20 15 {
21 16 return [
22 17 'id' => 'tech_conference_registration_form',
23 18 'name' => BackendStrings::getTemplateStrings()['tech_conference_registration_form'],
@@ -24,9 +19,22 @@
24 19 'description' => BackendStrings::getTemplateStrings()['tech_conference_registration_form_desc'],
25 20 'category' => 'event-registration-forms',
26 21 'subcategory' => 'conference-registration-forms',
27 22 'is_pro' => false,
28 - 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'tech-conference-registration-form.svg',
23 + 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'tech-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 + [
29 37 'form_data' => [
30 38 'name' => BackendStrings::getTemplateStrings()['tech_conference_registration_form'],
31 39 'published' => 1,
32 40 'showTitle' => 1,
@@ -38,9 +46,10 @@
38 46 self::getAdditionalInformationFields()
39 47 ),
40 48 'settings' => []
41 49 ]
42 - ];
50 + ]
51 + );
43 52 }
44 53
45 54 /**
46 55 * Get participant information fields
@@ -51,13 +60,13 @@
51 60 {
52 61 return [
53 62 // Full Name
54 63 [
55 - 'id' => 0,
64 + 'id' => 1,
56 65 'fieldIndex' => 1,
57 66 'type' => 'text',
58 67 'label' => BackendStrings::getTemplateStrings()['full_name'],
59 - 'placeholder' => BackendStrings::getTemplateStrings()['enter_full_name'] ?? 'Enter your full name',
68 + 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_full_name'],
60 69 'required' => true,
61 70 'parentId' => null,
62 71 'defaultValue' => '',
63 72 'position' => 1,
@@ -66,9 +75,9 @@
66 75 ],
67 76 ],
68 77 // Email Address
69 78 [
70 - 'id' => 0,
79 + 'id' => 2,
71 80 'fieldIndex' => 2,
72 81 'type' => 'email',
73 82 'label' => BackendStrings::getTemplateStrings()['email_address'],
74 83 'placeholder' => '[email protected]',
@@ -82,9 +91,9 @@
82 91 ],
83 92 ],
84 93 // Phone Number
85 94 [
86 - 'id' => 0,
95 + 'id' => 3,
87 96 'fieldIndex' => 3,
88 97 'type' => 'phone',
89 98 'label' => BackendStrings::getTemplateStrings()['phone_number'],
90 99 'placeholder' => '+1 (_) _-_',
@@ -106,9 +115,9 @@
106 115 {
107 116 return [
108 117 // Conference Track Dropdown
109 118 [
110 - 'id' => 0,
119 + 'id' => 8,
111 120 'fieldIndex' => 4,
112 121 'type' => 'select',
113 122 'label' => BackendStrings::getTemplateStrings()['conference_track'],
114 123 'placeholder' => BackendStrings::getTemplateStrings()['select_conference_track'],
@@ -117,9 +126,9 @@
117 126 'defaultValue' => '',
118 127 'position' => 4,
119 128 'fieldOptions' => [
120 129 [
121 - 'id' => 0,
130 + 'id' => 4,
122 131 'label' => BackendStrings::getTemplateStrings()['ai_machine_learning'],
123 132 'value' => 'ai_machine_learning',
124 133 'isDefault' => false,
125 134 'position' => 1,
@@ -124,9 +133,9 @@
124 133 'isDefault' => false,
125 134 'position' => 1,
126 135 ],
127 136 [
128 - 'id' => 0,
137 + 'id' => 5,
129 138 'label' => BackendStrings::getTemplateStrings()['software_development'],
130 139 'value' => 'software_development',
131 140 'isDefault' => false,
132 141 'position' => 2,
@@ -131,9 +140,9 @@
131 140 'isDefault' => false,
132 141 'position' => 2,
133 142 ],
134 143 [
135 - 'id' => 0,
144 + 'id' => 6,
136 145 'label' => BackendStrings::getTemplateStrings()['cybersecurity'],
137 146 'value' => 'cybersecurity',
138 147 'isDefault' => false,
139 148 'position' => 3,
@@ -138,9 +147,9 @@
138 147 'isDefault' => false,
139 148 'position' => 3,
140 149 ],
141 150 [
142 - 'id' => 0,
151 + 'id' => 7,
143 152 'label' => BackendStrings::getTemplateStrings()['cloud_computing'],
144 153 'value' => 'cloud_computing',
145 154 'isDefault' => false,
146 155 'position' => 4,
@@ -148,9 +157,9 @@
148 157 ],
149 158 ],
150 159 // Sessions to Attend (Checkbox)
151 160 [
152 - 'id' => 0,
161 + 'id' => 13,
153 162 'fieldIndex' => 5,
154 163 'type' => 'checkbox',
155 164 'label' => BackendStrings::getTemplateStrings()['sessions_to_attend'],
156 165 'placeholder' => '',
@@ -159,9 +168,9 @@
159 168 'defaultValue' => '',
160 169 'position' => 5,
161 170 'fieldOptions' => [
162 171 [
163 - 'id' => 0,
172 + 'id' => 9,
164 173 'label' => BackendStrings::getTemplateStrings()['session_1'],
165 174 'value' => 'session_1',
166 175 'isDefault' => false,
167 176 'position' => 1,
@@ -166,9 +175,9 @@
166 175 'isDefault' => false,
167 176 'position' => 1,
168 177 ],
169 178 [
170 - 'id' => 0,
179 + 'id' => 10,
171 180 'label' => BackendStrings::getTemplateStrings()['session_2'],
172 181 'value' => 'session_2',
173 182 'isDefault' => false,
174 183 'position' => 2,
@@ -173,9 +182,9 @@
173 182 'isDefault' => false,
174 183 'position' => 2,
175 184 ],
176 185 [
177 - 'id' => 0,
186 + 'id' => 11,
178 187 'label' => BackendStrings::getTemplateStrings()['session_3'],
179 188 'value' => 'session_3',
180 189 'isDefault' => false,
181 190 'position' => 3,
@@ -180,9 +189,9 @@
180 189 'isDefault' => false,
181 190 'position' => 3,
182 191 ],
183 192 [
184 - 'id' => 0,
193 + 'id' => 12,
185 194 'label' => BackendStrings::getTemplateStrings()['session_4'],
186 195 'value' => 'session_4',
187 196 'isDefault' => false,
188 197 'position' => 4,
@@ -190,9 +199,9 @@
190 199 ],
191 200 ],
192 201 // Participation Type (Radio)
193 202 [
194 - 'id' => 0,
203 + 'id' => 16,
195 204 'fieldIndex' => 6,
196 205 'type' => 'radio',
197 206 'label' => BackendStrings::getTemplateStrings()['participation_type'],
198 207 'placeholder' => '',
@@ -201,9 +210,9 @@
201 210 'defaultValue' => '',
202 211 'position' => 6,
203 212 'fieldOptions' => [
204 213 [
205 - 'id' => 0,
214 + 'id' => 14,
206 215 'label' => BackendStrings::getTemplateStrings()['in_person'],
207 216 'value' => 'in_person',
208 217 'isDefault' => false,
209 218 'position' => 1,
@@ -208,9 +217,9 @@
208 217 'isDefault' => false,
209 218 'position' => 1,
210 219 ],
211 220 [
212 - 'id' => 0,
221 + 'id' => 15,
213 222 'label' => BackendStrings::getTemplateStrings()['virtual'],
214 223 'value' => 'virtual',
215 224 'isDefault' => false,
216 225 'position' => 2,
@@ -229,9 +238,9 @@
229 238 {
230 239 return [
231 240 // Additional Notes
232 241 [
233 - 'id' => 0,
242 + 'id' => 17,
234 243 'fieldIndex' => 7,
235 244 'type' => 'textarea',
236 245 'label' => BackendStrings::getTemplateStrings()['additional_notes'],
237 246 'placeholder' => BackendStrings::getTemplateStrings()['write_additional_notes'],