ILIAS
release_8 Revision v8.24
◀ ilDoc Overview
class.ilDclLinkButton.php
Go to the documentation of this file.
1
<?php
2
19
class
ilDclLinkButton
extends
ilLinkButton
20
{
21
public
const
TYPE_DATACOLLECTION_LINK
= 99;
22
protected
array
$attributes
;
23
protected
bool
$useWrapper
=
false
;
24
25
public
function
isUseWrapper
(): bool
26
{
27
return
$this->useWrapper
;
28
}
29
30
public
function
setUseWrapper
(
bool
$useWrapper
): void
31
{
32
$this->useWrapper =
$useWrapper
;
33
}
34
35
public
static
function
getInstance
(): self
36
{
37
return
new
self
(
self::TYPE_DATACOLLECTION_LINK
);
38
}
39
40
protected
function
prepareRender
(): void
41
{
42
parent::prepareRender();
43
44
$this->
addAttribute
(
'href'
, ($this->
getUrl
() ?:
"#"
));
45
$this->
addAttribute
(
'target'
, $this->
getTarget
());
46
}
47
48
public
function
render
(): string
49
{
50
$this->
prepareRender
();
51
52
$output =
''
;
53
if
($this->useWrapper) {
54
$output .=
'<div'
. $this->
renderAttributesHelper
($this->attributes[
'wrapper'
]) .
'>'
;
55
}
56
57
$output .=
'<a'
. $this->
renderAttributes
($this->attributes[
'default'
]) .
'>'
. $this->
renderCaption
() .
'</a>'
;
58
59
if
($this->useWrapper) {
60
$output .=
'</div>'
;
61
}
62
63
return
$output;
64
}
65
66
public
function
addAttribute
(
string
$key
,
string
$value,
bool
$wrapper =
false
): void
67
{
68
$this->attributes[$this->
getGroupKey
($wrapper)][
$key
] = $value;
69
}
70
71
public
function
removeAttribute
(
string
$key
, $wrapper =
false
): bool
72
{
73
if
(isset($this->attributes[$this->
getGroupKey
($wrapper)][
$key
])) {
74
unset($this->attributes[$this->
getGroupKey
($wrapper)][
$key
]);
75
76
return
true
;
77
}
78
79
return
false
;
80
}
81
82
public
function
getAttribute
(
string
$key
,
bool
$wrapper =
false
): ?string
83
{
84
if
(isset($this->attributes[$this->
getGroupKey
($wrapper)][
$key
])) {
85
return
$this->attributes[$this->
getGroupKey
($wrapper)][
$key
];
86
}
87
88
return
null
;
89
}
90
91
protected
function
getGroupKey
($wrapper): string
92
{
93
return
($wrapper) ?
'wrapper'
:
'default'
;
94
}
95
}
ilButtonBase\renderAttributesHelper
renderAttributesHelper(array $a_attr)
Definition:
class.ilButtonBase.php:176
ilDclLinkButton
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilDclLinkButton.php:20
ilDclLinkButton\render
render()
Definition:
class.ilDclLinkButton.php:48
ilDclLinkButton\removeAttribute
removeAttribute(string $key, $wrapper=false)
Definition:
class.ilDclLinkButton.php:71
ilDclLinkButton\$useWrapper
bool $useWrapper
Definition:
class.ilDclLinkButton.php:23
ilDclLinkButton\isUseWrapper
isUseWrapper()
Definition:
class.ilDclLinkButton.php:25
ilDclLinkButton\getInstance
static getInstance()
Definition:
class.ilDclLinkButton.php:35
ilDclLinkButton\getAttribute
getAttribute(string $key, bool $wrapper=false)
Definition:
class.ilDclLinkButton.php:82
ilDclLinkButton\addAttribute
addAttribute(string $key, string $value, bool $wrapper=false)
Definition:
class.ilDclLinkButton.php:66
ilDclLinkButton\prepareRender
prepareRender()
Definition:
class.ilDclLinkButton.php:40
ilDclLinkButton\TYPE_DATACOLLECTION_LINK
const TYPE_DATACOLLECTION_LINK
Definition:
class.ilDclLinkButton.php:21
ilDclLinkButton\getGroupKey
getGroupKey($wrapper)
Definition:
class.ilDclLinkButton.php:91
ilDclLinkButton\setUseWrapper
setUseWrapper(bool $useWrapper)
Definition:
class.ilDclLinkButton.php:30
ilDclLinkButton\$attributes
array $attributes
Definition:
class.ilDclLinkButton.php:22
ilLinkButton
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
class.ilLinkButton.php:26
ilLinkButton\getTarget
getTarget()
Definition:
class.ilLinkButton.php:55
ilLinkButton\renderCaption
renderCaption()
Definition:
class.ilLinkButton.php:65
ilLinkButton\getUrl
getUrl()
Definition:
class.ilLinkButton.php:45
ilLinkButton\renderAttributes
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.
Definition:
class.ilLinkButton.php:70
ILIAS\LTI\ToolProvider\$key
string $key
Consumer key/client ID value.
Definition:
System.php:193
Modules
DataCollection
classes
Helpers
class.ilDclLinkButton.php
Generated on Sun Nov 2 2025 22:01:08 for ILIAS by
1.9.4 (using
Doxyfile
)