ILIAS  release_8 Revision v8.24
class.ilDclRatingFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
20{
21 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI
22 {
23 $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24 $input->setValue($this->lng->txt("dcl_editable_in_table_gui"));
25 $input->setDisabled(true);
26 $this->setupInputField($input, $this->getField());
27
28 return $input;
29 }
30
35 {
36 $input = $table->addFilterItemByMetaType(
37 "filter_" . $this->getField()->getId(),
39 false,
40 $this->getField()->getId()
41 );
42 $options = array("" => $this->lng->txt("dcl_any"), 1 => ">1", 2 => ">2", 3 => ">3", 4 => ">4", 5 => "5");
43 $input->setOptions($options);
44
45 $this->setupFilterInputField($input);
46
47 return $this->getFilterInputFieldValue($input);
48 }
49
53 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
54 {
55 $value = $record->getRecordFieldValue($this->getField()->getId());
56 if (!$filter || $filter <= $value['avg']) {
57 return true;
58 }
59
60 return false;
61 }
62}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?int $field_id)
Get Field Value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
Returns field-input.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
This class represents a property form user interface.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
This class represents a text property in a property form.