ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilDclFormulaFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 
20 {
21  public function getInputField(ilPropertyFormGUI $form, ?int $record_id = null): ilTextInputGUI
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  }
30 
31  protected function buildFieldCreationInput(ilObjDataCollection $dcl, string $mode = 'create'): ilRadioOption
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  }
58 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getInputField(ilPropertyFormGUI $form, ?int $record_id=null)
static http()
Fetches the global http state from ILIAS.
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
buildFieldCreationInput(ilObjDataCollection $dcl, string $mode='create')
This class represents a text area property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...