ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclMobFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
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->setInfo($this->lng->txt('dcl_width_desc'));
63 $prop_width->setSize(5);
64 $prop_width->setMaxValue(4000);
65
66 $opt->addSubItem($prop_width);
67
68 $prop_height = new ilNumberInputGUI($this->lng->txt('dcl_height'), 'prop_' . ilDclBaseFieldModel::PROP_HEIGHT);
69 $prop_height->setInfo($this->lng->txt('dcl_height_desc'));
70 $prop_height->setSize(5);
71 $prop_height->setMaxValue(4000);
72
73 $opt->addSubItem($prop_height);
74
75 $prop_page_details = new ilDclCheckboxInputGUI(
76 $this->lng->txt('dcl_link_detail_page'),
78 );
79 $prop_page_details->setInfo($this->lng->txt('dcl_link_detail_page_desc'));
80
81 $opt->addSubItem($prop_page_details);
82
83 return $opt;
84 }
85}
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?string $field_id)
Get Field Value.
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
Build the creation-input-field.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
This class represents a number property in a property form.
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.