ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclFileFieldRepresentation Class Reference
+ Inheritance diagram for ilDclFileFieldRepresentation:
+ Collaboration diagram for ilDclFileFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
- Public Member Functions inherited from ilDclBaseFieldRepresentation
 __construct (ilDclBaseFieldModel $field)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 Checks if a filter affects a record. More...
 
 parseSortingValue (string $value, bool $link=true)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
 addFieldCreationForm (ilSubEnabledFormPropertyGUI $form, ilObjDataCollection $dcl, string $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId (string $property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Protected Member Functions

 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 
- Protected Member Functions inherited from ilDclBaseFieldRepresentation
 setupFilterInputField (?ilTableFilterItem $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue (ilTableFilterItem $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 

Private Member Functions

 requiredWorkaroundForInputField (ilFileInputGUI $input, ?int $record_id)
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

Definition at line 21 of file class.ilDclFileFieldRepresentation.php.

Member Function Documentation

◆ buildFieldCreationInput()

ilDclFileFieldRepresentation::buildFieldCreationInput ( ilObjDataCollection  $dcl,
string  $mode = 'create' 
)
protected

Build the creation-input-field.

Reimplemented from ilDclBaseFieldRepresentation.

Reimplemented in ilDclMobFieldRepresentation.

Definition at line 67 of file class.ilDclFileFieldRepresentation.php.

71 $opt = parent::buildFieldCreationInput($dcl, $mode);
72
73 $prop_filetype = new ilTextInputGUI(
74 $this->lng->txt('dcl_supported_filetypes'),
76 );
77 $prop_filetype->setInfo($this->lng->txt('dcl_supported_filetypes_desc'));
78
79 $opt->addSubItem($prop_filetype);
80
81 return $opt;
82 }
This class represents an option in a radio group.
This class represents a text property in a property form.

◆ getInputField()

ilDclFileFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
?int  $record_id = null 
)

Returns field-input.

Reimplemented from ilDclBaseFieldRepresentation.

Definition at line 23 of file class.ilDclFileFieldRepresentation.php.

27 $input = new ilFileInputGUI(
28 $this->getField()->getTitle(),
29 'field_' . $this->getField()->getId()
30 );
31
32 $supported_suffixes = $this->getField()->getSupportedExtensions();
33 if (!empty($supported_suffixes)) {
34 $input->setSuffixes($supported_suffixes);
35 }
36
37 $input->setAllowDeletion(true);
38 $this->requiredWorkaroundForInputField($input, $record_id); // TODO CHeck
39
40 return $input;
41 }
requiredWorkaroundForInputField(ilFileInputGUI $input, ?int $record_id)
This class represents a file property in a property form.

◆ requiredWorkaroundForInputField()

ilDclFileFieldRepresentation::requiredWorkaroundForInputField ( ilFileInputGUI  $input,
?int  $record_id 
)
private

Definition at line 43 of file class.ilDclFileFieldRepresentation.php.

46 : void {
47 if ($record_id !== null) {
48 $record = ilDclCache::getRecordCache($record_id);
49 }
50
51 $this->setupInputField($input, $this->getField());
52
53 //WORKAROUND
54 // If field is from type file: if it's required but already has a value it is no longer required as the old value is taken as default without the form knowing about it.
55 if ($record_id !== null && $record->getId()) {
56 $field_value = $record->getRecordFieldValue($this->getField()->getId());
57 if ($field_value) {
58 $input->setRequired(false);
59 }
60 }
61 // If this is an ajax request to return the form, input files are currently not supported
62 if ($this->ctrl->isAsynch()) {
63 $input->setDisabled(true);
64 }
65 }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
static getRecordCache(?int $record_id)
setRequired(bool $a_required)
setDisabled(bool $a_disabled)

References ilDclCache\getRecordCache().

+ Here is the call graph for this function:

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