ILIAS
trunk Revision v11.0_alpha-1723-g8e69f309bab
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
c
e
g
h
j
l
m
p
s
t
u
v
+
Enumerations
a
c
e
f
i
j
l
m
n
o
p
r
s
t
u
v
z
+
Enumerator
a
c
d
e
f
g
i
l
m
n
o
p
q
s
t
u
v
y
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Ö
Enumerations
Enumerator
+
Files
File List
+
Globals
+
All
$
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
+
Functions
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
u
v
+
Variables
$
a
c
e
g
h
i
m
n
o
p
r
s
t
u
v
z
Enumerations
Enumerator
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Modules
Pages
LinkList.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
;
22
23
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
;
24
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
;
25
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
;
26
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
27
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild
;
28
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
;
29
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItemTrait
;
30
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\supportsAsynchronousLoading
;
31
use
InvalidArgumentException
;
32
use
ReflectionFunction
;
33
use
ReflectionException
;
34
use
Generator
;
35
39
class
LinkList
extends
AbstractChildItem
implements
40
hasTitle
,
41
supportsAsynchronousLoading
,
42
hasSymbol
,
43
isInterchangeableItem
,
44
isChild
45
{
46
use
hasSymbolTrait
;
47
use
isInterchangeableItemTrait
;
48
49
protected
string
$title
=
''
;
53
protected
array
$links
= [];
54
protected
bool
$supports_async_loading
=
false
;
55
60
public
function
withTitle
(
string
$title):
hasTitle
61
{
62
$clone = clone($this);
63
$clone->title =
$title
;
64
65
return
$clone;
66
}
67
71
public
function
getTitle
(): string
72
{
73
return
$this->title
;
74
}
75
79
public
function
withLinks
($links): self
80
{
81
if
(is_callable($links)) {
82
try
{
83
$r
=
new
ReflectionFunction
($links);
84
$links =
$r
->isGenerator() ? iterator_to_array(
$links
()) :
$links
();
85
}
catch
(
ReflectionException
) {
86
$links =
false
;
87
}
88
89
if
(!is_array($links)) {
90
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
91
}
92
}
93
foreach
($links as $link) {
94
if
(!$link instanceof
Link
) {
95
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
96
}
97
}
98
$clone = clone($this);
99
$clone->links =
$links
;
100
101
return
$clone;
102
}
103
107
public
function
getLinks
(): array
108
{
109
return
$this->links
;
110
}
111
115
public
function
withSupportsAsynchronousLoading
(
bool
$supported):
supportsAsynchronousLoading
116
{
117
$clone = clone($this);
118
$clone->supports_async_loading = $supported;
119
120
return
$clone;
121
}
122
126
public
function
supportsAsynchronousLoading
(): bool
127
{
128
return
$this->supports_async_loading
;
129
}
130
131
public
function
isVisible
(): bool
132
{
133
$visible_links = 0;
134
foreach
($this->
getLinks
() as $link) {
135
if
($link->isVisible()) {
136
$visible_links++;
137
}
138
}
139
return
$visible_links > 0 &&
parent::isVisible
();
140
}
141
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
Definition:
isInterchangeableItem.php:27
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getTitle
getTitle()
Definition:
LinkList.php:71
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\supportsAsynchronousLoading
supportsAsynchronousLoading()
Definition:
LinkList.php:126
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
Definition:
Complex.php:21
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$links
array $links
Definition:
LinkList.php:53
isInterchangeableItemTrait
isInterchangeableItemTrait
isChild
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild
Interface isChild.
Definition:
isChild.php:28
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withLinks
withLinks($links)
Definition:
LinkList.php:79
supportsAsynchronousLoading
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:26
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$supports_async_loading
bool $supports_async_loading
Definition:
LinkList.php:54
ILIAS\GlobalScreen\Scope\isVisible
isVisible()
Definition:
VisibilityAvailabilityTrait.php:44
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:63
Standard
ILIAS\GlobalScreen\Scope\MainMenu\Factory\supportsAsynchronousLoading
Interface supportsAsynchronousLoading Types, which implement this interface, can load their content a...
Definition:
supportsAsynchronousLoading.php:27
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withTitle
withTitle(string $title)
Definition:
LinkList.php:60
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getLinks
getLinks()
Definition:
LinkList.php:107
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Definition:
hasSymbol.php:30
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\isVisible
isVisible()
Definition:
LinkList.php:131
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withSupportsAsynchronousLoading
withSupportsAsynchronousLoading(bool $supported)
Definition:
LinkList.php:115
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
trait hasSymbolTrait
Trait hasSymbolTrait.
Definition:
hasSymbolTrait.php:32
Generator
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList
Definition:
LinkList.php:39
InvalidArgumentException
hasTitle
AbstractChildItem
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
Class AbstractBaseItem.
Definition:
AbstractChildItem.php:29
ReflectionException
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$title
string $title
Definition:
LinkList.php:49
ReflectionFunction
isInterchangeableItem
$r
$r
Definition:
shib_logout.php:140
components
ILIAS
GlobalScreen
src
Scope
MainMenu
Factory
Item
LinkList.php
Generated on Sun Apr 6 2025 23:03:21 for ILIAS by
1.8.13 (using
Doxyfile
)