ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilDclReferenceRecordRepresentation Class Reference

Class ilDclReferenceRecordRepresentation. More...

+ Inheritance diagram for ilDclReferenceRecordRepresentation:
+ Collaboration diagram for ilDclReferenceRecordRepresentation:

Public Member Functions

 getHTML ($link=true)
 
- Public Member Functions inherited from ilDclBaseRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getFormGUI (ilPropertyFormGUI $formGUI)
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 fillFormInput ($form)
 Fills the form with the value of a record. More...
 
 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 getSingleHTML (array $options=null, $link=true)
 Returns data for single record view. More...
 
 getConfirmationHTML ()
 Returns data for confirmation list When returning false, attribute is ignored in list. More...
 
 fillRow (ilTemplate $tpl)
 Fills row with record data. More...
 
 getRecordField ()
 Get Record Field. More...
 
 getField ()
 Getter shortcut for field. More...
 
 getRecord ()
 Getter shortcut for record. More...
 

Protected Member Functions

 getLinkHTML ($link_name=NULL, $value)
 
- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseRecordRepresentation
 $record_field
 
 $lng
 
 $access
 
 $ctrl
 

Detailed Description

Member Function Documentation

◆ getHTML()

ilDclReferenceRecordRepresentation::getHTML (   $link = true)
Returns
array|mixed|string

Definition at line 15 of file class.ilDclReferenceRecordRepresentation.php.

References $_GET, $html, ilDclBaseRecordRepresentation\$record_field, array, getLinkHTML(), ilDclCache\getRecordCache(), ilDclBaseRecordRepresentation\getRecordField(), ilDclBaseFieldModel\PROP_REFERENCE, and ilDclBaseFieldModel\PROP_REFERENCE_LINK.

15  {
16  $value = $this->getRecordField()->getValue();
17  $record_field = $this->getRecordField();
18 
19  if (!$value || $value == "-") {
20  return "";
21  }
22 
23  if (!is_array($value)) {
24  $value = array($value);
25  }
26 
27  $html = "";
28 
29  foreach ($value as $v) {
30  $ref_record = ilDclCache::getRecordCache($v);
31  if (!$ref_record->getTableId() || !$record_field->getField() || !$record_field->getField()->getTableId()) {
32  //the referenced record_field does not seem to exist.
33  $record_field->setValue(NULL);
34  $record_field->doUpdate();
35  } else {
36  $field = $this->getRecordField()->getField();
37  if ($field->getProperty(ilDclBaseFieldModel::PROP_REFERENCE_LINK)) {
38  $ref_record = ilDclCache::getRecordCache($v);
39  $ref_table = $ref_record->getTable();
40 
41  if ($ref_table->getVisibleTableViews($_GET['ref_id'], true)) {
42  $html .= $this->getLinkHTML(NULL, $v);
43  } else {
44  $html .= $ref_record->getRecordFieldHTML($field->getProperty(ilDclBaseFieldModel::PROP_REFERENCE));
45  }
46  } else {
47  $html .= $ref_record->getRecordFieldHTML($field->getProperty(ilDclBaseFieldModel::PROP_REFERENCE));
48  }
49  }
50  $html .= '<br>';
51  }
52 
53  $html = substr($html, 0, -4); // cut away last <br>
54 
55  return $html;
56  }
$_GET["client_id"]
static getRecordCache($record_id=0)
Create styles array
The data for the language used.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ getLinkHTML()

ilDclReferenceRecordRepresentation::getLinkHTML (   $link_name = NULL,
  $value 
)
protected
Parameters
null$link_name
$value
Returns
string

Definition at line 65 of file class.ilDclReferenceRecordRepresentation.php.

References $_GET, $DIC, $html, $ilCtrl, ilDclBaseRecordRepresentation\$record_field, ilDclCache\getRecordCache(), and ilDclBaseFieldModel\PROP_REFERENCE.

Referenced by getHTML().

65  {
66  global $DIC;
67  $ilCtrl = $DIC['ilCtrl'];
68 
69  if (!$value || $value == "-") {
70  return "";
71  }
72  $record_field = $this;
73  $ref_record = ilDclCache::getRecordCache($value);
74  if (!$link_name) {
75  $link_name = $ref_record->getRecordFieldHTML($record_field->getField()->getProperty(ilDclBaseFieldModel::PROP_REFERENCE));
76  }
77  $ilCtrl->clearParametersByClass("ilDclDetailedViewGUI");
78  $ilCtrl->setParameterByClass("ilDclDetailedViewGUI", "record_id", $ref_record->getId());
79  $ilCtrl->setParameterByClass("ilDclDetailedViewGUI", "back_tableview_id", $_GET['tableview_id']);
80  $html = "<a href='" . $ilCtrl->getLinkTargetByClass("ilDclDetailedViewGUI", "renderRecord") . "&disable_paging=1'>" . $link_name . "</a>";
81 
82  return $html;
83  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getRecordCache($record_id=0)
global $DIC
$html
Definition: example_001.php:87
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: