ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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;
16  protected $lng;
20  protected $ctrl;
21 
22 
24  {
25  global $DIC;
26  $lng = $DIC['lng'];
27  $ilCtrl = $DIC['ilCtrl'];
28  $this->field = $field;
29  $this->lng = $lng;
30  $this->ctrl = $ilCtrl;
31  }
32 
33 
42  {
43  return null;
44  }
45 
46 
53  {
54  if ($input != null) {
55  $input->setTitle($this->getField()->getTitle());
56  }
57  }
58 
59 
68  public function passThroughFilter(ilDclBaseRecordModel $record, $filter)
69  {
70  $value = $record->getRecordFieldValue($this->getField()->getId());
71  $pass = true;
72 
73  if (($this->getField()->getId() == "owner" || $this->getField()->getId() == "last_edit_by") && $filter) {
74  $pass = false;
75  $user = new ilObjUser($value);
76  if (strpos($user->getFullname(), $filter) !== false) {
77  $pass = true;
78  }
79  }
80 
81  return $pass;
82  }
83 
84 
92  public function parseSortingValue($value, $link = true)
93  {
94  return $value;
95  }
96 
97 
106  public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
107  {
108  return null;
109  }
110 
111 
119  {
120  $input->setRequired($field->getRequired());
121  $input->setInfo($field->getDescription() . ($input->getInfo() ? '<br>' . $input->getInfo() : ''));
122  }
123 
124 
130  protected function getFilterInputFieldValue(/*ilPropertyFormGUI*/
131  $input
132  ) {
133  $value = $input->getValue();
134  if (is_array($value)) {
135  if ($value['from'] || $value['to']) {
136  return $value;
137  }
138  } else {
139  if ($value != '') {
140  return $value;
141  }
142  }
143 
144  return null;
145  }
146 
147 
155  public function addFieldCreationForm($form, ilObjDataCollection $dcl, $mode = "create")
156  {
157  $opt = $this->buildFieldCreationInput($dcl, $mode);
158 
159  if ($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
160  $new_plugin_title = $opt->getTitle();
162  if ($plugin_name !== "DclBase") {
163  $new_plugin_title .= ': ' . $plugin_name;
164  }
165  $opt->setTitle($new_plugin_title);
166  }
167 
168  $form->addOption($opt);
169  }
170 
171 
180  protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
181  {
182  $opt = new ilRadioOption($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), $this->getField()->getDatatypeId());
183  $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle() . '_desc'));
184 
185  return $opt;
186  }
187 
188 
196  public function getPropertyInputFieldId($property)
197  {
198  return "prop_" . $property;
199  }
200 
201 
207  public function getField()
208  {
209  return $this->field;
210  }
211 }
This class represents an option in a radio group.
Class ilDclBaseFieldModel.
This class represents a property form user interface.
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Checks if a filter affects a record.
global $DIC
Definition: saml.php:7
addFieldCreationForm($form, ilObjDataCollection $dcl, $mode="create")
Adds the options for the field-types to the field-creation form.
getPropertyInputFieldId($property)
Return post-var for property-fields.
setInfo($a_info)
Set Info.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Build the creation-input-field.
global $ilCtrl
Definition: ilias.php:18
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
setInfo($a_info)
Set Information Text.
Class ilTable2GUI.
if(isset($_POST['submit'])) $form
setTitle($a_title)
Set Title.
getRequired()
Get Required Required.
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
addFilterInputFieldToTable(ilTable2GUI $table)
Add filter input to TableGUI.
$user
Definition: migrateto20.php:57
getDescription()
Get description.
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.
Class ilDclBaseRecordModel.
This class represents a property in a property form.
getRecordFieldValue($field_id)
Get Field Value.
getInfo()
Get Information Text.
if(empty($password)) $table
Definition: pwgen.php:24
Class ilDclBaseFieldRepresentation.
static getPluginNameFromFieldModel(ilDclBaseFieldModel $object)
Get plugin-name from FieldModel.
Class ilObjDataCollection.
setRequired($a_required)
Set Required.