ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 23 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 $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18

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 155 of file class.ilDclBaseFieldRepresentation.php.

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

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  }
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
Build the creation-input-field.
if(isset($_POST['submit'])) $form
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 41 of file class.ilDclBaseFieldRepresentation.php.

42  {
43  return null;
44  }

◆ buildFieldCreationInput()

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

Build the creation-input-field.

Parameters
ilObjDataCollection$dcl
string$mode
Returns
ilPropertyFormGUI

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

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

Referenced by addFieldCreationForm().

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  }
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 207 of file class.ilDclBaseFieldRepresentation.php.

References $field.

Referenced by addFieldCreationForm(), ilDclTextFieldRepresentation\addFilterInputFieldToTable(), ilDclIliasReferenceFieldRepresentation\addFilterInputFieldToTable(), ilDclBooleanFieldRepresentation\addFilterInputFieldToTable(), ilDclDatetimeFieldRepresentation\addFilterInputFieldToTable(), ilDclRatingFieldRepresentation\addFilterInputFieldToTable(), ilDclMobFieldRepresentation\addFilterInputFieldToTable(), ilDclNumberFieldRepresentation\addFilterInputFieldToTable(), ilDclFileuploadFieldRepresentation\addFilterInputFieldToTable(), ilDclReferenceFieldRepresentation\addFilterInputFieldToTable(), ilDclSelectionFieldRepresentation\addFilterInputFieldToTable(), ilDclSelectionFieldRepresentation\buildFieldCreationInput(), ilDclMobFieldRepresentation\buildFieldCreationInput(), buildFieldCreationInput(), ilDclIliasReferenceFieldRepresentation\getInputField(), ilDclDatetimeFieldRepresentation\getInputField(), ilDclMobFieldRepresentation\getInputField(), ilDclBooleanFieldRepresentation\getInputField(), ilDclNumberFieldRepresentation\getInputField(), ilDclRatingFieldRepresentation\getInputField(), ilDclFormulaFieldRepresentation\getInputField(), ilDclReferenceFieldRepresentation\getInputField(), ilDclFileuploadFieldRepresentation\getInputField(), ilDclTextFieldRepresentation\getInputField(), ilDclTextFieldRepresentation\passThroughFilter(), ilDclIliasReferenceFieldRepresentation\passThroughFilter(), ilDclDatetimeFieldRepresentation\passThroughFilter(), ilDclMobFieldRepresentation\passThroughFilter(), ilDclNumberFieldRepresentation\passThroughFilter(), ilDclRatingFieldRepresentation\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

◆ getInputField()

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

Returns field-input.

Parameters
ilPropertyFormGUI$form
int$record_id
Returns
null

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

Referenced by ilDclSelectionFieldRepresentation\buildFieldCreationInput().

107  {
108  return null;
109  }
+ Here is the caller graph for this function:

◆ getPropertyInputFieldId()

ilDclBaseFieldRepresentation::getPropertyInputFieldId (   $property)

Return post-var for property-fields.

Parameters
$property
Returns
string

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

Referenced by ilDclTextFieldRepresentation\buildFieldCreationInput().

197  {
198  return "prop_" . $property;
199  }
+ Here is the caller graph for this function:

◆ parseSortingValue()

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

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

93  {
94  return $value;
95  }

◆ passThroughFilter()

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

Checks if a filter affects a record.

Parameters
ilDclBaseRecordModel$record
$filter
Returns
bool

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

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

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  }
$user
Definition: migrateto20.php:57
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 118 of file class.ilDclBaseFieldRepresentation.php.

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

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

119  {
120  $input->setRequired($field->getRequired());
121  $input->setInfo($field->getDescription() . ($input->getInfo() ? '<br>' . $input->getInfo() : ''));
122  }
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 20 of file class.ilDclBaseFieldRepresentation.php.

◆ $field

ilDclBaseFieldRepresentation::$field
protected

◆ $lng

ilDclBaseFieldRepresentation::$lng
protected

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

Referenced by __construct().


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