ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
 __construct (ilDataCollectionRecord $record, ilDataCollectionField $field)
 
 doUpdate ()
 Update object in database. More...
 
 delete ()
 Delete record field in database. More...
 
 getValue ()
 
 setValue ($value, $omit_parsing=false)
 Set value for record field. More...
 
 setValueFromForm (&$form)
 
 getValueFromExcel ($excel, $row, $col)
 
 fillFormInput (&$form)
 
 getExportValue ()
 
 fillExcelExport ($worksheet, &$row, &$col)
 
 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. More...
 
 doCreate ()
 Creates an Id and a database entry. More...
 
 getFormInput ()
 
 loadValue ()
 Load the value. More...
 

Protected Attributes

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

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented from ilDataCollectionRecordField.

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

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

References ilDataCollectionRecordField\$field, ilDataCollectionRecordField\$record, ilDataCollectionRecordField\getField(), and ilDataCollectionCache\getTableCache().

+ Here is the call graph for this function:

Member Function Documentation

◆ getActionLink()

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

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

126 {
127 global $ilCtrl;
128 switch ($mode) {
129 case 'copy':
130 $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getValue());
131 $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getValue());
132 $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getValue());
133 return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
134 case 'link':
135 return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui','ilobjrootfoldergui'), 'link');
136 default:
137 return '';
138 }
139 }
global $ilCtrl
Definition: ilias.php:18

References $ilCtrl, and ilDataCollectionRecordField\getValue().

+ Here is the call graph for this function:

◆ getExportValue()

ilDataCollectionILIASRefField::getExportValue ( )
Returns
int|string

Reimplemented from ilDataCollectionRecordField.

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

101 {
102 $value = $this->getValue();
104 return $link;
105 }

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

+ Here is the call graph for this function:

◆ getHTML()

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

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

45 {
46 $value = $this->getValue();
47 if (!$value) {
48 return '';
49 }
53 $html = $this->getLinkHTML($title, true);
54 } else if ($this->properties[ilDataCollectionField::PROPERTYID_ILIAS_REFERENCE_LINK]) {
55 $html = $this->getLinkHTML($title);
56 } else {
57 $html = $title;
58 }
59 return $html;
60 }
getLinkHTML($title, $show_action_menu=false)
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
$html
Definition: example_001.php:87

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

+ Here is the call graph for this function:

◆ getLinkHTML()

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

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

83 {
84 global $lng;
85 $link = ilLink::_getStaticLink($this->getValue());
86 if ($show_action_menu) {
87 $list = new ilAdvancedSelectionListGUI();
88 $list->setId('adv_list_copy_link_' . $this->field->getId() . $this->record->getId());
89 $list->setListTitle($title);
91 $list->addItem($lng->txt('view'), 'view', $link);
92 }
93 $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
94 $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
95 return $list->getHTML();
96 } else {
97 return "<a href=\"$link\">$title</a>";
98 }
99 }
User interface class for advanced drop-down selection lists.

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

Referenced by getHTML(), and getSingleHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleHTML()

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

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

64 {
65 $value = $this->getValue();
66 if (!$value) {
67 return '';
68 }
72 return $this->getLinkHTML($title);
73 }
74 return $title;
75 }

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

+ Here is the call graph for this function:

◆ getStatus()

ilDataCollectionILIASRefField::getStatus ( )

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

107 {
108 global $ilDB, $ilUser;
109 $usr_id = $ilUser->getId();
110 $obj_ref = $this->getValue();
111 $obj_id = ilObject2::_lookupObjectId($obj_ref);
112 $query = " SELECT status_changed, status
113 FROM ut_lp_marks
114 WHERE usr_id = ".$usr_id." AND obj_id = ".$obj_id."
115";
116 $result = $ilDB->query($query);
117 return ($result->numRows() == 0)? false:$result->fetchRow(DB_FETCHMODE_OBJECT);
118 }
$result
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
static _lookupObjectId($a_ref_id)
lookup object id
global $ilDB
global $ilUser
Definition: imgupload.php:15

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

+ Here is the call graph for this function:

Field Documentation

◆ $dcl_obj_id

ilDataCollectionILIASRefField::$dcl_obj_id
protected

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

◆ $properties

ilDataCollectionILIASRefField::$properties = array()
protected

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


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