ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclTextFieldRepresentation Class Reference
+ Inheritance diagram for ilDclTextFieldRepresentation:
+ Collaboration diagram for ilDclTextFieldRepresentation:

Public Member Functions

 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
- 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')
 Build the creation-input-field. More...
 
- 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
 
ilObjUser $user
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

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

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclTextFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)

Add filter input to TableGUI.

Parameters
ilTable2GUI$table
Returns
null

Reimplemented from ilDclBaseFieldRepresentation.

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

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

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

+ Here is the call graph for this function:

◆ buildFieldCreationInput()

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

Build the creation-input-field.

Reimplemented from ilDclBaseFieldRepresentation.

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

84 {
85 $opt = parent::buildFieldCreationInput($dcl, $mode);
86
87 $prop_length = new ilNumberInputGUI(
88 $this->lng->txt('dcl_length'),
89 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LENGTH)
90 );
91 $prop_length->setSize(5);
92 $prop_length->setMinValue(1);
93 $prop_length->setMaxValue(4000);
94 $prop_length->setRequired(true);
95 $prop_length->setValue('200');
96 $prop_length->setInfo($this->lng->txt('dcl_length_info'));
97 $opt->addSubItem($prop_length);
98
99 $prop_url = new ilDclCheckboxInputGUI(
100 $this->lng->txt('dcl_url'),
101 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_URL)
102 );
103 $opt->addSubItem($prop_url);
104
105 $prop_page_details = new ilDclCheckboxInputGUI(
106 $this->lng->txt('dcl_link_detail_page'),
107 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_LINK_DETAIL_PAGE_TEXT)
108 );
109 $prop_page_details->setInfo($this->lng->txt('dcl_link_detail_page_desc'));
110 $opt->addSubItem($prop_page_details);
111
112 $prop_unique = new ilDclCheckboxInputGUI(
113 $this->lng->txt('dcl_unique'),
114 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_UNIQUE)
115 );
116 $prop_unique->setInfo($this->lng->txt('dcl_unique_desc'));
117 $opt->addSubItem($prop_unique);
118
119 $prop_regex = new ilDclTextInputGUI(
120 $this->lng->txt('dcl_regex'),
121 $this->getPropertyInputFieldId(ilDclBaseFieldModel::PROP_REGEX)
122 );
123 $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
124 $opt->addSubItem($prop_regex);
125
126 return $opt;
127 }
const PROP_LENGTH
General properties.
This class represents a number property in a property form.
This class represents an option in a radio group.

References ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_LENGTH, ilDclBaseFieldModel\PROP_LINK_DETAIL_PAGE_TEXT, ilDclBaseFieldModel\PROP_REGEX, ilDclBaseFieldModel\PROP_UNIQUE, and ilDclBaseFieldModel\PROP_URL.

+ Here is the call graph for this function:

◆ getInputField()

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

Returns field-input.

Reimplemented from ilDclBaseFieldRepresentation.

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

54 {
55 $length = (int) $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH);
56 if ($length > 200 && !$this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
57 $input = new ilTextAreaInputGUI();
58 $input->setMaxNumOfChars($length);
59 } else {
60 $input = new ilDclTextInputGUI();
61 $input->setMaxLength($length);
62 }
63 $input->setTitle($this->getField()->getTitle());
64 $input->setPostVar('field_' . $this->getField()->getId());
65
66 if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
67 $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
68 $title_field = new ilDclTextInputGUI(
69 $this->lng->txt('dcl_text_email_title'),
70 'field_' . $this->getField()->getId() . '_title'
71 );
72 $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
73 $input->addSubItem($title_field);
74 } else {
75 $input->setInfo(sprintf($this->lng->txt("dcl_max_text_length"), $length));
76 }
77
78 $this->setupInputField($input, $this->getField());
79
80 return $input;
81 }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
This class represents a property in a property form.
This class represents a text area property in a property form.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_LENGTH, ilDclBaseFieldModel\PROP_URL, and ilDclBaseFieldRepresentation\setupInputField().

+ Here is the call graph for this function:

◆ passThroughFilter()

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

Reimplemented from ilDclBaseFieldRepresentation.

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

41 : bool
42 {
43 $pass = parent::passThroughFilter($record, $filter);
44
45 $value = $record->getRecordFieldValue($this->getField()->getId());
46 if (!$filter || strpos(strtolower($value), strtolower($filter)) !== false) {
47 $pass = true;
48 }
49
50 return $pass;
51 }
getRecordFieldValue(?string $field_id)
Get Field Value.

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

+ Here is the call graph for this function:

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