ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclTextFieldRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilDclTextFieldRepresentation:
+ Collaboration diagram for ilDclTextFieldRepresentation:

Public Member Functions

 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
- Public Member Functions inherited from ilDclBaseFieldRepresentation
 __construct (ilDclBaseFieldModel $field)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 Checks if a filter affects a record. More...
 
 parseSortingValue (string $value, bool $link=true)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
 addFieldCreationForm (ilSubEnabledFormPropertyGUI $form, ilObjDataCollection $dcl, string $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId (string $property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Protected Member Functions

 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 
- Protected Member Functions inherited from ilDclBaseFieldRepresentation
 setupFilterInputField (?ilTableFilterItem $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue (ilTableFilterItem $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 of file class.ilDclTextFieldRepresentation.php.

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclTextFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)

Definition at line 21 of file class.ilDclTextFieldRepresentation.php.

References ilTable2GUI\addFilterItemByMetaType(), ilTable2GUI\FILTER_TEXT, ilDclBaseFieldRepresentation\getField(), ilDclBaseFieldRepresentation\getFilterInputFieldValue(), ILIAS\Survey\Mode\getId(), and ilDclBaseFieldRepresentation\setupFilterInputField().

21  : ?string
22  {
23  $input = $table->addFilterItemByMetaType(
24  "filter_" . $this->getField()->getId(),
26  false,
27  $this->getField()->getId()
28  );
29  $input->setSubmitFormOnEnter(true);
30 
31  $this->setupFilterInputField($input);
32 
33  return $this->getFilterInputFieldValue($input);
34  }
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
+ Here is the call graph for this function:

◆ buildFieldCreationInput()

ilDclTextFieldRepresentation::buildFieldCreationInput ( ilObjDataCollection  $dcl,
string  $mode = 'create' 
)
protected

Definition at line 84 of file class.ilDclTextFieldRepresentation.php.

References ilSubEnabledFormPropertyGUI\addSubItem(), ilDclBaseFieldRepresentation\getPropertyInputFieldId(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_LENGTH, ilDclBaseFieldModel\PROP_LINK_DETAIL_PAGE_TEXT, ilDclBaseFieldModel\PROP_REGEX, ilDclBaseFieldModel\PROP_TEXTAREA, ilDclBaseFieldModel\PROP_URL, ilFormPropertyGUI\setInfo(), and ilNumberInputGUI\setSize().

85  {
86  $opt = parent::buildFieldCreationInput($dcl, $mode);
87 
88  $prop_length = new ilNumberInputGUI(
89  $this->lng->txt('dcl_length'),
91  );
92  $prop_length->setSize(5);
93  $prop_length->setMaxValue(4000);
94  $prop_length->setInfo($this->lng->txt('dcl_length_info'));
95 
96  $opt->addSubItem($prop_length);
97 
98  $prop_regex = new ilDclTextInputGUI(
99  $this->lng->txt('dcl_regex'),
101  );
102  $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
103 
104  $opt->addSubItem($prop_regex);
105 
106  $prop_url = new ilDclCheckboxInputGUI(
107  $this->lng->txt('dcl_url'),
109  );
110  $opt->addSubItem($prop_url);
111 
112  $prop_textarea = new ilDclCheckboxInputGUI(
113  $this->lng->txt('dcl_text_area'),
115  );
116  $opt->addSubItem($prop_textarea);
117 
118  $prop_page_details = new ilDclCheckboxInputGUI(
119  $this->lng->txt('dcl_link_detail_page'),
121  );
122  $opt->addSubItem($prop_page_details);
123 
124  return $opt;
125  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getPropertyInputFieldId(string $property)
Return post-var for property-fields.
This class represents a number property in a property form.
const PROP_LENGTH
General properties.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getInputField()

ilDclTextFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
?int  $record_id = null 
)

Definition at line 51 of file class.ilDclTextFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_LENGTH, ilDclBaseFieldModel\PROP_TEXTAREA, ilDclBaseFieldModel\PROP_URL, ilFormPropertyGUI\setInfo(), and ilDclBaseFieldRepresentation\setupInputField().

52  {
53  $input = new ilDclTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
54  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
55  $input = new ilTextAreaInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
56  //varchar(4000) in Database
57  $input->setMaxNumOfChars(4000);
58  }
59 
60  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LENGTH)) {
61  $input->setInfo($this->lng->txt("dcl_max_text_length") . ": " . $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
62  if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
63  $input->setMaxLength($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
64  } else {
65  $input->setMaxNumOfChars($this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
66  }
67  }
68 
69  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
70  $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
71  $title_field = new ilDclTextInputGUI(
72  $this->lng->txt('dcl_text_email_title'),
73  'field_' . $this->getField()->getId() . '_title'
74  );
75  $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
76  $input->addSubItem($title_field);
77  }
78 
79  $this->setupInputField($input, $this->getField());
80 
81  return $input;
82  }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const PROP_LENGTH
General properties.
This class represents a property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclTextFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)
Parameters
string$filter

Definition at line 39 of file class.ilDclTextFieldRepresentation.php.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ilDclBaseRecordModel\getRecordFieldValue().

39  : bool
40  {
41  $pass = parent::passThroughFilter($record, $filter);
42 
43  $value = $record->getRecordFieldValue($this->getField()->getId());
44  if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
45  $pass = true;
46  }
47 
48  return $pass;
49  }
getRecordFieldValue(?int $field_id)
Get Field Value.
+ Here is the call graph for this function:

The documentation for this class was generated from the following file: