ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilDclBaseFieldRepresentation.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11{
12 protected $field;
13
17 protected $lng;
18
22 protected $ctrl;
23
25 {
26 global $DIC;
27 $lng = $DIC['lng'];
28 $ilCtrl = $DIC['ilCtrl'];
29 $this->field = $field;
30 $this->lng = $lng;
31 $this->ctrl = $ilCtrl;
32 }
33
34
42 {
43 return null;
44 }
45
46
51 protected function setupFilterInputField(ilFormPropertyGUI $input)
52 {
53 if ($input != null) {
54 $input->setTitle($this->getField()->getTitle());
55 }
56 }
57
58
67 public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
68 {
69 $value = $record->getRecordFieldValue($this->getField()->getId());
70 $pass = true;
71
72 if (($this->getField()->getId() == "owner" || $this->getField()->getId() == "last_edit_by") && $filter) {
73 $pass = false;
74 $user = new ilObjUser($value);
75 if (strpos($user->getFullname(), $filter) !== false) {
76 $pass = true;
77 }
78 }
79
80 return $pass;
81 }
82
83
91 public function parseSortingValue($value, $link = true)
92 {
93 return $value;
94 }
95
96
104 public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
105 {
106 return null;
107 }
108
109
116 {
117 $input->setRequired($field->getRequired());
118 $input->setInfo($field->getDescription() . ($input->getInfo() ? '<br>' . $input->getInfo() : ''));
119 }
120
121
127 protected function getFilterInputFieldValue(/*ilPropertyFormGUI*/ $input)
128 {
129 $value = $input->getValue();
130 if (is_array($value)) {
131 if ($value['from'] || $value['to']) {
132 return $value;
133 }
134 } else {
135 if ($value != '') {
136 return $value;
137 }
138 }
139 return null;
140 }
141
142
150 public function addFieldCreationForm($form, ilObjDataCollection $dcl, $mode = "create")
151 {
152 $opt = $this->buildFieldCreationInput($dcl, $mode);
153
154 if ($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
155 $new_plugin_title = $opt->getTitle();
157 if ($plugin_name !== "DclBase") {
158 $new_plugin_title .= ': ' . $plugin_name;
159 }
160 $opt->setTitle($new_plugin_title);
161 }
162
163 $form->addOption($opt);
164 }
165
166
175 protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
176 {
177 $opt = new ilRadioOption($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), $this->getField()->getDatatypeId());
178 $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
179
180 return $opt;
181 }
182
189 public function getPropertyInputFieldId($property)
190 {
191 return "prop_" . $property;
192 }
193
194
199 public function getField()
200 {
201 return $this->field;
202 }
203}
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldModel.
Class ilDclBaseFieldRepresentation.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.
getPropertyInputFieldId($property)
Return post-var for property-fields.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
addFieldCreationForm($form, ilObjDataCollection $dcl, $mode="create")
Adds the options for the field-types to the field-creation form.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Build the creation-input-field.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
static getPluginNameFromFieldModel(ilDclBaseFieldModel $object)
Get plugin-name from FieldModel.
This class represents a property in a property form.
getInfo()
Get Information Text.
setTitle($a_title)
Set Title.
setInfo($a_info)
Set Information Text.
setRequired($a_required)
Set Required.
Class ilObjDataCollection.
This class represents a property form user interface.
This class represents an option in a radio group.
Class ilTable2GUI.
global $ilCtrl
Definition: ilias.php:18
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form
global $DIC
Definition: saml.php:7