ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclFileFieldRepresentation Class Reference
+ Inheritance diagram for ilDclFileFieldRepresentation:
+ Collaboration diagram for ilDclFileFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
- 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')
 
- 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
 
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

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

References ILIAS\Repository\lng(), and ilDclBaseFieldModel\PROP_SUPPORTED_FILE_TYPES.

70  : ilRadioOption {
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.
+ Here is the call graph for this function:

◆ getInputField()

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

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

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and requiredWorkaroundForInputField().

26  : ilFileInputGUI {
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  }
This class represents a file property in a property form.
requiredWorkaroundForInputField(ilFileInputGUI $input, ?int $record_id)
+ Here is the call graph for this function:

◆ requiredWorkaroundForInputField()

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

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

References ILIAS\Repository\ctrl(), ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ilDclCache\getRecordCache(), null, ilFormPropertyGUI\setDisabled(), ilFormPropertyGUI\setRequired(), and ilDclBaseFieldRepresentation\setupInputField().

Referenced by getInputField().

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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setRequired(bool $a_required)
static getRecordCache(?int $record_id)
setDisabled(bool $a_disabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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