ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclBooleanFieldRepresentation 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 ilDclBooleanFieldRepresentation:
+ Collaboration diagram for ilDclBooleanFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 
- 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...
 

Additional Inherited Members

- 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...
 
- 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.ilDclBooleanFieldRepresentation.php.

Member Function Documentation

◆ addFilterInputFieldToTable()

ilDclBooleanFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)
Parameters
ilTable2GUI$table
Returns
array|string|null
Exceptions
Exception

Definition at line 34 of file class.ilDclBooleanFieldRepresentation.php.

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

35  {
36  $input = $table->addFilterItemByMetaType(
37  "filter_" . $this->getField()->getId(),
39  false,
40  $this->getField()->getId()
41  );
42  $input->setOptions(
43  array(
44  "" => $this->lng->txt("dcl_any"),
45  "not_checked" => $this->lng->txt("dcl_not_checked"),
46  "checked" => $this->lng->txt("dcl_checked"),
47  )
48  );
49 
50  $this->setupFilterInputField($input);
51 
52  return $this->getFilterInputFieldValue($input);
53  }
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:

◆ getInputField()

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

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

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

22  {
23  $input = new ilDclCheckboxInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24  $this->setupInputField($input, $this->getField());
25 
26  return $input;
27  }
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...
+ Here is the call graph for this function:

◆ passThroughFilter()

ilDclBooleanFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)

Definition at line 55 of file class.ilDclBooleanFieldRepresentation.php.

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

55  : bool
56  {
57  $value = $record->getRecordFieldValue($this->getField()->getId());
58  if ((($filter == "checked" && $value == 1) || ($filter == "not_checked" && $value == 0)) || $filter == '' || !$filter) {
59  return true;
60  }
61 
62  return false;
63  }
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: