ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilDataCollectionILIASRefField Class Reference

Class ilDataCollectionField. More...

+ Inheritance diagram for ilDataCollectionILIASRefField:
+ Collaboration diagram for ilDataCollectionILIASRefField:

Public Member Functions

 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 getHTML (array $options=array())
 getSingleHTML (array $options=array())
 getLinkHTML ($title, $show_action_menu=false)
 getExportValue ()
 getStatus ()
- Public Member Functions inherited from ilDataCollectionRecordField
 doUpdate ()
 Update object in database.
 delete ()
 Delete record field in database.
 getValue ()
 setValue ($value, $omit_parsing=false)
 Set value for record field.
 getFormInput ()
 getPlainText ()
 getHTML ($link=true)
 getSortingValue ($link=true)
 getSingleHTML ()
 getField ()
 getId ()
 getRecord ()

Protected Member Functions

 getActionLink ($mode)
- Protected Member Functions inherited from ilDataCollectionRecordField
 doRead ()
 Read object data from database.
 doCreate ()
 Create object in database.
 loadValue ()
 Load the value.

Protected Attributes

 $dcl_obj_id
 $properties = array()
- Protected Attributes inherited from ilDataCollectionRecordField
 $id
 $field
 $record
 $value
 $lng
 $user
 $ctrl
 $db

Detailed Description

Constructor & Destructor Documentation

ilDataCollectionILIASRefField::__construct ( ilDataCollectionRecord  $record,
ilDataCollectionField  $field 
)
Parameters
ilDataCollectionRecord$record
ilDataCollectionField$field

Reimplemented from ilDataCollectionRecordField.

Definition at line 33 of file class.ilDataCollectionILIASRefField.php.

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

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

+ Here is the call graph for this function:

Member Function Documentation

ilDataCollectionILIASRefField::getActionLink (   $mode)
protected
Parameters
string$modecopy|link
Returns
string

Definition at line 125 of file class.ilDataCollectionILIASRefField.php.

References $ilCtrl, and ilDataCollectionRecordField\getValue().

Referenced by getLinkHTML().

{
global $ilCtrl;
switch ($mode) {
case 'copy':
$ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getValue());
$ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getValue());
$ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getValue());
return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
case 'link':
return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui','ilobjrootfoldergui'), 'link');
default:
return '';
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionILIASRefField::getExportValue ( )
Returns
int|string

Reimplemented from ilDataCollectionRecordField.

Definition at line 101 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$value, ilLink\_getStaticLink(), and ilDataCollectionRecordField\getValue().

{
$value = $this->getValue();
return $link;
}

+ Here is the call graph for this function:

ilDataCollectionILIASRefField::getHTML ( array  $options = array())
Parameters
array$options
Returns
mixed|string

Definition at line 45 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$id, ilDataCollectionRecordField\$value, ilObject\_lookupObjId(), ilObject\_lookupTitle(), getLinkHTML(), ilDataCollectionRecordField\getValue(), ilDataCollectionField\PROPERTYID_DISPLAY_COPY_LINK_ACTION_MENU, and ilDataCollectionField\PROPERTYID_ILIAS_REFERENCE_LINK.

{
$value = $this->getValue();
if (!$value) {
return '';
}
$html = $this->getLinkHTML($title, true);
$html = $this->getLinkHTML($title);
} else {
$html = $title;
}
return $html;
}

+ Here is the call graph for this function:

ilDataCollectionILIASRefField::getLinkHTML (   $title,
  $show_action_menu = false 
)
Parameters
$title
$show_action_menu
Returns
string

Definition at line 83 of file class.ilDataCollectionILIASRefField.php.

References ilDataCollectionRecordField\$lng, ilLink\_getStaticLink(), getActionLink(), ilDataCollectionRecordField\getValue(), and ilDataCollectionField\PROPERTYID_ILIAS_REFERENCE_LINK.

Referenced by getHTML(), and getSingleHTML().

{
global $lng;
$link = ilLink::_getStaticLink($this->getValue());
if ($show_action_menu) {
$list->setId('adv_list_copy_link_' . $this->field->getId() . $this->record->getId());
$list->setListTitle($title);
$list->addItem($lng->txt('view'), 'view', $link);
}
$list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
$list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
return $list->getHTML();
} else {
return "<a href=\"$link\">$title</a>";
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilDataCollectionILIASRefField::getSingleHTML ( array  $options = array())
ilDataCollectionILIASRefField::getStatus ( )

Definition at line 107 of file class.ilDataCollectionILIASRefField.php.

References $ilDB, $ilUser, $query, $result, ilObject2\_lookupObjectId(), DB_FETCHMODE_OBJECT, and ilDataCollectionRecordField\getValue().

{
global $ilDB, $ilUser;
$usr_id = $ilUser->getId();
$obj_ref = $this->getValue();
$obj_id = ilObject2::_lookupObjectId($obj_ref);
$query = " SELECT status_changed, status
FROM ut_lp_marks
WHERE usr_id = ".$usr_id." AND obj_id = ".$obj_id."
";
$result = $ilDB->query($query);
return ($result->numRows() == 0)? false:$result->fetchRow(DB_FETCHMODE_OBJECT);
}

+ Here is the call graph for this function:

Field Documentation

ilDataCollectionILIASRefField::$dcl_obj_id
protected

Definition at line 26 of file class.ilDataCollectionILIASRefField.php.

ilDataCollectionILIASRefField::$properties = array()
protected

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


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