ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilDclTextFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
10{
11
16 {
17 $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_TEXT, false, $this->getField()->getId());
18 $input->setSubmitFormOnEnter(true);
19
20 $this->setupFilterInputField($input);
21
22 return $this->getFilterInputFieldValue($input);
23 }
24
25
29 public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
30 {
31 $pass = parent::passThroughFilter($record, $filter);
32
33 $value = $record->getRecordFieldValue($this->getField()->getId());
34 if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
35 $pass = true;
36 }
37
38 return $pass;
39 }
40
41
45 public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
46 {
47 $input = new ilDclTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
48 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
49 $input = new ilTextAreaInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
50 //varchar(4000) in Database
51 $input->setMaxNumOfChars(4000);
52 }
53
54 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LENGTH)) {
55 $input->setInfo($this->lng->txt("dcl_max_text_length") . ": " . $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
56 if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
57 $input->setMaxLength($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
58 } else {
59 $input->setMaxNumOfChars($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
60 }
61 }
62
63 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
64 $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
65 $title_field = new ilDclTextInputGUI($this->lng->txt('dcl_text_email_title'), 'field_' . $this->getField()->getId() . '_title');
66 $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
67 $input->addSubItem($title_field);
68 }
69
70 $this->setupInputField($input, $this->getField());
71
72 return $input;
73 }
74
75
79 public function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
80 {
81 $opt = parent::buildFieldCreationInput($dcl, $mode);
82
83 $prop_length = new ilNumberInputGUI($this->lng->txt('dcl_length'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LENGTH));
84 $prop_length->setSize(5);
85 $prop_length->setMaxValue(4000);
86 $prop_length->setInfo($this->lng->txt('dcl_length_info'));
87
88 $opt->addSubItem($prop_length);
89
90 $prop_regex = new ilDclTextInputGUI($this->lng->txt('dcl_regex'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_REGEX));
91 $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
92
93 $opt->addSubItem($prop_regex);
94
95 $prop_url = new ilDclCheckboxInputGUI($this->lng->txt('dcl_url'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_URL));
96 $opt->addSubItem($prop_url);
97
98 $prop_textarea = new ilDclCheckboxInputGUI($this->lng->txt('dcl_text_area'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_TEXTAREA));
99 $opt->addSubItem($prop_textarea);
100
101 $prop_page_details = new ilDclCheckboxInputGUI($this->lng->txt('dcl_link_detail_page'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT));
102 $opt->addSubItem($prop_page_details);
103
104 return $opt;
105 }
106}
An exception for terminatinating execution or to throw for unit testing.
const PROP_LENGTH
General properties.
Class ilDclBaseFieldRepresentation.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
Class ilDclCheckboxInputGUI.
Class ilDclTextFieldRepresentation.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.null
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.?ilFormPropertyGUI
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
@inheritDoc
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.bool
Class ilDclTextInputGUI.
This class represents a number property in a property form.
Class ilObjDataCollection.
This class represents a property form user interface.
Class ilTable2GUI.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
This class represents a text area property in a property form.