ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 return $this->getFilterInputFieldValue($input);
30 }
31
32
33 public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
34 {
35 $value = $record->getRecordFieldValue($this->getField()->getId());
36
37 $m_obj = new ilObjMediaObject($value, false);
38 $file_name = $m_obj->getTitle();
39 if (!$filter || strpos(strtolower($file_name), strtolower($filter)) !== false) {
40 return true;
41 }
42 return false;
43 }
44
48 public function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
49 {
50 $opt = new ilRadioOption($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), $this->getField()->getDatatypeId());
51 $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
52
53 $opt->setInfo(sprintf($opt->getInfo(), implode(", ", ilDclMobFieldModel::$mob_suffixes)));
54
55 $prop_width = new ilNumberInputGUI($this->lng->txt('dcl_width'), 'prop_' . ilDclBaseFieldModel::PROP_WIDTH);
56 $prop_width->setSize(5);
57 $prop_width->setMaxValue(4000);
58
59 $opt->addSubItem($prop_width);
60
61 $prop_height = new ilNumberInputGUI($this->lng->txt('dcl_height'), 'prop_' . ilDclBaseFieldModel::PROP_HEIGHT);
62 $prop_height->setSize(5);
63 $prop_height->setMaxValue(4000);
64
65 $opt->addSubItem($prop_height);
66
67 $prop_page_details = new ilDclCheckboxInputGUI($this->lng->txt('dcl_link_detail_page'), 'prop_' . ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT);
68 $opt->addSubItem($prop_page_details);
69
70 return $opt;
71 }
72}
sprintf('%.4f', $callTime)
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.null
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.
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form