ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
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 
34  public function addFilterInputFieldToTable(ilTable2GUI $table)
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 }
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
getRecordFieldValue(?int $field_id)
Get Field Value.
addFilterItemByMetaType(string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
Add filter by standard type.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setupFilterInputField(?ilTableFilterItem $input)
Set basic settings for filter-input-gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
passThroughFilter(ilDclBaseRecordModel $record, $filter)