ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclBooleanFieldRepresentation.php
Go to the documentation of this file.
1<?php
2require_once ('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
3require_once('./Modules/DataCollection/classes/Helpers/class.ilDclCheckboxInputGUI.php');
4
12
13 public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
14 $input = new ilDclCheckboxInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
15 $this->setupInputField($input, $this->getField());
16
17 return $input;
18 }
19
20 public function addFilterInputFieldToTable(ilTable2GUI $table) {
21 $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_SELECT, false, $this->getField()->getId());
22 $input->setOptions(array(
23 "" => $this->lng->txt("dcl_any"),
24 "not_checked" => $this->lng->txt("dcl_not_checked"),
25 "checked" => $this->lng->txt("dcl_checked")
26 ));
27
28 $this->setupFilterInputField($input);
29
30 return $this->getFilterInputFieldValue($input);
31 }
32
33
34 public function passThroughFilter(ilDclBaseRecordModel $record, $filter) {
35 $value = $record->getRecordFieldValue($this->getField()->getId());
36 if ((($filter == "checked" && $value == 1) || ($filter == "not_checked" && $value == 0)) || $filter == '' || !$filter) {
37 return true;
38 }
39 return false;
40 }
41
42
43
44}
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldRepresentation.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
Class ilDclFileuploadFieldRepresentaion.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.
Class ilDclCheckboxInputGUI.
This class represents a property form user interface.
Class ilTable2GUI.
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.