ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilDclIliasReferenceRecordRepresentation Class Reference
+ 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
ILIAS UI Factory $factory
 
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

Member Function Documentation

◆ getActionLink()

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

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

References ILIAS\Repository\ctrl(), ilDclBaseRecordRepresentation\getRecordField(), and ILIAS\UI\Implementation\Component\Input\getValue().

Referenced by getLinkHTML().

89  : string
90  {
91  switch ($mode) {
92  case 'copy':
93  $this->ctrl->setParameterByClass(ilObjectCopyGUI::class, 'item_ref_id', $this->getRecordField()->getValue());
94  $this->ctrl->setParameterByClass(ilObjRootFolderGUI::class, 'item_ref_id', $this->getRecordField()->getValue());
95  $this->ctrl->setParameterByClass(ilObjectCopyGUI::class, 'source_id', $this->getRecordField()->getValue());
96 
97  return $this->ctrl->getLinkTargetByClass(ilObjectCopyGUI::class, 'initTargetSelection');
98  case 'link':
99  return $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjRootFolderGUI::class], 'link');
100  default:
101  return '';
102  }
103  }
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:49
+ 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 23 of file class.ilDclIliasReferenceRecordRepresentation.php.

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

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

◆ getLinkHTML()

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

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

References ilLink\_getStaticLink(), factory(), getActionLink(), ilDclBaseRecordRepresentation\getRecordField(), ILIAS\UI\Implementation\Component\Input\getValue(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK, and renderer().

Referenced by getHTML(), and getSingleHTML().

59  : string
60  {
61  $link = ilLink::_getStaticLink($this->getRecordField()->getValue());
62  if ($show_action_menu) {
63  $field = $this->getRecordField()->getField();
64  $dropdown_items = [];
65  if ($field->getProperty(ilDclBaseFieldModel::PROP_ILIAS_REFERENCE_LINK)) {
66  $dropdown_items[] = $this->factory->link()->standard(
67  $this->lng->txt('view'),
68  $link
69  );
70  }
71  $dropdown_items[] = $this->factory->link()->standard(
72  $this->lng->txt('link'),
73  $this->getActionLink('link')
74  );
75  $dropdown_items[] = $this->factory->link()->standard(
76  $this->lng->txt('copy'),
77  $this->getActionLink('copy')
78  );
79  $dropdown = $this->factory->dropdown()->standard($dropdown_items)->withLabel($title);
80  return $this->renderer->render($dropdown);
81  } else {
82  return $this->renderer->render($this->factory->link()->standard($title, $link));
83  }
84  }
getValue()
Get the value that is displayed in the input client side.
Definition: Group.php:49
factory()
renderer()
+ 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 44 of file class.ilDclIliasReferenceRecordRepresentation.php.

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

44  : string
45  {
46  $value = $this->getRecordField()->getValue();
47  if (!$value) {
48  return '';
49  }
50  $id = ilObject::_lookupObjId($value);
51  $value = ilObject::_lookupTitle($id);
53  return $this->getLinkHTML($value);
54  }
55 
56  return $value;
57  }
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: