ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilDclFormulaFieldRepresentation.php
Go to the documentation of this file.
1<?php
2
10{
11 public function getInputField(ilPropertyFormGUI $form, $record_id = 0)
12 {
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 return $input;
19 }
20
21
25 protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
26 {
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}
$_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.
static getDescription()
Definition: Php.php:51
if(empty($password)) $table
Definition: pwgen.php:24
if(isset($_POST['submit'])) $form