2 require_once(
'./Modules/DataCollection/classes/Fields/Base/class.ilDclBaseFieldRepresentation.php');
18 $input->setWidth(100);
19 $input->setWidthUnit(
'%');
29 $options[
""] = $this->lng->txt(
'dcl_please_select');
32 foreach ($reftable->getRecords() as $record) {
34 switch ($reffield->getDatatypeId()) {
36 $file_obj =
new ilObjFile($record->getRecordFieldValue($fieldref),
false);
37 $options[$record->getId()] = $file_obj->getFileName();
40 $media_obj =
new ilObjMediaObject($record->getRecordFieldValue($fieldref),
false);
41 $options[$record->getId()] = $media_obj->
getTitle();
44 $options[$record->getId()] = strtotime($record->getRecordFieldSingleHTML($fieldref));
46 $options2[$record->getId()] = $record->getRecordFieldSingleHTML($fieldref);
49 $value = $record->getRecordFieldValue($fieldref);
51 if (!is_array($value)) {
52 $value =
array(
'title' =>
'',
'link' => $value);
54 $value = $value[
'title'] ? $value[
'title'] : $value[
'link'];
56 $options[$record->getId()] = $value;
59 $options[$record->getId()] = $record->getRecordFieldRepresentationValue($fieldref);
62 $options[$record->getId()] = $record->getRecordFieldValue($fieldref);
81 $input->addCustomAttribute(
'data-ref="1"');
82 $input->addCustomAttribute(
'data-ref-table-id="' . $reftable->getId() .
'"');
83 $input->addCustomAttribute(
'data-ref-field-id="' . $reffield->getId() .
'"');
95 foreach ($ref_table->getRecords() as $record) {
96 $options[$record->getId()] = $record->getRecordFieldPlainText($ref_field_id);
100 $options =
array(
'' => $this->lng->txt(
'dcl_any')) + $options;
101 $input->setOptions($options);
116 if (!$filter || $filter == $value) {
127 $opt = parent::buildFieldCreationInput($dcl, $mode);
132 foreach ($tables as $table) {
133 foreach ($table->getRecordFields() as
$field) {
136 $options[
$field->getId()] = $table->getTitle() . self::REFERENCE_SEPARATOR .
$field->getTitle();
140 $prop_table_selection =
new ilSelectInputGUI($this->lng->txt(
'dcl_reference_title'),
'prop_' .ilDclBaseFieldModel::PROP_REFERENCE);
143 $opt->addSubItem($prop_table_selection);
145 $prop_ref_link =
new ilDclCheckboxInputGUI($this->lng->txt(
'dcl_reference_link'),
'prop_'.ilDclBaseFieldModel::PROP_REFERENCE_LINK);
146 $prop_ref_link->
setInfo($this->lng->txt(
'dcl_reference_link_info'));
147 $opt->addSubItem($prop_ref_link);
149 $prop_multi_select =
new ilDclCheckboxInputGUI($this->lng->txt(
'dcl_multiple_selection'),
'prop_'.ilDclBaseFieldModel::PROP_N_REFERENCE);
const REFERENCE_SEPARATOR
buildFieldCreationInput(ilObjDataCollection $dcl, $mode='create')
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=NULL)
Add filter by standard type.
static hasPermissionToAddRecord($ref_id, $table_id)
addFilterInputFieldToTable(ilTable2GUI $table)
static getFieldCache($field_id=0)
static getTableCache($table_id=0)
passThroughFilter(ilDclBaseRecordModel $record, $filter)
Class ilDclTextFieldRepresentation.
setupInputField(ilFormPropertyGUI $input, ilDclBaseFieldModel $field)
Sets basic settings on field-input.
getInputField(ilPropertyFormGUI $form, $record_id=0)
if(!is_array($argv)) $options
setupFilterInputField(ilFormPropertyGUI $input)
Set basic settings for filter-input-gui.
const INPUTFORMAT_DATETIME
const INPUTFORMAT_ILIAS_REF
Create styles array
The data for the language used.
const INPUTFORMAT_REFERENCE
getField()
Return BaseFieldModel.
Class ilDclBaseRecordModel.
getRecordFieldValue($field_id)
Get Field Value.
Class ilDclBaseFieldRepresentation.
getFilterInputFieldValue( $input)
Class ilObjDataCollection.