Class ilDclNReferenceFieldGUI.
More...
◆ __construct()
◆ buildTemplate()
- Parameters
-
$record_field | |
$values | |
$options | |
- Returns
- ilTemplate
Definition at line 53 of file class.ilDclNReferenceFieldGUI.php.
References $options, $tpl, ilDclNReferenceRecordFieldModel\doUpdate(), ilDclBaseRecordFieldModel\getField(), ilDclNReferenceRecordFieldModel\getLinkHTML(), ilDclCache\getRecordCache(), and ilDclBaseRecordFieldModel\setValue().
Referenced by getSingleHTML().
55 $tpl =
new ilTemplate(
"tpl.reference_list.html",
true,
true,
"Modules/DataCollection");
56 $tpl->setCurrentBlock(
"reference_list");
57 foreach ($values as $value) {
59 if (!$ref_record->getTableId() || !$record_field->
getField() || !$record_field->
getField()->getTableId()) {
64 $tpl->setCurrentBlock(
"reference");
66 $tpl->setVariable(
"CONTENT", $ref_record->getRecordFieldHTML($record_field->
getField()->getFieldRef()));
70 $tpl->parseCurrentBlock();
73 $tpl->parseCurrentBlock();
getLinkHTML($link, $value)
setValue($value, $omit_parsing=false)
Set value for record field.
special template class to simplify handling of ITX/PEAR
static getRecordCache($record_id=0)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
◆ getHTML()
ilDclNReferenceFieldGUI::getHTML |
( |
| ) |
|
- Returns
- array|mixed|string
Definition at line 82 of file class.ilDclNReferenceFieldGUI.php.
References $field, $html, $tpl, array, ilDclCache\getRecordCache(), ilDclDatatype\INPUTFORMAT_DATETIME, ilDclDatatype\INPUTFORMAT_NUMBER, and ilUtil\sortArray().
84 $values = $this->field->getValue();
87 if (!$values or !count($values)) {
93 $tpl =
new ilTemplate(
"tpl.reference_hover.html",
true,
true,
"Modules/DataCollection");
94 $tpl->setCurrentBlock(
"reference_list");
96 foreach ($values as $value) {
98 if (!$ref_record->getTableId() or !$record_field->getField() or !$record_field->getField()->getTableId()) {
100 $record_field->setValue(null);
101 $record_field->doUpdate();
103 $elements[] =
array(
'value' => $ref_record->getRecordFieldHTML($this->field->getField()->getFieldRef()),
104 'sort' => $ref_record->getRecordFieldSortingValue($this->field->getField()->getFieldRef()));
110 switch ($ref_field->getDatatypeId()) {
119 foreach ($elements as $element) {
120 if ((strlen(
$html) < $record_field->getMaxReferenceLength())) {
121 $html .= $element[
'value'] .
", ";
125 $tpl->setCurrentBlock(
"reference");
126 $tpl->setVariable(
"CONTENT", $element[
'value']);
127 $tpl->parseCurrentBlock();
134 $tpl->setVariable(
"RECORD_ID", $record_field->getRecord()->getId());
136 $tpl->parseCurrentBlock();
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
Class ilDclBaseFieldModel.
special template class to simplify handling of ITX/PEAR
static getRecordCache($record_id=0)
const INPUTFORMAT_DATETIME
Create styles array
The data for the language used.
◆ getSingleHTML()
ilDclNReferenceFieldGUI::getSingleHTML |
( |
|
$options = null | ) |
|
- Parameters
-
- Returns
- string
Definition at line 32 of file class.ilDclNReferenceFieldGUI.php.
References $options, $tpl, and buildTemplate().
34 $values = $this->field->getValue();
36 if (!$values || !count($values)) {
buildTemplate(ilDclNReferenceRecordFieldModel $record_field, $values, $options)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
◆ $field
ilDclNReferenceFieldGUI::$field |
|
protected |
The documentation for this class was generated from the following file: