ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclTextFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 
10 {
15  {
16  $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_TEXT, false, $this->getField()->getId());
17  $input->setSubmitFormOnEnter(true);
18 
19  $this->setupFilterInputField($input);
20 
21  return $this->getFilterInputFieldValue($input);
22  }
23 
24 
28  public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
29  {
30  $pass = parent::passThroughFilter($record, $filter);
31 
32  $value = $record->getRecordFieldValue($this->getField()->getId());
33  if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
34  $pass = true;
35  }
36 
37  return $pass;
38  }
39 
40 
44  public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
45  {
46  $input = new ilDclTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
47  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
48  $input = new ilTextAreaInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
49  }
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 }
This class represents a property form user interface.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.
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.
if(isset($_POST['submit'])) $form
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.
if(empty($password)) $table
Definition: pwgen.php:24
Class ilDclBaseFieldRepresentation.
Class ilObjDataCollection.