ILIAS  release_8 Revision v8.24
ilDclFormulaFieldRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ 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
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ilComponentRepository $component_repository
 
ilComponentFactory $component_factory
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 19 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 31 of file class.ilDclFormulaFieldRepresentation.php.

32 {
33 $opt = parent::buildFieldCreationInput($dcl, $mode);
34
35 $table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int());
36 $table = ilDclCache::getTableCache($table_id);
37 $fields = array();
38 foreach ($table->getFieldsForFormula() as $f) {
39 $placeholder = ($f->isStandardField()) ? $f->getId() : $f->getTitle();
40 $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>';
41 }
42 $subitem = new ilTextAreaInputGUI(
43 $this->lng->txt('dcl_prop_expression'),
45 );
46 $operators = implode(', ', array_keys(ilDclExpressionParser::getOperators()));
47 $functions = implode(', ', ilDclExpressionParser::getFunctions());
48 $subitem->setInfo(sprintf(
49 $this->lng->txt('dcl_prop_expression_info'),
50 $operators,
51 $functions,
52 implode('<br>', $fields)
53 ));
54 $opt->addSubItem($subitem);
55
56 return $opt;
57 }
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
static http()
Fetches the global http state from ILIAS.

References Vendor\Package\$f, ilDclExpressionParser\getFunctions(), ilDclExpressionParser\getOperators(), 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 21 of file class.ilDclFormulaFieldRepresentation.php.

22 {
23 $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
24 $input->setDisabled(true);
25 $input->setValue('-');
26 $input->setInfo($this->getField()->getDescription() . '<br>' . $this->lng->txt('dcl_formula_detail_desc'));
27
28 return $input;
29 }
This class represents a text property in a property form.

References ilDclBaseFieldRepresentation\getField(), ILIAS\Survey\Mode\getId(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

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