ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilDclIliasReferenceRecordRepresentation Class Reference
+ Inheritance diagram for ilDclIliasReferenceRecordRepresentation:
+ Collaboration diagram for ilDclIliasReferenceRecordRepresentation:

Public Member Functions

 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
- 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)

Reimplemented from ilDclBaseRecordRepresentation.

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

30 {
32 global $DIC;
33
34 $this->obj_def = $DIC['objDefinition'];
35 $this->static_url = $DIC['static_url'];
36 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

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

Outputs html of a certain field.

Reimplemented from ilDclBaseRecordRepresentation.

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

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

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().

+ 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: