ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups 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
 doUpdate ()
 delete ()
 getValue ()
 setValue ($value)
 getFormInput ()
 getPlainText ()
 getHTML ()
 getSingleHTML ($link=null)
 this funciton is used to in the viewdefinition of a single record.
 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

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

Reimplemented from ilDataCollectionRecordField.

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

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

{
parent::__construct($record, $field);
$dclTable = ilDataCollectionCache::getTableCache($this->getField()->getTableId());
$this->dcl_obj_id = $dclTable->getCollectionObject()->getId();
}

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionReferenceField::getExportValue ( )

Reimplemented from ilDataCollectionRecordField.

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

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

{
if($this->getValue()){
return $ref_rec->getRecordField($this->getField()->getFieldRef())->getExportValue();
}
else
return "";
}

+ Here is the call graph for this function:

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

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

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

{
global $ilCtrl;
$value = $this->getValue();
$record_field = $this;
if(!$value || $value == "-"){
return "";
}
if(!$ref_record->getTableId() || !$record_field->getField() || !$record_field->getField()->getTableId()){
//the referenced record_field does not seem to exist.
$html = "-";
$record_field->setValue(NULL);
$record_field->doUpdate();
}
else
{
$html = $ref_record->getRecordFieldHTML($record_field->getField()->getFieldRef());
if($options['link']['display']) {
global $ilDB;
$ref_table = $ref_record->getTableId();
$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");
$set = $ilDB->query($query);
if($set->numRows())
$html = $this->getLinkHTML($options['link']['name'], $this->getValue());
}
}
return $html;
}

+ Here is the call graph for this function:

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().

{
global $ilCtrl;
if(!$value || $value == "-"){
return "";
}
$record_field = $this;
$objRefField = ilDataCollectionCache::getFieldCache($record_field->getField()->getFieldRef());
$objRefTable = ilDataCollectionCache::getTableCache($objRefField->getTableId());
if(!$link_name) {
$link_name = $ref_record->getRecordFieldHTML($record_field->getField()->getFieldRef());
}
$ilCtrl->setParameterByClass("ildatacollectionrecordviewgui", "record_id", $ref_record->getId());
$html = "<a href='". $ilCtrl->getLinkTargetByClass("ilDataCollectionRecordViewGUI","renderRecord")."'>".$link_name."</a>";
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

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: