ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclIliasReferenceRecordRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 getHTML (bool $link=true, array $options=[])
 
 getSingleHTML (array $options=null, bool $link=true)
 
 getLinkHTML (string $title, bool $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 (ilPropertyFormGUI $form)
 Fills the form with the value of a record. More...
 
 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
 getSingleHTML (?array $options=null, bool $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 (string $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
ilDclBaseRecordFieldModel $record_field
 
ilLanguage $lng
 
ilAccess $access
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ILIAS UI Renderer $renderer
 
ilObjUser $user
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ getActionLink()

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

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

References $DIC, ilDclBaseRecordRepresentation\getRecordField(), and ILIAS\UI\Implementation\Component\Input\getValue().

Referenced by getLinkHTML().

83  : string
84  {
85  global $DIC;
86  $ilCtrl = $DIC['ilCtrl'];
87 
88  switch ($mode) {
89  case 'copy':
90  $ilCtrl->setParameterByClass('ilobjectcopygui', 'item_ref_id', $this->getRecordField()->getValue());
91  $ilCtrl->setParameterByClass('ilobjrootfoldergui', 'item_ref_id', $this->getRecordField()->getValue());
92  $ilCtrl->setParameterByClass('ilobjectcopygui', 'source_id', $this->getRecordField()->getValue());
93 
94  return $ilCtrl->getLinkTargetByClass('ilobjectcopygui', 'initTargetSelection');
95  case 'link':
96  return $ilCtrl->getLinkTargetByClass(array('ilrepositorygui', 'ilobjrootfoldergui'), 'link');
97  default:
98  return '';
99  }
100  }
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:47
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilDclIliasReferenceRecordRepresentation::getHTML ( bool  $link = true,
array  $options = [] 
)

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

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

21  : string
22  {
23  $title = $this->getRecordField()->getValueForRepresentation();
24  if (!$title) {
25  return '';
26  }
27  $field = $this->getRecordField()->getField();
28 
30  $html = $this->getLinkHTML($title, true);
31  } else {
32  if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
33  $html = $this->getLinkHTML($title);
34  } else {
35  $html = $title;
36  }
37  }
38 
39  return $html;
40  }
+ Here is the call graph for this function:

◆ getLinkHTML()

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

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

References ilDclBaseRecordRepresentation\$lng, ilLink\_getStaticLink(), getActionLink(), ilDclBaseRecordRepresentation\getRecordField(), ILIAS\UI\Implementation\Component\Input\getValue(), ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK, and ilLanguage\txt().

Referenced by getHTML(), and getSingleHTML().

57  : string
58  {
59  $lng = $this->lng;
60  $link = ilLink::_getStaticLink($this->getRecordField()->getValue());
61  if ($show_action_menu) {
62  $field = $this->getRecordField()->getField();
63  $record = $this->getRecordField()->getRecord();
64 
65  $list = new ilAdvancedSelectionListGUI();
66  $list->setId('adv_list_copy_link_' . $field->getId() . $record->getId());
67  $list->setListTitle($title);
68  if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
69  $list->addItem($lng->txt('view'), 'view', $link);
70  }
71  $list->addItem($lng->txt('copy'), 'copy', $this->getActionLink('copy'));
72  $list->addItem($lng->txt('link'), 'link', $this->getActionLink('link'));
73 
74  return $list->getHTML();
75  } else {
76  return "<a href=\"$link\">$title</a>";
77  }
78  }
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleHTML()

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

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

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

42  : string
43  {
44  $value = $this->getRecordField()->getValue();
45  if (!$value) {
46  return '';
47  }
48  $id = ilObject::_lookupObjId($value);
49  $value = ilObject::_lookupTitle($id);
51  return $this->getLinkHTML($value);
52  }
53 
54  return $value;
55  }
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

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