ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilDclRatingFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22{
23 public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI
24 {
25 $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
26 $input->setValue($this->lng->txt("dcl_editable_in_table_gui"));
27 $input->setDisabled(true);
28 $this->setupInputField($input, $this->getField());
29
30 return $input;
31 }
32
37 {
38 $input = $table->addFilterItemByMetaType(
39 "filter_" . $this->getField()->getId(),
41 false,
42 $this->getField()->getId()
43 );
44 $options = ["" => $this->lng->txt("dcl_any"), 1 => ">1", 2 => ">2", 3 => ">3", 4 => ">4", 5 => "5"];
45 $input->setOptions($options);
46
47 $this->setupFilterInputField($input);
48
49 return $this->getFilterInputFieldValue($input);
50 }
51
55 public function passThroughFilter(ilDclBaseRecordModel $record, $filter): bool
56 {
57 $value = $record->getRecordFieldValue($this->getField()->getId());
58 if (!$filter || $filter <= $value['avg']) {
59 return true;
60 }
61
62 return false;
63 }
64}
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
getRecordFieldValue(?string $field_id)
Get Field Value.
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.