ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilDclMobFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 {
23  public function addFilterInputFieldToTable(ilTable2GUI $table)
24  {
25  $input = $table->addFilterItemByMetaType(
26  "filter_" . $this->getField()->getId(),
28  false,
29  $this->getField()->getId()
30  );
31  $input->setSubmitFormOnEnter(true);
32 
33  $this->setupFilterInputField($input);
34 
35  return $this->getFilterInputFieldValue($input);
36  }
37 
38  public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
39  {
40  $value = $record->getRecordFieldValue($this->getField()->getId());
41 
42  $m_obj = new ilObjMediaObject($value);
43  $file_name = $m_obj->getTitle();
44  if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
45  return true;
46  }
47 
48  return false;
49  }
50 
51  protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
52  {
53  $opt = new ilRadioOption(
54  $this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()),
55  (string) $this->getField()->getDatatypeId()
56  );
57  $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
58 
59  $opt->setInfo(sprintf($opt->getInfo(), implode(", ", $this->getField()->getSupportedExtensions())));
60 
61  $prop_width = new ilNumberInputGUI($this->lng->txt('dcl_width'), 'prop_' . ilDclBaseFieldModel::PROP_WIDTH);
62  $prop_width->setSize(5);
63  $prop_width->setMaxValue(4000);
64 
65  $opt->addSubItem($prop_width);
66 
67  $prop_height = new ilNumberInputGUI($this->lng->txt('dcl_height'), 'prop_' . ilDclBaseFieldModel::PROP_HEIGHT);
68  $prop_height->setSize(5);
69  $prop_height->setMaxValue(4000);
70 
71  $opt->addSubItem($prop_height);
72 
73  $prop_page_details = new ilDclCheckboxInputGUI(
74  $this->lng->txt('dcl_link_detail_page'),
76  );
77  $opt->addSubItem($prop_page_details);
78 
79  return $opt;
80  }
81 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setInfo(string $a_info)
getRecordFieldValue(?string $field_id)
Get Field Value.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
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.
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')