ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilDclIliasReferenceFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilRepositorySelector2InputGUI
24  {
25  $input = new ilRepositorySelector2InputGUI(
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 
39  public function addFilterInputFieldToTable(ilTable2GUI $table)
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  return $opt;
93  }
94 }
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
This class represents an option in a radio group.
getRecordFieldValue(?string $field_id)
Get Field Value.
static _lookupObjId(int $ref_id)
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
static _lookupTitle(int $obj_id)
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)