ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclNumberFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
10{
11 public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
12 {
13 $input = new ilNumberInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
14 // 9 is the maximum number of digits for an integer
15 $input->setMaxLength(9);
16 $input->setInfo($this->lng->txt('dcl_max_digits') . ": 9");
17 $this->setupInputField($input, $this->getField());
18 return $input;
19 }
20
22 {
23 $input = $table->addFilterItemByMetaType("filter_" . $this->getField()->getId(), ilTable2GUI::FILTER_NUMBER_RANGE, false, $this->getField()->getId());
24 $input->setSubmitFormOnEnter(true);
25
26 $this->setupFilterInputField($input);
27
28 return $this->getFilterInputFieldValue($input);
29 }
30
31
32 public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
33 {
34 $value = $record->getRecordFieldValue($this->getField()->getId());
35 if ((!$filter['from'] || $value >= $filter['from']) && (!$filter['to'] || $value <= $filter['to'])) {
36 return true;
37 }
38 return false;
39 }
40
41
45 protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
46 {
47 $opt = parent::buildFieldCreationInput($dcl, $mode);
48 return $opt;
49 }
50}
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.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
@inheritDoc
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.
This class represents a number property in a property form.
Class ilObjDataCollection.
This class represents a property form user interface.
Class ilTable2GUI.
const FILTER_NUMBER_RANGE
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form