ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 
 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 84 of file class.ilDclIliasReferenceRecordRepresentation.php.

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

Referenced by getLinkHTML().

85  {
86  global $DIC;
87  $ilCtrl = $DIC['ilCtrl'];
88 
89  switch ($mode) {
90  case 'copy':
91  $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getRecordField()->getValue());
92  $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getRecordField()->getValue());
93  $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getRecordField()->getValue());
94  return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
95  case 'link':
96  return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui','ilobjrootfoldergui'), 'link');
97  default:
98  return '';
99  }
100  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

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

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

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

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  } elseif ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
28  $html = $this->getLinkHTML($title);
29  } else {
30  $html = $title;
31  }
32  return $html;
33  }
$html
Definition: example_001.php:87
+ 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 56 of file class.ilDclIliasReferenceRecordRepresentation.php.

References $DIC, $list, ilDclBaseRecordRepresentation\$lng, $title, ilLink\_getStaticLink(), getActionLink(), ilDclBaseRecordRepresentation\getRecordField(), and ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK.

Referenced by getHTML(), and getSingleHTML().

57  {
58  global $DIC;
59  $lng = $DIC['lng'];
60  $this->getRecordField();
61  $link = ilLink::_getStaticLink($this->getRecordField()->getValue());
62  if ($show_action_menu) {
63  $field = $this->getRecordField()->getField();
64  $record = $this->getRecordField()->getRecord();
65 
67  $list->setId('adv_list_copy_link_' . $field->getId() . $record->getId());
68  $list->setListTitle($title);
69  if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
70  $list->addItem($lng->txt('view'), 'view', $link);
71  }
72  $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
73  $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
74  return $list->getHTML();
75  } else {
76  return "<a href=\"$link\">$title</a>";
77  }
78  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
User interface class for advanced drop-down selection lists.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleHTML()

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

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

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

37  {
38  $value = $this->getRecordField()->getValue();
39  if (!$value) {
40  return '';
41  }
42  $id = ilObject::_lookupObjId($value);
43  $value = ilObject::_lookupTitle($id);
45  return $this->getLinkHTML($value);
46  }
47  return $value;
48  }
if(!array_key_exists('StateId', $_REQUEST)) $id
static _lookupTitle($a_id)
lookup object title
static _lookupObjId($a_id)
+ Here is the call graph for this function:

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