ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
hasSymbolTrait.php
Go to the documentation of this file.
1
<?php
2
19
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
Standard
Symbol
null
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Definition:
shib_logout.php:144
hasSymbolTrait
ILIAS\UI\Component\Symbol\Glyph\Glyph
Definition:
Glyph.php:28
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:63
ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol
withSymbol(Symbol $symbol)
Definition:
hasSymbolTrait.php:38
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Definition:
hasSymbol.php:30
ILIAS\Repository\symbol
symbol()
Definition:
trait.GlobalDICGUIServices.php:216
ILIAS\GlobalScreen\Scope\MainMenu\Factory
Definition:
AbstractBaseItem.php:21
components
ILIAS
GlobalScreen
src
Scope
MainMenu
Factory
hasSymbolTrait.php
Generated on Sun Aug 31 2025 23:03:03 for ILIAS by
1.8.13 (using
Doxyfile
)