ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilDclFormulaFieldRepresentation Class Reference
+ Inheritance diagram for ilDclFormulaFieldRepresentation:
+ Collaboration diagram for ilDclFormulaFieldRepresentation:

Public Member Functions

 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
- Public Member Functions inherited from ilDclBaseFieldRepresentation
 __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 (string $value, bool $link=true)
 
 getInputField (ilPropertyFormGUI $form, ?int $record_id=null)
 Returns field-input. More...
 
 addFieldCreationForm (ilSubEnabledFormPropertyGUI $form, ilObjDataCollection $dcl, string $mode="create")
 Adds the options for the field-types to the field-creation form. More...
 
 getPropertyInputFieldId (string $property)
 Return post-var for property-fields. More...
 
 getField ()
 Return BaseFieldModel. More...
 

Protected Member Functions

 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 
- Protected Member Functions inherited from ilDclBaseFieldRepresentation
 setupFilterInputField (?ilTableFilterItem $input)
 Set basic settings for filter-input-gui. More...
 
 setupInputField (ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
 Sets basic settings on field-input. More...
 
 getFilterInputFieldValue (ilTableFilterItem $input)
 
 buildFieldCreationInput (ilObjDataCollection $dcl, string $mode='create')
 Build the creation-input-field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseFieldRepresentation
ilDclBaseFieldModel $field
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilObjUser $user
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

Definition at line 25 of file class.ilDclFormulaFieldRepresentation.php.

Member Function Documentation

◆ buildFieldCreationInput()

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

Build the creation-input-field.

Reimplemented from ilDclBaseFieldRepresentation.

Definition at line 37 of file class.ilDclFormulaFieldRepresentation.php.

38 {
39 $opt = parent::buildFieldCreationInput($dcl, $mode);
40
41 $table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int());
42 $table = ilDclCache::getTableCache($table_id);
43 $fields = [];
44 foreach ($table->getFieldsForFormula() as $f) {
45 $placeholder = ($f->isStandardField()) ? $f->getId() : $f->getTitle();
46 $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>';
47 }
48 $subitem = new ilTextAreaInputGUI(
49 $this->lng->txt('dcl_prop_expression'),
51 );
52 $operators = implode(', ', array_map(
53 static fn(Operators $operator): string => $operator->value,
54 Tokenizer::$operators
55 ));
56 $functions = implode(', ', array_map(
57 static fn(Functions $function): string => $function->value,
58 Tokenizer::$functions
59 ));
60 $subitem->setInfo(sprintf(
61 $this->lng->txt('dcl_prop_expression_info'),
62 $operators,
63 $functions,
64 implode('<br>', $fields)
65 ));
66 $opt->addSubItem($subitem);
67
68 return $opt;
69 }
static getTableCache(?int $table_id=null)
This class represents an option in a radio group.
This class represents a text area property in a property form.
static http()
Fetches the global http state from ILIAS.

References Vendor\Package\$f, ilDclCache\getTableCache(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_FORMULA_EXPRESSION, and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

◆ getInputField()

ilDclFormulaFieldRepresentation::getInputField ( ilPropertyFormGUI  $form,
?int  $record_id = null 
)

Returns field-input.

Reimplemented from ilDclBaseFieldRepresentation.

Definition at line 27 of file class.ilDclFormulaFieldRepresentation.php.

28 {
29 $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
30 $input->setDisabled(true);
31 $input->setValue('-');
32 $input->setInfo($this->getField()->getDescription() . '<br>' . $this->lng->txt('dcl_formula_detail_desc'));
33
34 return $input;
35 }
This class represents a text property in a property form.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

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