ILIAS  release_7 Revision v7.30-3-g800a261c036
ilDclIliasReferenceRecordRepresentation Class Reference

Class ilDclIliasRecordRepresentation. More...

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

Public Member Functions

 getHTML ($link=true)
 
 getSingleHTML (array $options=null, $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 9 of file class.ilDclIliasReferenceRecordRepresentation.php.

Member Function Documentation

◆ getActionLink()

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

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

93 {
94 global $DIC;
95 $ilCtrl = $DIC['ilCtrl'];
96
97 switch ($mode) {
98 case 'copy':
99 $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getRecordField()->getValue());
100 $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getRecordField()->getValue());
101 $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getRecordField()->getValue());
102
103 return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
104 case 'link':
105 return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjrootfoldergui'), 'link');
106 default:
107 return '';
108 }
109 }
global $DIC
Definition: goto.php:24

References $DIC, 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 17 of file class.ilDclIliasReferenceRecordRepresentation.php.

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

References 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 61 of file class.ilDclIliasReferenceRecordRepresentation.php.

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

References $DIC, ilDclBaseRecordRepresentation\$lng, 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 = null,
  $link = true 
)

Returns data for single record view.

Parameters
array | NULL$options
bool$link
Returns
string

Reimplemented from ilDclBaseRecordRepresentation.

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

40 {
41 $value = $this->getRecordField()->getValue();
42 if (!$value) {
43 return '';
44 }
45 $id = ilObject::_lookupObjId($value);
46 $value = ilObject::_lookupTitle($id);
48 return $this->getLinkHTML($value);
49 }
50
51 return $value;
52 }
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: