ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
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 }
51
52 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LENGTH)) {
53 $input->setInfo($this->lng->txt("dcl_max_text_length") . ": " . $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
54 if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
55 $input->setMaxLength($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
56 }
57 }
58
59 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
60 $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
61 $title_field = new ilDclTextInputGUI($this->lng->txt('dcl_text_email_title'), 'field_' . $this->getField()->getId() . '_title');
62 $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
63 $input->addSubItem($title_field);
64 }
65
66 $this->setupInputField($input, $this->getField());
67
68 return $input;
69 }
70
71
75 public function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
76 {
77 $opt = parent::buildFieldCreationInput($dcl, $mode);
78
79 $prop_length = new ilNumberInputGUI($this->lng->txt('dcl_length'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LENGTH));
80 $prop_length->setSize(5);
81 $prop_length->setMaxValue(4000);
82 $prop_length->setInfo($this->lng->txt('dcl_length_info'));
83
84 $opt->addSubItem($prop_length);
85
86 $prop_regex = new ilDclTextInputGUI($this->lng->txt('dcl_regex'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_REGEX));
87 $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
88
89 $opt->addSubItem($prop_regex);
90
91 $prop_url = new ilDclCheckboxInputGUI($this->lng->txt('dcl_url'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_URL));
92 $opt->addSubItem($prop_url);
93
94 $prop_textarea = new ilDclCheckboxInputGUI($this->lng->txt('dcl_text_area'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_TEXTAREA));
95 $opt->addSubItem($prop_textarea);
96
97 $prop_page_details = new ilDclCheckboxInputGUI($this->lng->txt('dcl_link_detail_page'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT));
98 $opt->addSubItem($prop_page_details);
99
100 return $opt;
101 }
102}
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.null
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.
This class represents a text area property in a property form.
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form