ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
s
t
w
+
Functions
_
a
b
c
f
g
h
i
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
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
+
Files
File List
+
Globals
+
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
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
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
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
LinkList.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\hasSymbol
;
5
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
;
6
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
7
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isChild
;
8
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
;
9
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItemTrait
;
10
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\supportsAsynchronousLoading
;
11
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\SymbolDecoratorTrait
;
12
use
InvalidArgumentException
;
13
18
class
LinkList
extends
AbstractChildItem
implements
hasTitle
,
supportsAsynchronousLoading
,
hasSymbol
,
isInterchangeableItem
19
{
20
use
SymbolDecoratorTrait
;
21
use
hasSymbolTrait
;
22
use
isInterchangeableItemTrait
;
23
27
protected
$title
=
''
;
31
protected
$links
;
35
protected
$supports_async_loading
=
false
;
36
41
public
function
withTitle
(
string
$title
) :
hasTitle
42
{
43
$clone = clone($this);
44
$clone->title =
$title
;
45
46
return
$clone;
47
}
48
52
public
function
getTitle
() : string
53
{
54
return
$this->title
;
55
}
56
61
public
function
withLinks
(
$links
) :
LinkList
62
{
63
if
(is_callable(
$links
)) {
64
try
{
65
$r = new \ReflectionFunction(
$links
);
66
if
($r->isGenerator()) {
67
$links
= iterator_to_array(
$links
());
68
}
else
{
69
$links
=
$links
();
70
}
71
}
catch
(\ReflectionException
$e
) {
72
$links
=
false
;
73
}
74
75
if
(!is_array(
$links
)) {
76
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
77
}
78
}
79
foreach
(
$links
as $link) {
80
if
(!$link instanceof
Link
) {
81
throw
new
InvalidArgumentException
(
"withLinks only accepts arrays of Links or a callable providing them"
);
82
}
83
}
84
$clone = clone($this);
85
$clone->links =
$links
;
86
87
return
$clone;
88
}
89
93
public
function
getLinks
() : array
94
{
95
return
$this->links
;
96
}
97
101
public
function
withSupportsAsynchronousLoading
(
bool
$supported) :
supportsAsynchronousLoading
102
{
103
$clone = clone($this);
104
$clone->supports_async_loading = $supported;
105
106
return
$clone;
107
}
108
112
public
function
supportsAsynchronousLoading
() : bool
113
{
114
return
$this->supports_async_loading
;
115
}
116
117
public
function
isVisible
() : bool
118
{
119
$visible_links = 0;
120
foreach
($this->
getLinks
() as $link) {
121
if
($link->isVisible()) {
122
$visible_links++;
123
}
124
}
125
return
$visible_links > 0 && parent::isVisible();
126
}
127
128
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$links
$links
Definition:
LinkList.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
Definition:
isInterchangeableItem.php:8
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getTitle
getTitle()
Definition:
LinkList.php:52
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\supportsAsynchronousLoading
supportsAsynchronousLoading()
Definition:
LinkList.php:112
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item
Definition:
Complex.php:1
isInterchangeableItemTrait
isInterchangeableItemTrait
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$title
$title
Definition:
LinkList.php:27
isChild
Vendor\Package\$e
$e
Definition:
example_cleaned.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withLinks
withLinks($links)
Definition:
LinkList.php:61
supportsAsynchronousLoading
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:8
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:44
ILIAS\GlobalScreen\Scope\MainMenu\Factory\supportsAsynchronousLoading
Interface supportsAsynchronousLoading.
Definition:
supportsAsynchronousLoading.php:10
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withTitle
withTitle(string $title)
Definition:
LinkList.php:41
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\getLinks
getLinks()
Definition:
LinkList.php:93
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Interface hasSymbol Methods for Entries with Symbols.
Definition:
hasSymbol.php:11
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\Link
Class Link Attention: This is not the same as the .
Definition:
Link.php:19
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\isVisible
isVisible()
Definition:
LinkList.php:117
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\withSupportsAsynchronousLoading
withSupportsAsynchronousLoading(bool $supported)
Definition:
LinkList.php:101
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbolTrait
trait hasSymbolTrait
Trait hasSymbolTrait.
Definition:
hasSymbolTrait.php:10
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList\$supports_async_loading
$supports_async_loading
Definition:
LinkList.php:35
ILIAS\GlobalScreen\Scope\MainMenu\Factory\Item\LinkList
Definition:
LinkList.php:18
InvalidArgumentException
hasTitle
AbstractChildItem
ILIAS\GlobalScreen\Scope\MainMenu\Factory\SymbolDecoratorTrait
trait SymbolDecoratorTrait
Definition:
SymbolDecoratorTrait.php:18
ILIAS\GlobalScreen\Scope\MainMenu\Factory\AbstractChildItem
Class AbstractBaseItem.
Definition:
AbstractChildItem.php:10
isInterchangeableItem
src
GlobalScreen
Scope
MainMenu
Factory
Item
LinkList.php
Generated on Wed Apr 23 2025 20:01:25 for ILIAS by
1.8.13 (using
Doxyfile
)