ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
RepositoryLink.php
Go to the documentation of this file.
1
<?
php
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
;
2
3
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
;
4
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasAction
;
5
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
6
use
ilLink
;
7
use
ilObject2
;
8
17
class
RepositoryLink
extends
AbstractChildItem
implements
hasTitle
,
hasAction
18
{
19
23
protected
$ref_id
= 0;
27
protected
$alt_text
;
31
protected
$title
=
''
;
32
33
39
public
function
withTitle
(
string
$title
) :
hasTitle
40
{
41
$clone = clone($this);
42
$clone->title =
$title
;
43
44
return
$clone;
45
}
46
47
51
public
function
getTitle
() : string
52
{
53
return
$this->title !== null ? $this->title : ($this->
getRefId
() > 0 ?
ilObject2::_lookupTitle
(
ilObject2::_lookupObjectId
($this->
getRefId
())) :
""
);
54
}
55
56
62
public
function
withAltText
(
string
$alt_text
) :
RepositoryLink
63
{
64
$clone = clone($this);
65
$clone->alt_text =
$alt_text
;
66
67
return
$clone;
68
}
69
70
74
public
function
getAltText
() : string
75
{
76
return
$this->alt_text
;
77
}
78
79
83
final
public
function
getAction
() : string
84
{
85
return
ilLink::_getLink
($this->ref_id);
86
}
87
88
94
public
function
withAction
(
string
$action
) :
hasAction
95
{
96
$clone = clone $this;
97
$clone->ref_id = (int) $action;
98
99
return
$clone;
100
}
101
102
108
public
function
withRefId
(
int
$ref_id
) :
RepositoryLink
109
{
110
$clone = clone $this;
111
$clone->ref_id =
$ref_id
;
112
113
return
$clone;
114
}
115
116
120
public
function
getRefId
() : int
121
{
122
return
$this->ref_id
;
123
}
124
125
129
public
function
withIsLinkToExternalAction
(
bool
$is_external) :
hasAction
130
{
131
throw
new \LogicException(
"Repository-Links are always internal"
);
132
}
133
134
138
public
function
isLinkWithExternalAction
() : bool
139
{
140
return
false
;
141
}
142
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$ref_id
$ref_id
Definition:
RepositoryLink.php:23
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withRefId
withRefId(int $ref_id)
Definition:
RepositoryLink.php:108
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getTitle
getTitle()
Definition:
RepositoryLink.php:51
ilObject2\_lookupTitle
static _lookupTitle($a_id)
Definition:
class.ilObject2.php:255
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
Definition:
Complex.php:1
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$title
$title
Definition:
RepositoryLink.php:31
$action
$action
Definition:
consentAdmin.php:140
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\$alt_text
$alt_text
Definition:
RepositoryLink.php:27
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withIsLinkToExternalAction
withIsLinkToExternalAction(bool $is_external)
Definition:
RepositoryLink.php:129
ilObject2\_lookupObjectId
static _lookupObjectId($a_ref_id)
Definition:
class.ilObject2.php:319
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\isLinkWithExternalAction
isLinkWithExternalAction()
Definition:
RepositoryLink.php:138
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink
Class Link.
Definition:
RepositoryLink.php:17
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getAction
getAction()
Definition:
RepositoryLink.php:83
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:8
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withTitle
withTitle(string $title)
Definition:
RepositoryLink.php:39
hasAction
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getRefId
getRefId()
Definition:
RepositoryLink.php:120
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withAltText
withAltText(string $alt_text)
Definition:
RepositoryLink.php:62
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\getAltText
getAltText()
Definition:
RepositoryLink.php:74
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasAction
Interface hasAction.
Definition:
hasAction.php:8
ilObject2
ilLink
php
hasTitle
AbstractChildItem
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
Class AbstractBaseItem.
Definition:
AbstractChildItem.php:11
ilLink\_getLink
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Definition:
class.ilLink.php:17
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\RepositoryLink\withAction
withAction(string $action)
Definition:
RepositoryLink.php:94
src
GlobalScreen
Scope
MainMenu
Factory
Item
RepositoryLink.php
Generated on Thu Jan 16 2025 19:02:37 for ILIAS by
1.8.13 (using
Doxyfile
)