ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclRatingFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once ('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
3 require_once("./Services/Rating/classes/class.ilRatingGUI.php");
4 
12 
13  public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
14  $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
15  $input->setValue($this->lng->txt("dcl_editable_in_table_gui"));
16  $input->setDisabled(true);
17  $this->setupInputField($input, $this->getField());
18 
19  return $input;
20  }
21 
22  public function addFilterInputFieldToTable(ilTable2GUI $table) {
23  $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_SELECT, false, $this->getField()->getId());
24  $options = array("" => $this->lng->txt("dcl_any"), 1 => ">1", 2 => ">2", 3 => ">3", 4 => ">4", 5 => "5");
25  $input->setOptions($options);
26 
27  $this->setupFilterInputField($input);
28 
29  return $this->getFilterInputFieldValue($input);
30  }
31 
32 
33  public function passThroughFilter(ilDclBaseRecordModel $record, $filter) {
34  $value = $record->getRecordFieldValue($this->getField()->getId());
35  if (!$filter || $filter <= $value['avg']) {
36  return true;
37  }
38  return false;
39  }
40 }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
This class represents a property form user interface.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
Class ilTable2GUI.
if(!is_array($argv)) $options
This class represents a text property in a property form.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Create styles array
The data for the language used.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Class ilDclBaseFieldRepresentation.
passThroughFilter(ilDclBaseRecordModel $record, $filter)