ILIAS  release_8 Revision v8.23
ilDclMobFieldRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclMobFieldRepresentation:
+ Collaboration diagram for ilDclMobFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
- Public Member Functions inherited from ilDclFileuploadFieldRepresentation
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
- 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 ilDclFileuploadFieldRepresentation
 requiredWorkaroundForInputField (ilFileInputGUI $input, ?int $record_id)
 
 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...
 

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

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilDclMobFieldRepresentation.php.

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclMobFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)
Returns
array|string|null
Exceptions
Exception

Definition at line 36 of file class.ilDclMobFieldRepresentation.php.

References ilTable2GUI\addFilterItemByMetaType(), ilTable2GUI\FILTER_TEXT, ilDclBaseFieldRepresentation\getField(), ilDclBaseFieldRepresentation\getFilterInputFieldValue(), ILIAS\Survey\Mode\getId(), and ilDclBaseFieldRepresentation\setupFilterInputField().

37  {
38  $input = $table->addFilterItemByMetaType(
39  "filter_" . $this->getField()->getId(),
41  false,
42  $this->getField()->getId()
43  );
44  $input->setSubmitFormOnEnter(true);
45 
46  $this->setupFilterInputField($input);
47 
48  return $this->getFilterInputFieldValue($input);
49  }
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
+ Here is the call graph for this function:

◆ buildFieldCreationInput()

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

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

References ilDclMobFieldModel\$mob_suffixes, ilSubEnabledFormPropertyGUI\addSubItem(), ilDclBaseFieldRepresentation\getField(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_HEIGHT, ilDclBaseFieldModel\PROP_LINK_DETAIL_PAGE_MOB, ilDclBaseFieldModel\PROP_WIDTH, ilRadioOption\setInfo(), and ilNumberInputGUI\setSize().

68  {
69  $opt = new ilRadioOption(
70  $this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()),
71  $this->getField()->getDatatypeId()
72  );
73  $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
74 
75  $opt->setInfo(sprintf($opt->getInfo(), implode(", ", ilDclMobFieldModel::$mob_suffixes)));
76 
77  $prop_width = new ilNumberInputGUI($this->lng->txt('dcl_width'), 'prop_' . ilDclBaseFieldModel::PROP_WIDTH);
78  $prop_width->setSize(5);
79  $prop_width->setMaxValue(4000);
80 
81  $opt->addSubItem($prop_width);
82 
83  $prop_height = new ilNumberInputGUI($this->lng->txt('dcl_height'), 'prop_' . ilDclBaseFieldModel::PROP_HEIGHT);
84  $prop_height->setSize(5);
85  $prop_height->setMaxValue(4000);
86 
87  $opt->addSubItem($prop_height);
88 
89  $prop_page_details = new ilDclCheckboxInputGUI(
90  $this->lng->txt('dcl_link_detail_page'),
92  );
93  $opt->addSubItem($prop_page_details);
94 
95  return $opt;
96  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
This class represents a number property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getInputField()

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

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

References ilDclMobFieldModel\$mob_suffixes, ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ilDclFileuploadFieldRepresentation\requiredWorkaroundForInputField().

22  {
23  $input = new ilFileInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24  $input->setSuffixes(ilDclMobFieldModel::$mob_suffixes);
25  $input->setAllowDeletion(true);
26 
27  $this->requiredWorkaroundForInputField($input, $record_id);
28 
29  return $input;
30  }
This class represents a file property in a property form.
requiredWorkaroundForInputField(ilFileInputGUI $input, ?int $record_id)
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclMobFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)
Parameters
string$filter

Definition at line 54 of file class.ilDclMobFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ilDclBaseRecordModel\getRecordFieldValue().

54  : bool
55  {
56  $value = $record->getRecordFieldValue($this->getField()->getId());
57 
58  $m_obj = new ilObjMediaObject($value);
59  $file_name = $m_obj->getTitle();
60  if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
61  return true;
62  }
63 
64  return false;
65  }
getRecordFieldValue(?int $field_id)
Get Field Value.
+ Here is the call graph for this function:

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