ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Field.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
32use ILIAS\Refinery\Factory as Refinery;
35use ILIAS\UI\Factory as UIFactory;
36use ILIAS\UI\Renderer as UIRenderer;
39use ILIAS\UI\Component\Listing\Unordered as UnorderedListing;
43
44class Field implements Property
45{
46 public function __construct(
47 private FieldDefinition $definition,
48 private bool $visible_in_registration = false,
49 private bool $visible_to_user = false,
50 private bool $visible_in_local_user_administration = false,
51 private bool $visible_in_courses = false,
52 private bool $visible_in_groups = false,
53 private bool $visible_in_study_programmes = false,
54 private bool $changeable_by_user = false,
55 private bool $changeable_in_local_user_administration = false,
56 private bool $required = false,
57 private bool $export = false,
58 private bool $searchable = false,
59 private bool $available_in_certificates = false
60 ) {
61 }
62
63 public function getIdentifier(): string
64 {
65 return $this->definition->getIdentifier();
66 }
67
68 public function getDefinition(): FieldDefinition
69 {
70 return $this->definition;
71 }
72
73 public function getLabel(Language $lng): string
74 {
75 return $this->definition->getLabel($lng);
76 }
77
78 public function isCustom(): bool
79 {
80 return $this->definition instanceof CustomField;
81 }
82
83 public function hiddenInLists(): bool
84 {
85 return $this->definition->hiddenInLists();
86 }
87
88 public function isVisibleInRegistration(): bool
89 {
90 return $this->definition->visibleInRegistrationForcedTo()
91 ?? $this->visible_in_registration;
92 }
93
94 public function isVisibleToUser(): bool
95 {
96 return $this->definition->visibleToUserForcedTo()
97 ?? $this->visible_to_user;
98 }
99
101 {
102 return $this->definition->visibleInLocalUserAdministrationForcedTo()
103 ?? $this->visible_in_local_user_administration;
104 }
105
106 public function isVisibleInCourses(): bool
107 {
108 return $this->definition->visibleInCoursesForcedTo()
109 ?? $this->visible_in_courses;
110 }
111
112 public function isVisibleInGroups(): bool
113 {
114 return $this->definition->visibleInGroupsForcedTo()
115 ?? $this->visible_in_groups;
116 }
117
118 public function isVisibleInStudyProgrammes(): bool
119 {
120 return $this->definition->visibleInStudyProgrammesForcedTo()
121 ?? $this->visible_in_study_programmes;
122 }
123
124 public function isChangeableByUser(): bool
125 {
126 return $this->definition->changeableByUserForcedTo()
127 ?? $this->changeable_by_user;
128 }
129
131 {
132 return $this->definition->changeableInLocalUserAdministrationForcedTo()
133 ?? $this->changeable_in_local_user_administration;
134 }
135
136 public function isRequired(): bool
137 {
138 return $this->definition->requiredForcedTo()
139 ?? $this->required;
140 }
141
142 public function export(): bool
143 {
144 return $this->definition->exportForcedTo()
145 ?? $this->export;
146 }
147
148 public function isSearchable(): bool
149 {
150 return $this->definition->searchableForcedTo()
151 ?? $this->searchable;
152 }
153
154 public function isAvailableInCertificates(): bool
155 {
156 return $this->definition->availableInCertificatesForcedTo()
157 ?? $this->available_in_certificates;
158 }
159
160 public function getSection(): AvailableSections
161 {
162 return $this->definition->getSection();
163 }
164
165 public function getTableRow(
166 DataRowBuilder $row_builder,
168 UIFactory $ui_factory,
169 UIRenderer $ui_renderer
170 ): DataRow {
171 return $row_builder->buildDataRow(
172 $this->definition->getIdentifier(),
173 [
174 'field' => $this->definition->getLabel($lng),
175 'type' => $this->definition instanceof CustomField
176 ? "{$lng->txt('field_type_custom')}: {$this->definition->getTypeLabel($lng)}"
177 : $lng->txt('default'),
178 'section' => $lng->txt($this->getSection()->value),
179 'access' => $ui_renderer->render($this->buildAccessibilityListing($lng, $ui_factory)),
180 'required' => $this->isRequired(),
181 'export' => $this->export(),
182 'searchable' => $this->isSearchable(),
183 'available_in_certificates' => $this->isAvailableInCertificates()
184 ]
185 )->withDisabledAction('delete', !$this->isCustom());
186 }
187
188 public function getEditForm(
190 FieldFactory $ff,
192 array $custom_field_types,
193 array $available_custom_fields
194 ): array {
195 $fields = [];
196 if ($this->definition instanceof CustomField) {
197 $fields['edit_field'] = $ff->section(
198 $this->getCustomFieldInputs($lng, $ff, $refinery, $available_custom_fields),
199 $lng->txt('properties')
200 );
201 }
202 $fields['configuration'] = $this->getBaseInputs($lng, $ff, $refinery);
203 return [
204 'field' => $ff->group($fields)
205 ->withAdditionalTransformation(
206 $this->buildCreateFieldTransformation($refinery, $custom_field_types)
207 )
208 ];
209 }
210
211 public function getHiddenForm(
213 FieldFactory $ff,
215 array $custom_field_types,
216 array $available_custom_fields
217 ): array {
218 $fields = [];
219 if ($this->definition instanceof CustomField) {
220 $fields['edit_field'] = $ff->section(
221 $this->getHiddenCustomFieldInputs($lng, $ff, $refinery, $available_custom_fields),
222 $lng->txt('properties')
223 );
224 }
225 $fields['configuration'] = $this->getHiddenBaseInputs($ff, $refinery);
226 return [
227 'field' => $ff->group($fields)
228 ->withAdditionalTransformation(
229 $this->buildCreateFieldTransformation($refinery, $custom_field_types)
230 )
231 ];
232 }
233
236 FieldFactory $ff,
238 array $custom_field_types,
239 array $available_custom_fields
240 ): array {
241 return [
242 'field' => $ff->group([
243 'edit_field' => $ff->section(
244 [
245 'label' => $ff->text($lng->txt('field_name'))
247 $this->buildLabelConstraint($lng, $refinery, $available_custom_fields)
248 )->withRequired(true),
249 'type' => $ff->switchableGroup(
250 $this->buildCustomTypeSelectionGroups(
251 $lng,
252 $ff,
253 $refinery,
254 $custom_field_types
255 ),
256 $lng->txt('type')
257 )->withRequired(true),
258 'section' => $ff->select(
259 $lng->txt('profile_section'),
260 array_reduce(
261 AvailableSections::cases(),
262 static function (array $c, AvailableSections $v) use ($lng): array {
263 $c[$v->value] = $lng->txt($v->value);
264 return $c;
265 },
266 []
267 )
268 )->withRequired(true)
269 ],
270 $lng->txt('properties')
271 ),
272 'configuration' => $this->getBaseInputs($lng, $ff, $refinery)
274 $this->buildCreateFieldTransformation($refinery, $custom_field_types)
275 )
276 ];
277 }
278
279 public function getChangedAttributes(self $new_field): array
280 {
281 return array_reduce(
282 PropertyAttributes::cases(),
283 function (array $c, PropertyAttributes $v) use ($new_field): array {
284 $old_value = $this->retrieveValueByPropertyAttribute($v);
285 $new_value = $new_field->retrieveValueByPropertyAttribute($v);
286 if ($old_value !== $new_value) {
287 $c[$v->value] = new ChangedUserFieldAttribute(
288 $v,
289 $old_value,
290 $new_value
291 );
292 }
293 return $c;
294 },
295 []
296 );
297 }
298
300 PropertyAttributes $attribute
301 ): bool {
302 return match ($attribute) {
303 PropertyAttributes::VisibleInRegistration => $this->isVisibleInRegistration(),
304 PropertyAttributes::VisibleToUser => $this->isVisibleToUser(),
305 PropertyAttributes::VisibleInLocalUserAdministration => $this->isVisibleInLocalUserAdministration(),
306 PropertyAttributes::VisibleInCourses => $this->isVisibleInCourses(),
307 PropertyAttributes::VisibleInGroups => $this->isVisibleInGroups(),
308 PropertyAttributes::VisibleInStudyProgrammes => $this->isVisibleInStudyProgrammes(),
309 PropertyAttributes::ChangeableByUser => $this->isChangeableByUser(),
310 PropertyAttributes::ChangeableInLocalUserAdministration => $this->isChangeableInLocalUserAdministration(),
311 PropertyAttributes::Required => $this->isRequired(),
312 PropertyAttributes::Export => $this->export(),
313 PropertyAttributes::Searchable => $this->isSearchable(),
314 PropertyAttributes::AvailableInCertificates => $this->isAvailableInCertificates()
315 };
316 }
317
318 public function getLegacyInput(
320 Context $context,
321 ?\ilObjUser $user = null
323 $input = $this->definition->getLegacyInput($lng, $context, $user);
324 $input->setPostVar($this->definition->getIdentifier());
325 $input->setRequired($this->required);
326 return $input;
327 }
328
329 public function addValueToUserObject(
330 \ilObjUser $user,
331 Context $context,
332 mixed $input,
333 ?\ilPropertyFormGUI $form = null
334 ): \ilObjUser {
335 if (!$context->isFieldChangeableInType($this, $user)) {
336 throw new \Exception('It is not possible to Change this from here!');
337 }
338 return $this->definition->addValueToUserObject($user, $input, $form);
339 }
340
341 public function retrieveValueFromUser(\ilObjUser $user): mixed
342 {
343 return $this->definition->retrieveValueFromUser($user);
344 }
345
346 public function setPublishedOnUser(
347 \ilObjUser $user,
348 bool $value
349 ): \ilObjUser {
350 $user->setPref(
351 "public_{$this->definition->getIdentifier()}",
352 $value ? 'y' : 'n'
353 );
354 return $user;
355 }
356
357 public function isPublishedByUser(\ilObjUser $user): bool
358 {
359 return $this->isVisibleToUser()
360 && $user->getPref("public_{$this->definition->getIdentifier()}") === 'y';
361 }
362
365 UIFactory $ui_factory
366 ): UnorderedListing {
367 $granted_accesses = [];
368 if ($this->isVisibleInRegistration()) {
369 $granted_accesses[] = $lng->txt(
370 PropertyAttributes::VisibleInRegistration->value
371 );
372 }
373
374 if ($this->isVisibleToUser()) {
375 $granted_accesses[] = $lng->txt(
376 PropertyAttributes::VisibleToUser->value
377 );
378 }
379
380 if ($this->isVisibleInLocalUserAdministration()) {
381 $granted_accesses[] = $lng->txt(
382 PropertyAttributes::VisibleInLocalUserAdministration->value
383 );
384 }
385
386 if ($this->isVisibleInCourses()) {
387 $granted_accesses[] = $lng->txt(
388 PropertyAttributes::VisibleInCourses->value
389 );
390 }
391
392 if ($this->isVisibleInGroups()) {
393 $granted_accesses[] = $lng->txt(
394 PropertyAttributes::VisibleInGroups->value
395 );
396 }
397
398 if ($this->isVisibleInStudyProgrammes()) {
399 $granted_accesses[] = $lng->txt(
400 PropertyAttributes::VisibleInStudyProgrammes->value
401 );
402 }
403
404 if ($this->isChangeableByUser()) {
405 $granted_accesses[] = $lng->txt(
406 PropertyAttributes::ChangeableByUser->value
407 );
408 }
409
410 if ($this->isChangeableInLocalUserAdministration()) {
411 $granted_accesses[] = $lng->txt(
412 PropertyAttributes::ChangeableInLocalUserAdministration->value
413 );
414 }
415
416 return $ui_factory->listing()->unordered($granted_accesses);
417 }
418
419 private function getCustomFieldInputs(
421 FieldFactory $ff,
423 array $available_custom_fields
424 ): array {
425 return array_filter([
426 'label' => $ff->text($lng->txt('field_name'))
428 $this->buildLabelConstraint(
429 $lng,
430 $refinery,
431 $available_custom_fields
432 )
433 )->withRequired(true)
434 ->withValue($this->getLabel($lng)),
435 'type' => $ff->select($lng->txt('type'), ['0' => $this->definition->getTypeLabel($lng)])
436 ->withDisabled(true)
437 ->withValue('0'),
438 'data' => $this->definition->getAdditionalEditFormInputs($lng, $ff, $refinery),
439 'section' => $ff->select(
440 $lng->txt('profile_section'),
441 array_reduce(
442 AvailableSections::cases(),
443 function (array $c, AvailableSections $v) use ($lng): array {
444 $c[$v->value] = $lng->txt($v->value);
445 return $c;
446 },
447 []
448 )
449 )->withRequired(true)
450 ->withValue($this->definition->getSection()->value)
451 ]);
452 }
453
454 private function getBaseInputs(
456 FieldFactory $ff,
458 ): Section {
459 return $ff->section(
460 [
461 'access' => $ff->section(
462 [
463 'visible_in_registration' => $ff->checkbox(
464 $lng->txt(PropertyAttributes::VisibleInRegistration->value)
465 )->withDisabled($this->definition->visibleInRegistrationForcedTo() !== null)
466 ->withValue($this->isVisibleInRegistration()),
467 'visible_in_personal_data' => $ff->checkbox(
468 $lng->txt(PropertyAttributes::VisibleToUser->value)
469 )->withDisabled($this->definition->visibleToUserForcedTo() !== null)
470 ->withValue($this->isVisibleToUser()),
471 'visible_in_local_user_administration' => $ff->checkbox(
472 $lng->txt(PropertyAttributes::VisibleInLocalUserAdministration->value)
473 )->withDisabled($this->definition->visibleInLocalUserAdministrationForcedTo() !== null)
474 ->withValue($this->isVisibleInLocalUserAdministration()),
475 'visible_in_courses' => $ff->checkbox(
476 $lng->txt(PropertyAttributes::VisibleInCourses->value)
477 )->withDisabled($this->definition->visibleInCoursesForcedTo() !== null)
478 ->withValue($this->isVisibleInCourses()),
479 'visible_in_groups' => $ff->checkbox(
480 $lng->txt(PropertyAttributes::VisibleInGroups->value)
481 )->withDisabled($this->definition->visibleInGroupsForcedTo() !== null)
482 ->withValue($this->isVisibleInGroups()),
483 'visible_in_study_programmes' => $ff->checkbox(
484 $lng->txt(PropertyAttributes::VisibleInStudyProgrammes->value)
485 )->withDisabled($this->definition->visibleInStudyProgrammesForcedTo() !== null)
486 ->withValue($this->isVisibleInStudyProgrammes()),
487 'changeable_by_user' => $ff->checkbox(
488 $lng->txt(PropertyAttributes::ChangeableByUser->value)
489 )->withDisabled($this->definition->changeableByUserForcedTo() !== null)
490 ->withValue($this->isChangeableByUser()),
491 'changeable_in_local_user_administration' => $ff->checkbox(
492 $lng->txt(PropertyAttributes::ChangeableInLocalUserAdministration->value)
493 )->withDisabled($this->definition->changeableInLocalUserAdministrationForcedTo() !== null)
494 ->withValue($this->isChangeableInLocalUserAdministration())
495 ],
496 $lng->txt('access')
497 ),
498 'settings' => $ff->section(
499 [
500 'required' => $ff->checkbox(
501 $lng->txt(PropertyAttributes::Required->value)
502 )->withDisabled($this->definition->requiredForcedTo() !== null)
503 ->withValue($this->isRequired()),
504 'export' => $ff->checkbox(
505 $lng->txt(PropertyAttributes::Export->value)
506 )->withDisabled($this->definition->exportForcedTo() !== null)
507 ->withValue($this->export()),
508 'searchable' => $ff->checkbox(
509 $lng->txt(PropertyAttributes::Searchable->value)
510 )->withDisabled($this->definition->searchableForcedTo() !== null)
511 ->withValue($this->isSearchable()),
512 'available_in_certificates' => $ff->checkbox(
513 $lng->txt(PropertyAttributes::AvailableInCertificates->value)
514 )->withDisabled($this->definition->availableInCertificatesForcedTo() !== null)
515 ->withValue($this->isAvailableInCertificates())
516 ],
517 $lng->txt('settings')
518 )
519 ],
520 $lng->txt('configuration')
522 $this->buildRequiredMustByVisibleInRegistrationConstraint($lng, $refinery)
523 );
524 }
525
528 FieldFactory $ff,
530 array $available_custom_fields
531 ): array {
532 return array_filter([
533 'label' => $ff->hidden()
535 $this->buildLabelConstraint($lng, $refinery, $available_custom_fields)
536 )->withValue($this->getLabel($lng)),
537 'data' => $ff->hidden()->withValue($this->definition->getAdditionalEditFormData()),
538 'section' => $ff->hidden()->withValue($this->getSection())
539 ]);
540 }
541
542 private function getHiddenBaseInputs(
543 FieldFactory $ff,
545 ): Group {
546 return $ff->group([
547 'access' => $ff->group(
548 [
549 'visible_in_registration' => $ff->hidden()
550 ->withDisabled($this->definition->requiredForcedTo() === true)
551 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
552 ->withValue($this->isVisibleInRegistration() ? '1' : '0'),
553 'visible_in_personal_data' => $ff->hidden()
554 ->withDisabled($this->definition->visibleToUserForcedTo() !== null)
555 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
556 ->withValue($this->isVisibleToUser() ? '1' : '0'),
557 'visible_in_local_user_administration' => $ff->hidden()
558 ->withDisabled($this->definition->visibleInLocalUserAdministrationForcedTo() !== null)
559 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
560 ->withValue($this->isVisibleInLocalUserAdministration() ? '1' : '0'),
561 'visible_in_courses' => $ff->hidden()
562 ->withDisabled($this->definition->visibleInCoursesForcedTo() !== null)
563 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
564 ->withValue($this->isVisibleInCourses() ? '1' : '0'),
565 'visible_in_groups' => $ff->hidden()
566 ->withDisabled($this->definition->visibleInGroupsForcedTo() !== null)
567 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
568 ->withValue($this->isVisibleInGroups() ? '1' : '0'),
569 'visible_in_study_programmes' => $ff->hidden()
570 ->withDisabled($this->definition->visibleInStudyProgrammesForcedTo() !== null)
571 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
572 ->withValue($this->isVisibleInStudyProgrammes() ? '1' : '0'),
573 'changeable_by_user' => $ff->hidden()
574 ->withDisabled($this->definition->changeableByUserForcedTo() !== null)
575 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
576 ->withValue($this->isChangeableByUser() ? '1' : '0'),
577 'changeable_in_local_user_administration' => $ff->hidden()
578 ->withDisabled($this->definition->changeableInLocalUserAdministrationForcedTo() !== null)
579 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
580 ->withValue($this->isChangeableInLocalUserAdministration() ? '1' : '0')
581 ]
582 ),
583 'settings' => $ff->group(
584 [
585 'required' => $ff->hidden()
586 ->withDisabled($this->definition->requiredForcedTo() !== null)
587 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
588 ->withValue($this->isRequired() ? '1' : '0'),
589 'export' => $ff->hidden()
590 ->withDisabled($this->definition->exportForcedTo() !== null)
591 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
592 ->withValue($this->export() ? '1' : '0'),
593 'searchable' => $ff->hidden()
594 ->withDisabled($this->definition->searchableForcedTo() !== null)
595 ->withAdditionalTransformation($refinery->kindlyTo()->bool())
596 ->withValue($this->isSearchable() ? '1' : '0'),
597 ]
598 )
599 ]);
600 }
601
604 FieldFactory $ff,
606 array $custom_field_types
607 ): array {
608 return array_reduce(
609 $custom_field_types,
610 function (array $c, Custom\Type $v) use ($lng, $ff, $refinery): array {
611 $edit_inputs = $v->getAdditionalEditFormInputs($lng, $ff, $refinery, null);
612 $c[$v::class] = $ff->group(
613 $edit_inputs === null ? [] : ['data' => $edit_inputs],
614 $v->getLabel($lng)
615 );
616 return $c;
617 },
618 []
619 );
620 }
621
622 private function buildLabelConstraint(
625 array $available_custom_fields
626 ): Constraint {
627 return $refinery->custom()->constraint(
628 fn(string $label): bool => array_filter(
629 $available_custom_fields,
630 fn(self $v) => $v->getLabel($lng) === $label
631 && $v->getIdentifier() !== $this->getIdentifier()
632 ) === [],
633 $lng->txt('udf_name_already_exists')
634 );
635 }
636
640 ): Constraint {
641 return $refinery->custom()->constraint(
642 static fn(array $vs): bool => !$vs['settings']['required'] || $vs['access']['visible_in_registration'],
643 $lng->txt('invalid_visible_required_options_selected')
644 );
645 }
646
649 array $custom_field_types
650 ): Transformation {
651 $cts = array_map(
652 static fn(CustomType $v): string => $v::class,
653 $custom_field_types
654 );
655 return $refinery->custom()->transformation(
656 function (array $vs) use ($cts, $custom_field_types): self {
657 $access = $vs['configuration']['access'];
658 $settings = $vs['configuration']['settings'];
659 $clone = clone $this;
660 $clone->visible_in_registration = $this->definition->requiredForcedTo() === true
661 ? true
662 : $access['visible_in_registration'];
663 $clone->visible_to_user = $this->definition->visibleToUserForcedTo()
664 ?? $access['visible_in_personal_data'];
665 $clone->visible_in_local_user_administration = $this->definition->visibleInLocalUserAdministrationForcedTo()
666 ?? $access['visible_in_local_user_administration'];
667 $clone->visible_in_courses = $this->definition->visibleInCoursesForcedTo()
668 ?? $access['visible_in_courses'];
669 $clone->visible_in_groups = $this->definition->visibleInGroupsForcedTo()
670 ?? $access['visible_in_groups'];
671 $clone->visible_in_study_programmes = $this->definition->visibleInStudyProgrammesForcedTo()
672 ?? $access['visible_in_study_programmes'];
673 $clone->changeable_by_user = $this->definition->changeableByUserForcedTo()
674 ?? $access['changeable_by_user'];
675 $clone->changeable_in_local_user_administration = $this->definition->changeableInLocalUserAdministrationForcedTo()
676 ?? $access['changeable_in_local_user_administration'];
677 $clone->required = $this->definition->requiredForcedTo()
678 ?? $settings['required'];
679 $clone->export = $this->definition->exportForcedTo()
680 ?? $settings['export'];
681 $clone->searchable = $this->definition->searchableForcedTo()
682 ?? $settings['searchable'];
683 $clone->available_in_certificates = $this->definition->availableInCertificatesForcedTo()
684 ?? $settings['available_in_certificates'];
685
686 if (!$clone->isCustom()) {
687 return $clone;
688 }
689
690 $definition = clone $this->definition
691 ->withLabel($vs['edit_field']['label'])
692 ->withSection(AvailableSections::tryFrom($vs['edit_field']['section']))
693 ->withAdditionalEditFormData(
694 $vs['edit_field']['data']
695 ?? $vs['edit_field']['type'][1]['data']
696 ?? null
697 );
698 if ($definition->isUnspecific()
699 && ($field_type = array_search($vs['edit_field']['type'][0], $cts)) !== false) {
700 $definition = $definition->withType($custom_field_types[$field_type]);
701 }
702 $clone->definition = $definition;
703 return $clone;
704 }
705 );
706 }
707}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Builds data types.
Definition: Factory.php:36
getLabel(Language $lng)
Definition: Field.php:73
getTableRow(DataRowBuilder $row_builder, Language $lng, UIFactory $ui_factory, UIRenderer $ui_renderer)
Definition: Field.php:165
setPublishedOnUser(\ilObjUser $user, bool $value)
Definition: Field.php:346
getHiddenBaseInputs(FieldFactory $ff, Refinery $refinery)
Definition: Field.php:542
getLegacyInput(Language $lng, Context $context, ?\ilObjUser $user=null)
Definition: Field.php:318
buildCustomTypeSelectionGroups(Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types)
Definition: Field.php:602
getChangedAttributes(self $new_field)
Definition: Field.php:279
retrieveValueFromUser(\ilObjUser $user)
Definition: Field.php:341
getCustomFieldInputs(Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
Definition: Field.php:419
buildAccessibilityListing(Language $lng, UIFactory $ui_factory)
Definition: Field.php:363
isPublishedByUser(\ilObjUser $user)
Definition: Field.php:357
retrieveValueByPropertyAttribute(PropertyAttributes $attribute)
Definition: Field.php:299
getHiddenCustomFieldInputs(Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
Definition: Field.php:526
addValueToUserObject(\ilObjUser $user, Context $context, mixed $input, ?\ilPropertyFormGUI $form=null)
Definition: Field.php:329
getEditForm(Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
Definition: Field.php:188
__construct(private FieldDefinition $definition, private bool $visible_in_registration=false, private bool $visible_to_user=false, private bool $visible_in_local_user_administration=false, private bool $visible_in_courses=false, private bool $visible_in_groups=false, private bool $visible_in_study_programmes=false, private bool $changeable_by_user=false, private bool $changeable_in_local_user_administration=false, private bool $required=false, private bool $export=false, private bool $searchable=false, private bool $available_in_certificates=false)
Definition: Field.php:46
getCreateCustomFieldForm(Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
Definition: Field.php:234
buildCreateFieldTransformation(Refinery $refinery, array $custom_field_types)
Definition: Field.php:647
buildRequiredMustByVisibleInRegistrationConstraint(Language $lng, Refinery $refinery)
Definition: Field.php:637
getBaseInputs(Language $lng, FieldFactory $ff, Refinery $refinery)
Definition: Field.php:454
getHiddenForm(Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
Definition: Field.php:211
buildLabelConstraint(Language $lng, Refinery $refinery, array $available_custom_fields)
Definition: Field.php:622
return true
This class represents a property in a property form.
setPostVar(string $a_postvar)
User class.
getPref(string $a_keyword)
This class represents a property form user interface.
$c
Definition: deliver.php:25
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
A transformation is a function from one datatype to another.
This is what a factory for input fields looks like.
Definition: Factory.php:31
Describes the monoid operation of grouping form inputs.
Definition: Group.php:32
This describes section inputs.
Definition: Section.php:29
An entity that renders components to a string output.
Definition: Renderer.php:31
withAdditionalTransformation(Transformation $trafo)
@inheritDoc
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:31
if(!file_exists('../ilias.ini.php'))
$context
Definition: webdav.php:31