ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ilDclIliasReferenceRecordRepresentation Class Reference
+ Inheritance diagram for ilDclIliasReferenceRecordRepresentation:
+ Collaboration diagram for ilDclIliasReferenceRecordRepresentation:

Public Member Functions

 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getHTML (bool $link=true, array $options=[])
 
- 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...
 

Private Attributes

ilObjectDefinition $obj_def
 
Services $static_url
 

Additional Inherited Members

- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilDclIliasReferenceRecordRepresentation::__construct ( ilDclBaseRecordFieldModel  $record_field)

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

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

30  {
31  parent::__construct($record_field);
32  global $DIC;
33 
34  $this->obj_def = $DIC['objDefinition'];
35  $this->static_url = $DIC['static_url'];
36  }
global $DIC
Definition: shib_login.php:26
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

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

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

References $ref_id, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), factory(), ilDclBaseRecordRepresentation\getField(), ilObjectFactory\getInstanceByRefId(), ilDclBaseRecordRepresentation\getRecordField(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilDclBaseFieldModel\PROP_DISPLAY_COPY_LINK_ACTION_MENU, ilDclBaseFieldModel\PROP_ILIAS_REFERENCE_LINK, and renderer().

38  : string
39  {
40  $ref_id = (int) $this->getRecordField()->getValue();
41  if ($ref_id === 0) {
42  return '';
43  }
44 
46  $html = $object->getTitle() . ' [' . $ref_id . ']';
47 
48  $actions = [];
49  if (
51  ) {
52  if ($this->access->checkAccess('delete', '', $ref_id) && $this->obj_def->allowLink($object->getType())) {
53  $this->ctrl->setParameterByClass(ilRepositoryGUI::class, 'item_ref_id', $ref_id);
54  $actions[] = $this->factory->link()->standard(
55  $this->lng->txt('link'),
56  $this->ctrl->getLinkTargetByClass([ilRepositoryGUI::class, ilObjRootFolderGUI::class], 'link')
57  );
58  }
59  if ($this->access->checkAccess('copy', '', $ref_id) && $this->obj_def->allowCopy($object->getType())) {
60  $this->ctrl->setParameterByClass(ilObjectCopyGUI::class, 'source_id', $ref_id);
61  $actions[] = $this->factory->link()->standard(
62  $this->lng->txt('copy'),
63  $this->ctrl->getLinkTargetByClass(ilObjectCopyGUI::class, 'initTargetSelection')
64  );
65  }
66  }
67 
68  if (
70  $this->access->checkAccess('read', '', $ref_id)
71  ) {
72  $link = (string) $this->static_url->builder()->build($object->getType(), new ReferenceId($ref_id));
73  if ($actions === []) {
74  $html = $this->renderer->render($this->factory->link()->standard($html, $link));
75  } else {
76  $html = $this->renderer->render(
77  $this->factory->dropdown()->standard(
78  array_merge([$this->factory->link()->standard($this->lng->txt('view'), $link)], $actions)
79  )->withLabel($html)
80  );
81  }
82  }
83 
84  return $html;
85  }
factory()
renderer()
$ref_id
Definition: ltiauth.php:65
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

Field Documentation

◆ $obj_def

ilObjectDefinition ilDclIliasReferenceRecordRepresentation::$obj_def
private

◆ $static_url

Services ilDclIliasReferenceRecordRepresentation::$static_url
private

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