ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilDclMobFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
10{
11 public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
12 {
13 $input = new ilFileInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
14 $input->setSuffixes(ilDclMobFieldModel::$mob_suffixes);
15 $input->setAllowDeletion(true);
16
17 $this->requiredWorkaroundForInputField($input, $record_id);
18
19 return $input;
20 }
21
22
24 {
25 $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_TEXT, false, $this->getField()->getId());
26 $input->setSubmitFormOnEnter(true);
27
28 $this->setupFilterInputField($input);
29
30 return $this->getFilterInputFieldValue($input);
31 }
32
33
34 public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
35 {
36 $value = $record->getRecordFieldValue($this->getField()->getId());
37
38 $m_obj = new ilObjMediaObject($value, false);
39 $file_name = $m_obj->getTitle();
40 if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
41 return true;
42 }
43
44 return false;
45 }
46
47
51 public function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
52 {
53 $opt = new ilRadioOption($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), $this->getField()->getDatatypeId());
54 $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
55
56 $opt->setInfo(sprintf($opt->getInfo(), implode(", ", ilDclMobFieldModel::$mob_suffixes)));
57
58 $prop_width = new ilNumberInputGUI($this->lng->txt('dcl_width'), 'prop_' . ilDclBaseFieldModel::PROP_WIDTH);
59 $prop_width->setSize(5);
60 $prop_width->setMaxValue(4000);
61
62 $opt->addSubItem($prop_width);
63
64 $prop_height = new ilNumberInputGUI($this->lng->txt('dcl_height'), 'prop_' . ilDclBaseFieldModel::PROP_HEIGHT);
65 $prop_height->setSize(5);
66 $prop_height->setMaxValue(4000);
67
68 $opt->addSubItem($prop_height);
69
70 $prop_page_details = new ilDclCheckboxInputGUI($this->lng->txt('dcl_link_detail_page'), 'prop_' . ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT);
71 $opt->addSubItem($prop_page_details);
72
73 return $opt;
74 }
75}
An exception for terminatinating execution or to throw for unit testing.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
Class ilDclCheckboxInputGUI.
Class ilDclFileuploadFieldRepresentaion.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.?ilFormPropertyGUI
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.bool
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.null
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
@inheritDoc
This class represents a file property in a property form.
This class represents a number property in a property form.
Class ilObjDataCollection.
Class ilObjMediaObject.
This class represents a property form user interface.
This class represents an option in a radio group.
Class ilTable2GUI.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.