PluginProbe
The Innovative Form Builder – IvyForms / 1.5.1
The Innovative Form Builder – IvyForms v1.5.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 / UniversityInternshipApplicationFormTemplate.php

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

247 lines 9.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 UniversityInternshipApplicationFormTemplate
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' => 'university_internship_application_form',
18 'name' => BackendStrings::getTemplateStrings()['university_internship_application_form'],
19 'description' => BackendStrings::getTemplateStrings()['university_internship_application_form_desc'],
20 'category' => 'application-forms',
21 'subcategory' => 'internship-application-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'university-internship-application-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()['university_internship_application_form'],
39 'published' => 1,
40 'showTitle' => 1,
41 'storeEntries' => 1,
42 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
43 'fields' => array_merge(
44 self::getApplicantInformationFields(),
45 self::getEducationFields(),
46 self::getDocumentsFields()
47 ),
48 'settings' => [],
49 ],
50 ]
51 );
52 }
53
54 /**
55 * Get applicant information fields
56 *
57 * @return array<int, array<string, mixed>>
58 */
59 private static function getApplicantInformationFields(): array
60 {
61 return [
62 [
63 'id' => 1,
64 'fieldIndex' => 1,
65 'type' => 'name',
66 'label' => BackendStrings::getTemplateStrings()['name'],
67 'parentId' => null,
68 'defaultValue' => '',
69 'placeholder' => '',
70 'required' => true,
71 'readonly' => false,
72 'position' => 1,
73 ],
74 [
75 'id' => 2,
76 'type' => 'text',
77 'label' => BackendStrings::getNewFormStrings()['first_name'],
78 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_first_name'],
79 'required' => true,
80 'parentId' => 1,
81 'fieldIndex' => 1,
82 'defaultValue' => '',
83 'position' => 1,
84 'optionHide' => false,
85 'description' => '',
86 'settings' => json_encode(['nameFieldType' => 'nameField1']),
87 ],
88 [
89 'id' => 3,
90 'type' => 'text',
91 'label' => BackendStrings::getNewFormStrings()['last_name'],
92 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_last_name'],
93 'required' => true,
94 'parentId' => 1,
95 'fieldIndex' => 1,
96 'defaultValue' => '',
97 'position' => 2,
98 'optionHide' => false,
99 'description' => '',
100 'settings' => json_encode(['nameFieldType' => 'nameField2']),
101 ],
102 [
103 'id' => 4,
104 'fieldIndex' => 2,
105 'type' => 'email',
106 'label' => BackendStrings::getTemplateStrings()['email_address'],
107 'placeholder' => BackendStrings::getTemplateStrings()['enter_your_email_address'],
108 'required' => true,
109 'parentId' => null,
110 'defaultValue' => '',
111 'position' => 2,
112 ],
113 ];
114 }
115
116 /**
117 * Get education fields
118 *
119 * @return array<int, array<string, mixed>>
120 */
121 private static function getEducationFields(): array
122 {
123 return [
124 [
125 'id' => 5,
126 'fieldIndex' => 3,
127 'type' => 'text',
128 'label' => BackendStrings::getTemplateStrings()['university'],
129 'placeholder' => BackendStrings::getTemplateStrings()['enter_university'],
130 'required' => true,
131 'parentId' => null,
132 'defaultValue' => '',
133 'position' => 3,
134 ],
135 [
136 'id' => 6,
137 'fieldIndex' => 4,
138 'type' => 'select',
139 'label' => BackendStrings::getTemplateStrings()['field_of_study'],
140 'placeholder' => BackendStrings::getTemplateStrings()['select_field_of_study'],
141 'required' => true,
142 'parentId' => null,
143 'defaultValue' => '',
144 'position' => 4,
145 'fieldOptions' => [
146 [
147 'id' => 7,
148 'label' => BackendStrings::getTemplateStrings()['computer_science'],
149 'value' => 'Computer Science',
150 'isDefault' => false,
151 'position' => 1,
152 ], [
153 'id' => 8,
154 'label' => BackendStrings::getTemplateStrings()['software_engineering'],
155 'value' => 'Software Engineering',
156 'isDefault' => false,
157 'position' => 2,
158 ], [
159 'id' => 9,
160 'label' => BackendStrings::getTemplateStrings()['information_technology'],
161 'value' => 'Information Technology',
162 'isDefault' => false,
163 'position' => 3,
164 ], [
165 'id' => 10,
166 'label' => BackendStrings::getTemplateStrings()['business'],
167 'value' => 'Business',
168 'isDefault' => false,
169 'position' => 4,
170 ], [
171 'id' => 11,
172 'label' => BackendStrings::getTemplateStrings()['marketing'],
173 'value' => 'Marketing',
174 'isDefault' => false,
175 'position' => 5,
176 ], [
177 'id' => 12,
178 'label' => BackendStrings::getTemplateStrings()['other'],
179 'value' => 'Other',
180 'isDefault' => false,
181 'position' => 6,
182 ]
183 ],
184 ],
185 ];
186 }
187
188 /**
189 * Get documents fields
190 *
191 * @return array<int, array<string, mixed>>
192 */
193 private static function getDocumentsFields(): array
194 {
195 return [
196 [
197 'id' => 13,
198 'fieldIndex' => 5,
199 'type' => 'file-upload',
200 'label' => BackendStrings::getTemplateStrings()['cv_upload'],
201 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
202 'required' => true,
203 'parentId' => null,
204 'defaultValue' => '',
205 'position' => 5,
206 'maxFileSizeMb' => 999,
207 'saveUploadsTo' => 'ivyforms',
208 'allowedFileExtensions' => [],
209 'allowMultiple' => false,
210 'maxUploadCount' => 0,
211 ],
212 [
213 'id' => 14,
214 'fieldIndex' => 6,
215 'type' => 'file-upload',
216 'label' => BackendStrings::getTemplateStrings()['transcript_upload'],
217 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
218 'required' => false,
219 'parentId' => null,
220 'defaultValue' => '',
221 'position' => 6,
222 'maxFileSizeMb' => 999,
223 'saveUploadsTo' => 'ivyforms',
224 'allowedFileExtensions' => [],
225 'allowMultiple' => false,
226 'maxUploadCount' => 0,
227 ],
228 [
229 'id' => 15,
230 'fieldIndex' => 7,
231 'type' => 'file-upload',
232 'label' => BackendStrings::getTemplateStrings()['motivation_letter'],
233 'placeholder' => BackendStrings::getCommonStrings()['file_upload_placeholder_drag_here'],
234 'required' => true,
235 'parentId' => null,
236 'defaultValue' => '',
237 'position' => 7,
238 'maxFileSizeMb' => 999,
239 'saveUploadsTo' => 'ivyforms',
240 'allowedFileExtensions' => [],
241 'allowMultiple' => false,
242 'maxUploadCount' => 0,
243 ],
244 ];
245 }
246 }
247