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

Class ilDclIliasRecordRepresentation. More...

+ Inheritance diagram for ilDclIliasReferenceRecordRepresentation:
+ Collaboration diagram for ilDclIliasReferenceRecordRepresentation:

Public Member Functions

 getHTML ($link=true)
 
 getSingleHTML (array $options=array(), $link=true)
 Returns data for single record view. More...
 
 getLinkHTML ($title, $show_action_menu=false)
 
- 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

 getActionLink ($mode)
 
- 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

Class ilDclIliasRecordRepresentation.

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 13 of file class.ilDclIliasReferenceRecordRepresentation.php.

Member Function Documentation

◆ getActionLink()

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

Definition at line 85 of file class.ilDclIliasReferenceRecordRepresentation.php.

86 {
87 global $DIC;
88 $ilCtrl = $DIC['ilCtrl'];
89
90 switch ($mode) {
91 case 'copy':
92 $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getRecordField()->getValue());
93 $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getRecordField()->getValue());
94 $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getRecordField()->getValue());
95 return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
96 case 'link':
97 return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui','ilobjrootfoldergui'), 'link');
98 default:
99 return '';
100 }
101 }
global $ilCtrl
Definition: ilias.php:18
global $DIC

References $DIC, $ilCtrl, and ilDclBaseRecordRepresentation\getRecordField().

+ Here is the call graph for this function:

◆ getHTML()

ilDclIliasReferenceRecordRepresentation::getHTML (   $link = true)
Parameters
bool$link
Returns
string

Reimplemented from ilDclBaseRecordRepresentation.

Definition at line 20 of file class.ilDclIliasReferenceRecordRepresentation.php.

20 {
21 $title = $this->getRecordField()->getValueForRepresentation();
22 if (!$title) {
23 return '';
24 }
25 $field = $this->getRecordField()->getField();
26
28 $html = $this->getLinkHTML($title, true);
29 } else if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
30 $html = $this->getLinkHTML($title);
31 } else {
32 $html = $title;
33 }
34 return $html;
35 }
$html
Definition: example_001.php:87

References $html, $title, getLinkHTML(), ilDclBaseRecordRepresentation\getRecordField(), ilDclBaseFieldModel\PROP_DISPLAY_COPY_LINK_ACTION_MENU, and ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK.

+ Here is the call graph for this function:

◆ getLinkHTML()

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

Definition at line 58 of file class.ilDclIliasReferenceRecordRepresentation.php.

58 {
59 global $DIC;
60 $lng = $DIC['lng'];
61 $this->getRecordField();
62 $link = ilLink::_getStaticLink($this->getRecordField()->getValue());
63 if ($show_action_menu) {
64 $field = $this->getRecordField()->getField();
65 $record = $this->getRecordField()->getRecord();
66
67 $list = new ilAdvancedSelectionListGUI();
68 $list->setId('adv_list_copy_link_' . $field->getId() . $record->getId());
69 $list->setListTitle($title);
70 if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
71 $list->addItem($lng->txt('view'), 'view', $link);
72 }
73 $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
74 $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
75 return $list->getHTML();
76 } else {
77 return "<a href=\"$link\">$title</a>";
78 }
79 }
User interface class for advanced drop-down selection lists.

References $DIC, ilDclBaseRecordRepresentation\$lng, $title, ilLink\_getStaticLink(), ilDclBaseRecordRepresentation\getRecordField(), and ilDclBaseFieldModel\PROP_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()

ilDclIliasReferenceRecordRepresentation::getSingleHTML ( array  $options = array(),
  $link = true 
)

Returns data for single record view.

Parameters
array | NULL$options
bool$link
Returns
string

Reimplemented from ilDclBaseRecordRepresentation.

Definition at line 38 of file class.ilDclIliasReferenceRecordRepresentation.php.

39 {
40 $value = $this->getRecordField()->getValue();
41 if (!$value) {
42 return '';
43 }
44 $id = ilObject::_lookupObjId($value);
45 $value = ilObject::_lookupTitle($id);
47 return $this->getLinkHTML($value);
48 }
49 return $value;
50 }
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title

References ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilDclBaseRecordRepresentation\getField(), getLinkHTML(), ilDclBaseRecordRepresentation\getRecordField(), and ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK.

+ Here is the call graph for this function:

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