ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

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

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

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

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

Referenced by addFieldCreationForm().

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

References $field.

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

Referenced by ilDclSelectionFieldRepresentation\buildFieldCreationInput().

105  {
106  return null;
107  }
+ 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 189 of file class.ilDclBaseFieldRepresentation.php.

Referenced by ilDclTextFieldRepresentation\buildFieldCreationInput().

190  {
191  return "prop_" . $property;
192  }
+ Here is the caller graph for this function:

◆ parseSortingValue()

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

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

92  {
93  return $value;
94  }

◆ passThroughFilter()

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

Checks if a filter affects a record.

Parameters
ilDclBaseRecordModel$record
$filter
Returns
bool

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

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

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

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

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

116  {
117  $input->setRequired($field->getRequired());
118  $input->setInfo($field->getDescription() . ($input->getInfo() ? '<br>' . $input->getInfo() : ''));
119  }
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: