ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclTextFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
3 
14  public function addFilterInputFieldToTable(ilTable2GUI $table) {
15  $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_TEXT, false, $this->getField()->getId());
16  $input->setSubmitFormOnEnter(true);
17 
18  $this->setupFilterInputField($input);
19 
20  return $this->getFilterInputFieldValue($input);
21  }
22 
23 
27  public function passThroughFilter(ilDclBaseRecordModel $record, $filter) {
28  $pass = parent::passThroughFilter($record, $filter);
29 
30  $value = $record->getRecordFieldValue($this->getField()->getId());
31  if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
32  $pass = true;
33  }
34 
35  return $pass;
36  }
37 
38 
42  public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
43  $input = new ilDclTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
44  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
45  $input = new ilTextAreaInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
46  }
47 
48 
49  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LENGTH)) {
50  $input->setInfo($this->lng->txt("dcl_max_text_length") . ": " . $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
51  if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
52  $input->setMaxLength($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
53  }
54  }
55 
56  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
57  $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
58  $title_field = new ilDclTextInputGUI($this->lng->txt('dcl_text_email_title'), 'field_' . $this->getField()->getId() . '_title');
59  $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
60  $input->addSubItem($title_field);
61  }
62 
63  $this->setupInputField($input, $this->getField());
64 
65  return $input;
66  }
67 
68 
72  public function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create') {
73  $opt = parent::buildFieldCreationInput($dcl, $mode);
74 
75  $prop_length = new ilNumberInputGUI($this->lng->txt('dcl_length'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LENGTH));
76  $prop_length->setSize(5);
77  $prop_length->setMaxValue(4000);
78  $prop_length->setInfo($this->lng->txt('dcl_length_info'));
79 
80  $opt->addSubItem($prop_length);
81 
82  $prop_regex = new ilDclTextInputGUI($this->lng->txt('dcl_regex'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_REGEX));
83  $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
84 
85  $opt->addSubItem($prop_regex);
86 
87  $prop_url = new ilDclCheckboxInputGUI($this->lng->txt('dcl_url'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_URL));
88  $opt->addSubItem($prop_url);
89 
90  $prop_textarea = new ilDclCheckboxInputGUI($this->lng->txt('dcl_text_area'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_TEXTAREA));
91  $opt->addSubItem($prop_textarea);
92 
93  $prop_page_details = new ilDclCheckboxInputGUI($this->lng->txt('dcl_link_detail_page'), $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT));
94  $opt->addSubItem($prop_page_details);
95 
96  return $opt;
97  }
98 }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
This class represents a property form user interface.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Class ilDclTextFieldRepresentation.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
getPropertyInputFieldId($property)
Return post-var for property-fields.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setInfo($a_info)
Set Information Text.
Class ilDclTextInputGUI.
Class ilTable2GUI.
This class represents a number property in a property form.
const PROP_LENGTH
General properties.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
setSize($a_size)
Set Size.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Class ilDclBaseRecordModel.
This class represents a text area property in a property form.
getRecordFieldValue($field_id)
Get Field Value.
Class ilDclCheckboxInputGUI.
Class ilDclBaseFieldRepresentation.
Class ilObjDataCollection.