ILIAS
release_8 Revision v8.19
◀ 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
n
o
p
r
s
t
u
v
w
x
+
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
j
l
m
p
s
t
u
+
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
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
g
h
i
m
n
p
r
s
t
u
v
x
+
Variables
$
a
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
hasSymbolTrait.php
Go to the documentation of this file.
1
<?php
2
3
declare(strict_types=1);
20
namespace
ILIAS\GlobalScreen\Scope\MainMenu\Factory
;
21
22
use
ILIAS\UI\Component\Symbol\Glyph\Glyph
;
23
use
ILIAS\UI\Component\Symbol\Symbol
;
24
use
ILIAS\UI\Implementation\Component\Symbol\Icon\Icon
;
25
use
LogicException
;
26
31
trait
hasSymbolTrait
32
{
33
protected
?
Symbol
$symbol = null;
34
38
public
function
withSymbol
(
Symbol
$symbol):
hasSymbol
39
{
40
// bugfix mantis 25526: make aria labels mandatory
41
if
(($symbol instanceof
Glyph
&& $symbol->getAriaLabel() ===
""
) ||
42
($symbol instanceof
Icon
&& $symbol->
getLabel
() ===
""
)) {
43
throw
new
LogicException
(
"the symbol's aria label MUST be set to ensure accessibility"
);
44
}
45
46
$clone = clone $this;
47
$clone->symbol = $symbol;
48
49
return
$clone;
50
}
51
55
public
function
getSymbol
():
Symbol
56
{
57
return
$this->symbol;
58
}
59
63
public
function
hasSymbol
(): bool
64
{
65
return
$this->symbol instanceof
Symbol
;
66
}
67
}
LogicException
ILIAS\GlobalScreen\Scope\MainMenu\Factory\getSymbol
getSymbol()
Definition:
hasSymbolTrait.php:55
ILIAS\UI\Component\Symbol\Symbol\getLabel
getLabel()
Get the label of this icon.
Glyph
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:29
Icon
Symbol
hasSymbolTrait
ILIAS\UI\Component\Symbol\Glyph\Glyph
This describes how a glyph could be modified during construction of UI.
Definition:
Glyph.php:30
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:63
ILIAS\UI\Implementation\Component\Symbol\Icon\Icon
Definition:
Icon.php:27
ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol
withSymbol(Symbol $symbol)
Definition:
hasSymbolTrait.php:38
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Interface hasSymbol Methods for Entries with Symbols.
Definition:
hasSymbol.php:32
ILIAS\GlobalScreen\Scope\MainMenu\Factory
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
AbstractBaseItem.php:21
src
GlobalScreen
Scope
MainMenu
Factory
hasSymbolTrait.php
Generated on Tue Apr 1 2025 22:02:45 for ILIAS by
1.8.13 (using
Doxyfile
)