ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Profile\Fields\Field Class Reference
+ Inheritance diagram for ILIAS\User\Profile\Fields\Field:
+ Collaboration diagram for ILIAS\User\Profile\Fields\Field:

Public Member Functions

 __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)
 
 getIdentifier ()
 
 getDefinition ()
 
 getLabel (Language $lng)
 
 isCustom ()
 
 hiddenInLists ()
 
 isVisibleInRegistration ()
 
 isVisibleToUser ()
 
 isVisibleInLocalUserAdministration ()
 
 isVisibleInCourses ()
 
 isVisibleInGroups ()
 
 isVisibleInStudyProgrammes ()
 
 isChangeableByUser ()
 
 isChangeableInLocalUserAdministration ()
 
 isRequired ()
 
 export ()
 
 isSearchable ()
 
 isAvailableInCertificates ()
 
 getSection ()
 
 getTableRow (DataRowBuilder $row_builder, Language $lng, UIFactory $ui_factory, UIRenderer $ui_renderer)
 
 getEditForm (Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
 
 getHiddenForm (Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
 
 getCreateCustomFieldForm (Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types, array $available_custom_fields)
 
 getChangedAttributes (self $new_field)
 
 retrieveValueByPropertyAttribute (PropertyAttributes $attribute)
 
 getLegacyInput (Language $lng, Context $context, ?\ilObjUser $user=null)
 
 addValueToUserObject (\ilObjUser $user, Context $context, mixed $input, ?\ilPropertyFormGUI $form=null)
 
 retrieveValueFromUser (\ilObjUser $user)
 
 setPublishedOnUser (\ilObjUser $user, bool $value)
 
 isPublishedByUser (\ilObjUser $user)
 
 getIdentifier ()
 
 getLabel (Language $lng)
 
 getSection ()
 
 retrieveValueFromUser (\ilObjUser $user)
 

Private Member Functions

 buildAccessibilityListing (Language $lng, UIFactory $ui_factory)
 
 getCustomFieldInputs (Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
 
 getBaseInputs (Language $lng, FieldFactory $ff, Refinery $refinery)
 
 getHiddenCustomFieldInputs (Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
 
 getHiddenBaseInputs (FieldFactory $ff, Refinery $refinery)
 
 buildCustomTypeSelectionGroups (Language $lng, FieldFactory $ff, Refinery $refinery, array $custom_field_types)
 
 buildLabelConstraint (Language $lng, Refinery $refinery, array $available_custom_fields)
 
 buildRequiredMustByVisibleInRegistrationConstraint (Language $lng, Refinery $refinery)
 
 buildCreateFieldTransformation (Refinery $refinery, array $custom_field_types)
 

Detailed Description

Definition at line 44 of file Field.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Profile\Fields\Field::__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 at line 46 of file Field.php.

60 {
61 }

Member Function Documentation

◆ addValueToUserObject()

ILIAS\User\Profile\Fields\Field::addValueToUserObject ( \ilObjUser  $user,
Context  $context,
mixed  $input,
?\ilPropertyFormGUI  $form = null 
)

Definition at line 329 of file Field.php.

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 }
User class.
$context
Definition: webdav.php:31

◆ buildAccessibilityListing()

ILIAS\User\Profile\Fields\Field::buildAccessibilityListing ( Language  $lng,
UIFactory  $ui_factory 
)
private

Definition at line 363 of file Field.php.

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
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
411 $granted_accesses[] = $lng->txt(
412 PropertyAttributes::ChangeableInLocalUserAdministration->value
413 );
414 }
415
416 return $ui_factory->listing()->unordered($granted_accesses);
417 }
global $lng
Definition: privfeed.php:31

References $lng.

◆ buildCreateFieldTransformation()

ILIAS\User\Profile\Fields\Field::buildCreateFieldTransformation ( Refinery  $refinery,
array  $custom_field_types 
)
private

Definition at line 647 of file Field.php.

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 }
if(!file_exists('../ilias.ini.php'))

References if.

◆ buildCustomTypeSelectionGroups()

ILIAS\User\Profile\Fields\Field::buildCustomTypeSelectionGroups ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $custom_field_types 
)
private

Definition at line 602 of file Field.php.

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 }
$c
Definition: deliver.php:25

◆ buildLabelConstraint()

ILIAS\User\Profile\Fields\Field::buildLabelConstraint ( Language  $lng,
Refinery  $refinery,
array  $available_custom_fields 
)
private

Definition at line 622 of file Field.php.

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 }

◆ buildRequiredMustByVisibleInRegistrationConstraint()

ILIAS\User\Profile\Fields\Field::buildRequiredMustByVisibleInRegistrationConstraint ( Language  $lng,
Refinery  $refinery 
)
private

Definition at line 637 of file Field.php.

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 }

◆ export()

ILIAS\User\Profile\Fields\Field::export ( )

Definition at line 142 of file Field.php.

142 : bool
143 {
144 return $this->definition->exportForcedTo()
145 ?? $this->export;
146 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ getBaseInputs()

ILIAS\User\Profile\Fields\Field::getBaseInputs ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery 
)
private

Definition at line 454 of file Field.php.

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')
521 )->withAdditionalTransformation(
523 );
524 }
buildRequiredMustByVisibleInRegistrationConstraint(Language $lng, Refinery $refinery)
Definition: Field.php:637

◆ getChangedAttributes()

ILIAS\User\Profile\Fields\Field::getChangedAttributes ( self  $new_field)

Definition at line 279 of file Field.php.

279 : 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 }
retrieveValueByPropertyAttribute(PropertyAttributes $attribute)
Definition: Field.php:299

References $c.

◆ getCreateCustomFieldForm()

ILIAS\User\Profile\Fields\Field::getCreateCustomFieldForm ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $custom_field_types,
array  $available_custom_fields 
)

Definition at line 234 of file Field.php.

240 : array {
241 return [
242 'field' => $ff->group([
243 'edit_field' => $ff->section(
244 [
245 'label' => $ff->text($lng->txt('field_name'))
246 ->withAdditionalTransformation(
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)
273 ])->withAdditionalTransformation(
274 $this->buildCreateFieldTransformation($refinery, $custom_field_types)
275 )
276 ];
277 }
buildCreateFieldTransformation(Refinery $refinery, array $custom_field_types)
Definition: Field.php:647

◆ getCustomFieldInputs()

ILIAS\User\Profile\Fields\Field::getCustomFieldInputs ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $available_custom_fields 
)
private

Definition at line 419 of file Field.php.

424 : array {
425 return array_filter([
426 'label' => $ff->text($lng->txt('field_name'))
427 ->withAdditionalTransformation(
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 }
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:61

◆ getDefinition()

ILIAS\User\Profile\Fields\Field::getDefinition ( )

Definition at line 68 of file Field.php.

69 {
70 return $this->definition;
71 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\deleteCustomField(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ getEditForm()

ILIAS\User\Profile\Fields\Field::getEditForm ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $custom_field_types,
array  $available_custom_fields 
)

Definition at line 188 of file Field.php.

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 }
getCustomFieldInputs(Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
Definition: Field.php:419
getBaseInputs(Language $lng, FieldFactory $ff, Refinery $refinery)
Definition: Field.php:454

References $lng, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.

◆ getHiddenBaseInputs()

ILIAS\User\Profile\Fields\Field::getHiddenBaseInputs ( FieldFactory  $ff,
Refinery  $refinery 
)
private

Definition at line 542 of file Field.php.

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 }

◆ getHiddenCustomFieldInputs()

ILIAS\User\Profile\Fields\Field::getHiddenCustomFieldInputs ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $available_custom_fields 
)
private

Definition at line 526 of file Field.php.

531 : array {
532 return array_filter([
533 'label' => $ff->hidden()
534 ->withAdditionalTransformation(
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 }

◆ getHiddenForm()

ILIAS\User\Profile\Fields\Field::getHiddenForm ( Language  $lng,
FieldFactory  $ff,
Refinery  $refinery,
array  $custom_field_types,
array  $available_custom_fields 
)

Definition at line 211 of file Field.php.

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 }
getHiddenBaseInputs(FieldFactory $ff, Refinery $refinery)
Definition: Field.php:542
getHiddenCustomFieldInputs(Language $lng, FieldFactory $ff, Refinery $refinery, array $available_custom_fields)
Definition: Field.php:526

References $lng, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.

◆ getIdentifier()

ILIAS\User\Profile\Fields\Field::getIdentifier ( )

Implements ILIAS\User\Property.

Definition at line 63 of file Field.php.

63 : string
64 {
65 return $this->definition->getIdentifier();
66 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ getLabel()

ILIAS\User\Profile\Fields\Field::getLabel ( Language  $lng)

Implements ILIAS\User\Property.

Definition at line 73 of file Field.php.

73 : string
74 {
75 return $this->definition->getLabel($lng);
76 }

References $lng.

Referenced by ilUserDefinedFieldsPlaceholderDescription\__construct(), and ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows().

+ Here is the caller graph for this function:

◆ getLegacyInput()

ILIAS\User\Profile\Fields\Field::getLegacyInput ( Language  $lng,
Context  $context,
?\ilObjUser  $user = null 
)

Definition at line 318 of file Field.php.

323 $input = $this->definition->getLegacyInput($lng, $context, $user);
324 $input->setPostVar($this->definition->getIdentifier());
325 $input->setRequired($this->required);
326 return $input;
327 }
This class represents a property in a property form.
setPostVar(string $a_postvar)

◆ getSection()

ILIAS\User\Profile\Fields\Field::getSection ( )

Implements ILIAS\User\Property.

Definition at line 160 of file Field.php.

161 {
162 return $this->definition->getSection();
163 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows().

+ Here is the caller graph for this function:

◆ getTableRow()

ILIAS\User\Profile\Fields\Field::getTableRow ( DataRowBuilder  $row_builder,
Language  $lng,
UIFactory  $ui_factory,
UIRenderer  $ui_renderer 
)

Definition at line 165 of file Field.php.

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 }
buildDataRow(string $id, array $record)

◆ hiddenInLists()

ILIAS\User\Profile\Fields\Field::hiddenInLists ( )

Definition at line 83 of file Field.php.

83 : bool
84 {
85 return $this->definition->hiddenInLists();
86 }

◆ isAvailableInCertificates()

ILIAS\User\Profile\Fields\Field::isAvailableInCertificates ( )

Definition at line 154 of file Field.php.

154 : bool
155 {
156 return $this->definition->availableInCertificatesForcedTo()
157 ?? $this->available_in_certificates;
158 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isChangeableByUser()

ILIAS\User\Profile\Fields\Field::isChangeableByUser ( )

Definition at line 124 of file Field.php.

124 : bool
125 {
126 return $this->definition->changeableByUserForcedTo()
127 ?? $this->changeable_by_user;
128 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isChangeableInLocalUserAdministration()

ILIAS\User\Profile\Fields\Field::isChangeableInLocalUserAdministration ( )

Definition at line 130 of file Field.php.

130 : bool
131 {
132 return $this->definition->changeableInLocalUserAdministrationForcedTo()
133 ?? $this->changeable_in_local_user_administration;
134 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isCustom()

ILIAS\User\Profile\Fields\Field::isCustom ( )

Definition at line 78 of file Field.php.

78 : bool
79 {
80 return $this->definition instanceof CustomField;
81 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\buildCreateModal(), ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isPublishedByUser()

ILIAS\User\Profile\Fields\Field::isPublishedByUser ( \ilObjUser  $user)

Definition at line 357 of file Field.php.

357 : bool
358 {
359 return $this->isVisibleToUser()
360 && $user->getPref("public_{$this->definition->getIdentifier()}") === 'y';
361 }

References ilObjUser\getPref().

+ Here is the call graph for this function:

◆ isRequired()

ILIAS\User\Profile\Fields\Field::isRequired ( )

Definition at line 136 of file Field.php.

136 : bool
137 {
138 return $this->definition->requiredForcedTo()
139 ?? $this->required;
140 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isSearchable()

ILIAS\User\Profile\Fields\Field::isSearchable ( )

Definition at line 148 of file Field.php.

148 : bool
149 {
150 return $this->definition->searchableForcedTo()
151 ?? $this->searchable;
152 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationGUI\orderRows(), and ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleInCourses()

ILIAS\User\Profile\Fields\Field::isVisibleInCourses ( )

Definition at line 106 of file Field.php.

106 : bool
107 {
108 return $this->definition->visibleInCoursesForcedTo()
109 ?? $this->visible_in_courses;
110 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleInGroups()

ILIAS\User\Profile\Fields\Field::isVisibleInGroups ( )

Definition at line 112 of file Field.php.

112 : bool
113 {
114 return $this->definition->visibleInGroupsForcedTo()
115 ?? $this->visible_in_groups;
116 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleInLocalUserAdministration()

ILIAS\User\Profile\Fields\Field::isVisibleInLocalUserAdministration ( )

Definition at line 100 of file Field.php.

100 : bool
101 {
102 return $this->definition->visibleInLocalUserAdministrationForcedTo()
103 ?? $this->visible_in_local_user_administration;
104 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleInRegistration()

ILIAS\User\Profile\Fields\Field::isVisibleInRegistration ( )

Definition at line 88 of file Field.php.

88 : bool
89 {
90 return $this->definition->visibleInRegistrationForcedTo()
91 ?? $this->visible_in_registration;
92 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleInStudyProgrammes()

ILIAS\User\Profile\Fields\Field::isVisibleInStudyProgrammes ( )

Definition at line 118 of file Field.php.

118 : bool
119 {
120 return $this->definition->visibleInStudyProgrammesForcedTo()
121 ?? $this->visible_in_study_programmes;
122 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ isVisibleToUser()

ILIAS\User\Profile\Fields\Field::isVisibleToUser ( )

Definition at line 94 of file Field.php.

94 : bool
95 {
96 return $this->definition->visibleToUserForcedTo()
97 ?? $this->visible_to_user;
98 }

Referenced by ILIAS\User\Profile\Fields\ConfigurationRepository\storeConfiguration().

+ Here is the caller graph for this function:

◆ retrieveValueByPropertyAttribute()

ILIAS\User\Profile\Fields\Field::retrieveValueByPropertyAttribute ( PropertyAttributes  $attribute)

Definition at line 299 of file Field.php.

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 }

◆ retrieveValueFromUser()

ILIAS\User\Profile\Fields\Field::retrieveValueFromUser ( \ilObjUser  $user)

Implements ILIAS\User\Property.

Definition at line 341 of file Field.php.

341 : mixed
342 {
343 return $this->definition->retrieveValueFromUser($user);
344 }

◆ setPublishedOnUser()

ILIAS\User\Profile\Fields\Field::setPublishedOnUser ( \ilObjUser  $user,
bool  $value 
)

Definition at line 346 of file Field.php.

349 : \ilObjUser {
350 $user->setPref(
351 "public_{$this->definition->getIdentifier()}",
352 $value ? 'y' : 'n'
353 );
354 return $user;
355 }
setPref(string $a_keyword, ?string $a_value)

The documentation for this class was generated from the following file: