ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclTextFieldRepresentation Class Reference
+ 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

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

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclTextFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)

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

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

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  }
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 86 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().

87  {
88  $opt = parent::buildFieldCreationInput($dcl, $mode);
89 
90  $prop_length = new ilNumberInputGUI(
91  $this->lng->txt('dcl_length'),
93  );
94  $prop_length->setSize(5);
95  $prop_length->setMaxValue(4000);
96  $prop_length->setInfo($this->lng->txt('dcl_length_info'));
97 
98  $opt->addSubItem($prop_length);
99 
100  $prop_regex = new ilDclTextInputGUI(
101  $this->lng->txt('dcl_regex'),
103  );
104  $prop_regex->setInfo($this->lng->txt('dcl_regex_info'));
105 
106  $opt->addSubItem($prop_regex);
107 
108  $prop_url = new ilDclCheckboxInputGUI(
109  $this->lng->txt('dcl_url'),
111  );
112  $opt->addSubItem($prop_url);
113 
114  $prop_textarea = new ilDclCheckboxInputGUI(
115  $this->lng->txt('dcl_text_area'),
117  );
118  $opt->addSubItem($prop_textarea);
119 
120  $prop_page_details = new ilDclCheckboxInputGUI(
121  $this->lng->txt('dcl_link_detail_page'),
123  );
124  $prop_page_details->setInfo($this->lng->txt('dcl_link_detail_page_desc'));
125 
126  $opt->addSubItem($prop_page_details);
127 
128  return $opt;
129  }
This class represents an option in a radio group.
getPropertyInputFieldId(string $property)
Return post-var for property-fields.
This class represents a number property in a property form.
const PROP_LENGTH
General properties.
+ Here is the call graph for this function:

◆ getInputField()

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

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

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

54  {
55  $input = new ilDclTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
56  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
57  $input = new ilTextAreaInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
58  //varchar(4000) in Database
59  $input->setMaxNumOfChars(4000);
60  }
61 
62  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_LENGTH)) {
63  $input->setInfo($this->lng->txt("dcl_max_text_length") . ": " . $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
64  if (!$this->getField()->getProperty(ilDclBaseFieldModel::PROP_TEXTAREA)) {
65  $input->setMaxLength((int) $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
66  } else {
67  $input->setMaxNumOfChars((int) $this->getField()->getProperty(ilDclBaseFieldModel::PROP_LENGTH));
68  }
69  }
70 
71  if ($this->getField()->hasProperty(ilDclBaseFieldModel::PROP_URL)) {
72  $input->setInfo($this->lng->txt('dcl_text_email_detail_desc'));
73  $title_field = new ilDclTextInputGUI(
74  $this->lng->txt('dcl_text_email_title'),
75  'field_' . $this->getField()->getId() . '_title'
76  );
77  $title_field->setInfo($this->lng->txt('dcl_text_email_title_info'));
78  $input->addSubItem($title_field);
79  }
80 
81  $this->setupInputField($input, $this->getField());
82 
83  return $input;
84  }
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
const PROP_LENGTH
General properties.
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 41 of file class.ilDclTextFieldRepresentation.php.

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

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.
+ Here is the call graph for this function:

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