19 declare(strict_types=1);
34 $this->obj_def = $DIC[
'objDefinition'];
35 $this->static_url = $DIC[
'static_url'];
38 public function getHTML(
bool $link =
true, array $options = []): string
46 $html = $object->getTitle() .
' [' .
$ref_id .
']';
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')
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')
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));
77 $this->
factory->dropdown()->standard(
78 array_merge([$this->
factory->link()->standard($this->
lng->txt(
'view'), $link)], $actions)
ilObjectDefinition $obj_def
getField()
Getter shortcut for field.
getHTML(bool $link=true, array $options=[])
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
const PROP_DISPLAY_COPY_LINK_ACTION_MENU
getRecordField()
Get Record Field.
__construct(Container $dic, ilPlugin $plugin)
const PROP_ILIAS_REFERENCE_LINK
ilDclBaseRecordFieldModel $record_field
__construct(ilDclBaseRecordFieldModel $record_field)