ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclFormulaFieldRepresentation.php
Go to the documentation of this file.
1 <?php
2 require_once ('./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
3 
11 
12  public function getInputField(ilPropertyFormGUI $form, $record_id = 0) {
13  $input = new ilTextInputGUI($this->getField()->getTitle(), 'field_' . $this->getField()->getId());
14  $input->setDisabled(true);
15  $input->setValue('-');
16  $input->setInfo($this->getField()->getDescription() . '<br>' . $this->lng->txt('dcl_formula_detail_desc'));
17 
18 
19  return $input;
20  }
21 
22 
26  protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create') {
27  $opt = parent::buildFieldCreationInput($dcl, $mode);
28 
29  $table = ilDclCache::getTableCache((int)$_GET['table_id']);
30  $fields = array();
31  foreach ($table->getFieldsForFormula() as $f) {
32  $placeholder = ($f->isStandardField()) ? $f->getId() : $f->getTitle();
33  $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>';
34  }
35  $subitem = new ilTextAreaInputGUI($this->lng->txt('dcl_prop_expression'), 'prop_' . ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
36  $operators = implode(', ', array_keys(ilDclExpressionParser::getOperators()));
37  $functions = implode(', ', ilDclExpressionParser::getFunctions());
38  $subitem->setInfo(sprintf($this->lng->txt('dcl_prop_expression_info'), $operators, $functions, implode('<br>', $fields)));
39  $opt->addSubItem($subitem);
40 
41  return $opt;
42  }
43 }
This class represents a property form user interface.
$_GET["client_id"]
getInputField(ilPropertyFormGUI $form, $record_id=0)
static getTableCache($table_id=0)
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
This class represents a text property in a property form.
Create styles array
The data for the language used.
This class represents a text area property in a property form.
Class ilDclBaseFieldRepresentation.
Class ilObjDataCollection.