ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDataCollectionReferenceField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionReferenceField:
+ Collaboration diagram for ilDataCollectionReferenceField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 getHTML (array $options=array())
 
 getExportValue ()
 
- Public Member Functions inherited from ilDataCollectionRecordField
 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 doUpdate ()
 
 delete ()
 
 getValue ()
 
 setValue ($value)
 
 getFormInput ()
 
 getExportValue ()
 
 getPlainText ()
 
 getHTML ()
 
 getSingleHTML ($link=null)
 this funciton is used to in the viewdefinition of a single record. More...
 
 getField ()
 
 getId ()
 
 getRecord ()
 

Protected Member Functions

 getLinkHTML ($link_name=NULL, $value)
 
- Protected Member Functions inherited from ilDataCollectionRecordField
 loadValue ()
 

Protected Attributes

 $dcl_obj_id
 
- Protected Attributes inherited from ilDataCollectionRecordField
 $id
 
 $field
 
 $record
 
 $value
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDataCollectionReferenceField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)

Definition at line 31 of file class.ilDataCollectionReferenceField.php.

References ilDataCollectionRecordField\getField(), and ilDataCollectionCache\getTableCache().

31  {
32  parent::__construct($record, $field);
33  $dclTable = ilDataCollectionCache::getTableCache($this->getField()->getTableId());
34  $this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
35  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getExportValue()

ilDataCollectionReferenceField::getExportValue ( )

Definition at line 114 of file class.ilDataCollectionReferenceField.php.

References ilDataCollectionRecordField\getField(), ilDataCollectionCache\getRecordCache(), and ilDataCollectionRecordField\getValue().

115  {
116  if($this->getValue()){
117  $ref_rec = ilDataCollectionCache::getRecordCache($this->getValue());
118  return $ref_rec->getRecordField($this->getField()->getFieldRef())->getExportValue();
119  }
120  else
121  return "";
122  }
static getRecordCache($record_id=0)
+ Here is the call graph for this function:

◆ getHTML()

ilDataCollectionReferenceField::getHTML ( array  $options = array())

Definition at line 43 of file class.ilDataCollectionReferenceField.php.

References $ilCtrl, $options, $query, ilDataCollectionRecordField\$value, getLinkHTML(), ilDataCollectionCache\getRecordCache(), and ilDataCollectionRecordField\getValue().

43  {
44  global $ilCtrl;
45 
46  $value = $this->getValue();
47  $record_field = $this;
48 
49  if(!$value || $value == "-"){
50  return "";
51  }
52 
53 
55  if(!$ref_record->getTableId() || !$record_field->getField() || !$record_field->getField()->getTableId()){
56  //the referenced record_field does not seem to exist.
57  $html = "";
58  $record_field->setValue(NULL);
59  $record_field->doUpdate();
60  }
61  else
62  {
63  $html = $ref_record->getRecordFieldHTML($record_field->getField()->getFieldRef());
64 
65  if($options['link']['display']) {
66  global $ilDB;
68  $ref_table = $ref_record->getTableId();
69 
70  $query = "SELECT table_id FROM il_dcl_view WHERE table_id = ".$ref_table." AND type = ".$ilDB->quote(0, "integer")." AND formtype = ".$ilDB->quote(0, "integer");
71  $set = $ilDB->query($query);
72  if($set->numRows())
73  $html = $this->getLinkHTML($options['link']['name'], $this->getValue());
74  }
75  }
76 
77 
78  return $html;
79  }
static getRecordCache($record_id=0)
global $ilCtrl
Definition: ilias.php:18
if(!is_array($argv)) $options
+ Here is the call graph for this function:

◆ getLinkHTML()

ilDataCollectionReferenceField::getLinkHTML (   $link_name = NULL,
  $value 
)
protected

Definition at line 86 of file class.ilDataCollectionReferenceField.php.

References $ilCtrl, ilDataCollectionRecordField\$value, ilDataCollectionCache\getFieldCache(), ilDataCollectionCache\getRecordCache(), and ilDataCollectionCache\getTableCache().

Referenced by getHTML().

86  {
87  global $ilCtrl;
88 
89  if(!$value || $value == "-"){
90  return "";
91  }
92 
93  $record_field = $this;
95 
96  $objRefField = ilDataCollectionCache::getFieldCache($record_field->getField()->getFieldRef());
97  $objRefTable = ilDataCollectionCache::getTableCache($objRefField->getTableId());
98 
99  if(!$link_name) {
100  $link_name = $ref_record->getRecordFieldHTML($record_field->getField()->getFieldRef());
101  }
102 
103  $ilCtrl->setParameterByClass("ildatacollectionrecordviewgui", "record_id", $ref_record->getId());
104 
105  $html = "<a href='". $ilCtrl->getLinkTargetByClass("ilDataCollectionRecordViewGUI","renderRecord")."'>".$link_name."</a>";
106 
107 
108  return $html;
109  }
static getRecordCache($record_id=0)
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $dcl_obj_id

ilDataCollectionReferenceField::$dcl_obj_id
protected

Definition at line 27 of file class.ilDataCollectionReferenceField.php.


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