ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Text.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27use ILIAS\Refinery\Factory as Refinery;
28
29class Text implements Type
30{
31 public function getLabel(Language $lng): string
32 {
33 return $lng->txt('udf_type_text');
34 }
35
38 FieldFactory $ff,
40 ?string $data
41 ): ?FormInput {
42 return null;
43 }
44
45 public function getLegacyInput(
48 array $user_value,
49 string $label,
50 ?string $data
52 $input = new \ilTextInputGUI($label);
53 $input->setValue($user_value[0] ?? '');
54 return $input;
55 }
56
57 public function prepareUserInputForStorage(mixed $input): array
58 {
59 return [$input];
60 }
61
63 array $input,
64 ?string $data
65 ): string {
66 return $input[0] ?? '';
67 }
68}
Builds data types.
Definition: Factory.php:36
buildPresentationValueFromUserValue(array $input, ?string $data)
If you have a value that has a $key => $value structure, e.g.
Definition: Text.php:62
getLegacyInput(Language $lng, Context $context, array $user_value, string $label, ?string $data)
MUST return a ilFormPropertyGUI to be shown to the user when entering the information.
Definition: Text.php:45
getAdditionalEditFormInputs(Language $lng, FieldFactory $ff, Refinery $refinery, ?string $data)
MAY return a valid FormInput that will be added to the form to edit/create the custom field to specif...
Definition: Text.php:36
prepareUserInputForStorage(mixed $input)
Definition: Text.php:57
This class represents a property in a property form.
This class represents a text property in a property form.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This describes inputs that can be used in forms.
Definition: FormInput.php:33
This is what a factory for input fields looks like.
Definition: Factory.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $lng
Definition: privfeed.php:31
$context
Definition: webdav.php:31