ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclIliasReferenceFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilRepositorySelector2InputGUI
24 {
26 $this->getField()->getTitle(),
27 'field_' . $this->getField()->getId(),
28 false,
29 $form
30 );
31 $this->setupInputField($input, $this->getField());
32
33 return $input;
34 }
35
40 {
41 $input = $table->addFilterItemByMetaType(
42 "filter_" . $this->getField()->getId(),
44 false,
45 $this->getField()->getId()
46 );
47 $input->setSubmitFormOnEnter(true);
48
49 $this->setupFilterInputField($input);
50
51 return $this->getFilterInputFieldValue($input);
52 }
53
57 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
58 {
59 $value = $record->getRecordFieldValue($this->getField()->getId());
60 $obj_id = ilObject::_lookupObjId($value);
61 if (!$filter || strpos(strtolower(ilObject::_lookupTitle($obj_id)), strtolower($filter)) !== false) {
62 return true;
63 }
64
65 return false;
66 }
67
68 protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
69 {
70 $opt = parent::buildFieldCreationInput($dcl, $mode);
71
72 $prop_ref_link = new ilDclCheckboxInputGUI(
73 $this->lng->txt('dcl_learning_progress'),
75 );
76 $prop_ref_link->setInfo($this->lng->txt('dcl_learning_progress_desc'));
77 $opt->addSubItem($prop_ref_link);
78
79 $prop_multi_select = new ilDclCheckboxInputGUI(
80 $this->lng->txt('dcl_ilias_reference_link'),
82 );
83 $opt->addSubItem($prop_multi_select);
84
85 $prop_multi_select = new ilDclCheckboxInputGUI(
86 $this->lng->txt('dcl_display_action_menu'),
88 );
89 $prop_multi_select->setInfo($this->lng->txt('dcl_display_action_menu_desc'));
90 $opt->addSubItem($prop_multi_select);
91
92 $prop_unique = new ilDclCheckboxInputGUI(
93 $this->lng->txt('dcl_unique'),
94 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_UNIQUE)
95 );
96 $prop_unique->setInfo($this->lng->txt('dcl_unique_desc'));
97 $opt->addSubItem($prop_unique);
98
99 return $opt;
100 }
101}
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?string $field_id)
Get Field Value.
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
Build the creation-input-field.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This class represents a property form user interface.
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.