ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilDclFormulaFieldRepresentation.php
Go to the documentation of this file.
1<?php
2require_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}
sprintf('%.4f', $callTime)
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
Class ilDclBaseFieldRepresentation.
static getTableCache($table_id=0)
getInputField(ilPropertyFormGUI $form, $record_id=0)
Returns field-input.
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
@inheritDoc
Class ilObjDataCollection.
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.