ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclBaseFieldRepresentation Class Reference

Class ilDclBaseFieldRepresentation. More...

+ Inheritance diagram for ilDclBaseFieldRepresentation:
+ Collaboration diagram for ilDclBaseFieldRepresentation:

Public Member Functions

 __construct (ilDclBaseFieldModel $field)
 
 addFilterInputFieldToTable (ilTable2GUI $table)
 Add filter input to TableGUI. More...
 
 passThroughFilter (ilDclBaseRecordModel $record, $filter)
 Checks if a filter affects a record. More...
 
 parseSortingValue ($value, $link=true)
 
 getInputField (ilPropertyFormGUI $form, $record_id=0)
 Returns field-input. More...
 
 addFieldCreationForm ($form, ilObjDataCollection $dcl, $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId ($property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Protected Member Functions

 setupFilterInputField (ilFormPropertyGUI $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue ( $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, $mode='create')
 Build the creation-input-field. More...
 

Protected Attributes

 $field
 
 $lng
 
 $ctrl
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclBaseFieldRepresentation::__construct ( ilDclBaseFieldModel  $field)

Definition at line 24 of file class.ilDclBaseFieldRepresentation.php.

References $DIC, $field, $ilCtrl, and $lng.

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  }
global $ilCtrl
Definition: ilias.php:18
global $DIC

Member Function Documentation

◆ addFieldCreationForm()

ilDclBaseFieldRepresentation::addFieldCreationForm (   $form,
ilObjDataCollection  $dcl,
  $mode = "create" 
)

Adds the options for the field-types to the field-creation form.

Parameters
$form
ilObjDataCollection$dcl
string$mode

Definition at line 142 of file class.ilDclBaseFieldRepresentation.php.

References buildFieldCreationInput(), getField(), ilDclFieldFactory\getPluginNameFromFieldModel(), and ilDclDatatype\INPUTFORMAT_PLUGIN.

142  {
143  $opt = $this->buildFieldCreationInput($dcl, $mode);
144 
145  if($mode != 'create' && $this->getField()->getDatatypeId() == ilDclDatatype::INPUTFORMAT_PLUGIN) {
146 
147  $new_plugin_title = $opt->getTitle();
149  if($plugin_name !== "DclBase") {
150  $new_plugin_title .= ': '.$plugin_name;
151  }
152  $opt->setTitle($new_plugin_title);
153  }
154 
155  $form->addOption($opt);
156  }
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Build the creation-input-field.
static getPluginNameFromFieldModel(ilDclBaseFieldModel $object)
Get plugin-name from FieldModel.
+ Here is the call graph for this function:

◆ addFilterInputFieldToTable()

ilDclBaseFieldRepresentation::addFilterInputFieldToTable ( ilTable2GUI  $table)

Add filter input to TableGUI.

Parameters
ilTable2GUI$table
Returns
null

Definition at line 40 of file class.ilDclBaseFieldRepresentation.php.

40  {
41  return null;
42  }

◆ buildFieldCreationInput()

ilDclBaseFieldRepresentation::buildFieldCreationInput ( ilObjDataCollection  $dcl,
  $mode = 'create' 
)
protected

Build the creation-input-field.

Parameters
ilObjDataCollection$dcl
string$mode
Returns
ilPropertyFormGUI

Definition at line 167 of file class.ilDclBaseFieldRepresentation.php.

References getField(), and ilRadioOption\setInfo().

Referenced by addFieldCreationForm().

167  {
168  $opt = new ilRadioOption($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle()), $this->getField()->getDatatypeId());
169  $opt->setInfo($this->lng->txt('dcl_' . $this->getField()->getDatatype()->getTitle(). '_desc'));
170 
171  return $opt;
172  }
This class represents an option in a radio group.
setInfo($a_info)
Set Info.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getField()

ilDclBaseFieldRepresentation::getField ( )

Return BaseFieldModel.

Returns
ilDclBaseFieldModel

Definition at line 189 of file class.ilDclBaseFieldRepresentation.php.

References $field.

Referenced by addFieldCreationForm(), ilDclTextFieldRepresentation\addFilterInputFieldToTable(), ilDclDatetimeFieldRepresentation\addFilterInputFieldToTable(), ilDclBooleanFieldRepresentation\addFilterInputFieldToTable(), ilDclNumberFieldRepresentation\addFilterInputFieldToTable(), ilDclIliasReferenceFieldRepresentation\addFilterInputFieldToTable(), ilDclRatingFieldRepresentation\addFilterInputFieldToTable(), ilDclMobFieldRepresentation\addFilterInputFieldToTable(), ilDclFileuploadFieldRepresentation\addFilterInputFieldToTable(), ilDclReferenceFieldRepresentation\addFilterInputFieldToTable(), ilDclMobFieldRepresentation\buildFieldCreationInput(), buildFieldCreationInput(), ilDclDatetimeFieldRepresentation\getInputField(), ilDclNumberFieldRepresentation\getInputField(), ilDclFormulaFieldRepresentation\getInputField(), ilDclMobFieldRepresentation\getInputField(), ilDclBooleanFieldRepresentation\getInputField(), ilDclRatingFieldRepresentation\getInputField(), ilDclReferenceFieldRepresentation\getInputField(), ilDclIliasReferenceFieldRepresentation\getInputField(), ilDclFileuploadFieldRepresentation\getInputField(), ilDclTextFieldRepresentation\getInputField(), ilDclTextFieldRepresentation\passThroughFilter(), ilDclDatetimeFieldRepresentation\passThroughFilter(), ilDclIliasReferenceFieldRepresentation\passThroughFilter(), ilDclNumberFieldRepresentation\passThroughFilter(), ilDclRatingFieldRepresentation\passThroughFilter(), ilDclMobFieldRepresentation\passThroughFilter(), ilDclBooleanFieldRepresentation\passThroughFilter(), ilDclFileuploadFieldRepresentation\passThroughFilter(), passThroughFilter(), ilDclReferenceFieldRepresentation\passThroughFilter(), ilDclFileuploadFieldRepresentation\requiredWorkaroundForInputField(), and setupFilterInputField().

+ Here is the caller graph for this function:

◆ getFilterInputFieldValue()

ilDclBaseFieldRepresentation::getFilterInputFieldValue (   $input)
protected
Parameters
$input
Returns
null

Definition at line 120 of file class.ilDclBaseFieldRepresentation.php.

Referenced by ilDclTextFieldRepresentation\addFilterInputFieldToTable(), ilDclDatetimeFieldRepresentation\addFilterInputFieldToTable(), ilDclBooleanFieldRepresentation\addFilterInputFieldToTable(), ilDclNumberFieldRepresentation\addFilterInputFieldToTable(), ilDclIliasReferenceFieldRepresentation\addFilterInputFieldToTable(), ilDclRatingFieldRepresentation\addFilterInputFieldToTable(), ilDclMobFieldRepresentation\addFilterInputFieldToTable(), ilDclFileuploadFieldRepresentation\addFilterInputFieldToTable(), and ilDclReferenceFieldRepresentation\addFilterInputFieldToTable().

120  {
121  $value = $input->getValue();
122  if (is_array($value)) {
123  if ($value['from'] || $value['to']) {
124  return $value;
125  }
126  } else {
127  if ($value != '') {
128  return $value;
129  }
130  }
131  return null;
132  }
+ Here is the caller graph for this function:

◆ getInputField()

ilDclBaseFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
  $record_id = 0 
)

Returns field-input.

Parameters
ilPropertyFormGUI$form
int$record_id
Returns
null

Definition at line 99 of file class.ilDclBaseFieldRepresentation.php.

99  {
100  return null;
101  }

◆ getPropertyInputFieldId()

ilDclBaseFieldRepresentation::getPropertyInputFieldId (   $property)

Return post-var for property-fields.

Parameters
$property
Returns
string

Definition at line 180 of file class.ilDclBaseFieldRepresentation.php.

Referenced by ilDclTextFieldRepresentation\buildFieldCreationInput().

180  {
181  return "prop_".$property;
182  }
+ Here is the caller graph for this function:

◆ parseSortingValue()

ilDclBaseFieldRepresentation::parseSortingValue (   $value,
  $link = true 
)
Parameters
$value
bool$link
Returns
mixed

Definition at line 87 of file class.ilDclBaseFieldRepresentation.php.

87  {
88  return $value;
89  }

◆ passThroughFilter()

ilDclBaseFieldRepresentation::passThroughFilter ( ilDclBaseRecordModel  $record,
  $filter 
)

Checks if a filter affects a record.

Parameters
ilDclBaseRecordModel$record
$filter
Returns
bool

Definition at line 64 of file class.ilDclBaseFieldRepresentation.php.

References $pass, getField(), and ilDclBaseRecordModel\getRecordFieldValue().

64  {
65  $value = $record->getRecordFieldValue($this->getField()->getId());
66  $pass = true;
67 
68  if (($this->getField()->getId() == "owner" || $this->getField()->getId() == "last_edit_by") && $filter) {
69  $pass = false;
70  $user = new ilObjUser($value);
71  if (strpos($user->getFullname(), $filter) !== false) {
72  $pass = true;
73  }
74  }
75 
76  return $pass;
77  }
getRecordFieldValue($field_id)
Get Field Value.
+ Here is the call graph for this function:

◆ setupFilterInputField()

◆ setupInputField()

ilDclBaseFieldRepresentation::setupInputField ( ilFormPropertyGUI  $input,
ilDclBaseFieldModel  $field 
)
protected

Sets basic settings on field-input.

Parameters
ilFormPropertyGUI$input
ilDclBaseFieldModel$field

Definition at line 109 of file class.ilDclBaseFieldRepresentation.php.

References ilDclBaseFieldModel\getDescription(), ilFormPropertyGUI\getInfo(), ilDclBaseFieldModel\getRequired(), ilFormPropertyGUI\setInfo(), and ilFormPropertyGUI\setRequired().

Referenced by ilDclDatetimeFieldRepresentation\getInputField(), ilDclNumberFieldRepresentation\getInputField(), ilDclReferenceFieldRepresentation\getInputField(), ilDclBooleanFieldRepresentation\getInputField(), ilDclRatingFieldRepresentation\getInputField(), ilDclIliasReferenceFieldRepresentation\getInputField(), ilDclTextFieldRepresentation\getInputField(), and ilDclFileuploadFieldRepresentation\requiredWorkaroundForInputField().

109  {
110  $input->setRequired($field->getRequired());
111  $input->setInfo($field->getDescription() . ($input->getInfo() ? '<br>' . $input->getInfo() : ''));
112  }
setInfo($a_info)
Set Information Text.
getRequired()
Get Required Required.
getDescription()
Get description.
getInfo()
Get Information Text.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDclBaseFieldRepresentation::$ctrl
protected

Definition at line 22 of file class.ilDclBaseFieldRepresentation.php.

◆ $field

ilDclBaseFieldRepresentation::$field
protected

◆ $lng

ilDclBaseFieldRepresentation::$lng
protected

Definition at line 17 of file class.ilDclBaseFieldRepresentation.php.

Referenced by __construct().


The documentation for this class was generated from the following file: