ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
19  return $input;
20  }
21 
22 
26  protected function buildFieldCreationInput(ilObjDataCollection $dcl, $mode = 'create')
27  {
28  $opt = parent::buildFieldCreationInput($dcl, $mode);
29 
30  $table = ilDclCache::getTableCache((int) $_GET['table_id']);
31  $fields = array();
32  foreach ($table->getFieldsForFormula() as $f) {
33  $placeholder = ($f->isStandardField()) ? $f->getId() : $f->getTitle();
34  $fields[] = '<a class="dclPropExpressionField" data-placeholder="' . $placeholder . '">' . $f->getTitle() . '</a>';
35  }
36  $subitem = new ilTextAreaInputGUI($this->lng->txt('dcl_prop_expression'), 'prop_' . ilDclBaseFieldModel::PROP_FORMULA_EXPRESSION);
37  $operators = implode(', ', array_keys(ilDclExpressionParser::getOperators()));
38  $functions = implode(', ', ilDclExpressionParser::getFunctions());
39  $subitem->setInfo(sprintf($this->lng->txt('dcl_prop_expression_info'), $operators, $functions, implode('<br>', $fields)));
40  $opt->addSubItem($subitem);
41 
42  return $opt;
43  }
44 }
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')
if(isset($_POST['submit'])) $form
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.
if(empty($password)) $table
Definition: pwgen.php:24
Class ilDclBaseFieldRepresentation.
Class ilObjDataCollection.