19declare(strict_types=1);
29 $input->setWidth(100);
30 $input->setWidthUnit(
'%');
44 $input->setHeight(32 * min(5, max(1, count(
$options))));
47 $ref_id = $this->
http->wrapper()->query()->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
52 $input->addCustomAttribute(
'data-ref="1"');
53 $input->addCustomAttribute(
'data-ref-table-id="' . $reffield->getTableId() .
'"');
54 $input->addCustomAttribute(
'data-ref-field-id="' . $reffield->getId() .
'"');
68 $options = [
'' => $this->
lng->txt(
'dcl_all_entries')]
70 + [
'none' => $this->
lng->txt(
'dcl_no_entry')];
84 foreach ($reftable->getRecords() as $record) {
85 $record_field = $record->getRecordField($fieldref);
86 switch ($reffield->getDatatypeId()) {
88 if ($record_field->getValue()) {
89 $file_obj =
new ilObjFile($record_field->getValue(),
false);
90 $options[$record->getId()] = $file_obj->getFileName();
95 $options[$record->getId()] = $media_obj->getTitle();
98 $options[$record->getId()] = strtotime($record->getRecordField($fieldref)->getPlainText());
99 $options2[$record->getId()] = $record->getRecordField($fieldref)->getPlainText();
102 $value = $record_field->getValue();
104 if (!is_array($value)) {
105 $value = [
'title' =>
'',
'link' => $value];
107 $value = $value[
'title'] ?: $value[
'link'];
109 $options[$record->getId()] = $value;
112 $value = $record_field->getValue();
116 $options[$record->getId()] = $record_field->getExportValue();
120 asort(
$options, SORT_NATURAL | SORT_FLAG_CASE);
123 foreach (
$options as $key => $opt) {
124 if ($key !=
"" && isset($options2) && is_array($options2)) {
147 if (!$filter || $filter == $value) {
156 $opt = parent::buildFieldCreationInput($dcl, $mode);
161 foreach ($tables as $table) {
162 foreach ($table->getRecordFields() as
$field) {
170 $this->
lng->txt(
'dcl_reference_title'),
173 $prop_table_selection->setOptions(
$options);
174 $prop_table_selection->setInfo($this->
lng->txt(
'dcl_reference_title_desc'));
176 $opt->addSubItem($prop_table_selection);
179 $this->
lng->txt(
'dcl_reference_link'),
182 $prop_ref_link->setInfo($this->
lng->txt(
'dcl_reference_link_info'));
183 $opt->addSubItem($prop_ref_link);
186 $this->
lng->txt(
'dcl_multiple_selection'),
189 $opt->addSubItem($prop_multi_select);
const PROP_REFERENCE_LINK
getDatatypeId()
Get datatype_id.
ilDclBaseFieldModel $field
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getFilterInputFieldValue(ilTableFilterItem $input)
getField()
Return BaseFieldModel.
getRecordFieldValue(?string $field_id)
Get Field Value.
static getTableCache(?int $table_id=null)
static getFieldCache(int $field_id=0)
const INPUTFORMAT_ILIAS_REF
const INPUTFORMAT_FILEUPLOAD
const INPUTFORMAT_REFERENCE
const REFERENCE_SEPARATOR
passThroughFilter(ilDclBaseRecordModel $record, $filter)
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
Build the creation-input-field.
static hasPermissionToAddRecord(int $ref_id, int $table_id)
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
static http()
Fetches the global http state from ILIAS.