ILIAS
trunk Revision v12.0_alpha-1227-g7ff6d300864
◀ ilDoc Overview
TreeTool.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\GlobalScreen\Scope\Tool\Factory
;
22
23
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
;
24
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
25
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isTopItem
;
26
use
ILIAS\UI\Component\Symbol\Glyph
;
27
use
ILIAS\UI\Component\Symbol\Icon
;
28
use
ILIAS\UI\Component\Symbol\Symbol
;
29
use
ILIAS\UI\Component\Tree\Tree
;
30
use LogicException;
31
use
ILIAS\GlobalScreen\Scope\isDecorateable
;
32
use
ILIAS\GlobalScreen\Scope\ComponentDecoratorTrait
;
33
37
class
TreeTool
extends
AbstractBaseTool
implements
isTopItem
,
hasSymbol
,
isToolItem
,
isDecorateable
38
{
39
use
ComponentDecoratorTrait
;
40
41
protected
?
Symbol
$symbol
=
null
;
42
protected
Tree
$tree
;
43
protected
string
$title
;
44
45
public
function
withTitle
(
string
$title
):
hasTitle
46
{
47
$clone = clone($this);
48
$clone->title =
$title
;
49
50
return
$clone;
51
}
52
53
public
function
getTitle
(): string
54
{
55
return
$this->title
;
56
}
57
58
public
function
withSymbol
(
Symbol
$symbol
):
hasSymbol
59
{
60
// bugfix mantis 25526: make aria labels mandatory
61
if
((
$symbol
instanceof
Glyph
\
Glyph
&&
$symbol
->getAriaLabel() ===
""
) ||
62
(
$symbol
instanceof
Icon
\
Icon
&&
$symbol
->
getLabel
() ===
""
)) {
63
throw
new
LogicException(
"the symbol's aria label MUST be set to ensure accessibility"
);
64
}
65
66
$clone = clone($this);
67
$clone->symbol =
$symbol
;
68
69
return
$clone;
70
}
71
72
public
function
withTree
(
Tree
$tree
): self
73
{
74
$clone = clone($this);
75
$clone->tree =
$tree
;
76
77
return
$clone;
78
}
79
80
public
function
getTree
():
Tree
81
{
82
return
$this->tree
;
83
}
84
85
public
function
getSymbol
():
Symbol
86
{
87
return
$this->symbol
;
88
}
89
90
public
function
hasSymbol
(): bool
91
{
92
return
($this->
symbol
instanceof
Symbol
);
93
}
94
}
ILIAS\GlobalScreen\Scope\Tool\Factory\AbstractBaseTool
Definition:
AbstractBaseTool.php:30
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool
Definition:
TreeTool.php:38
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\$title
string $title
Definition:
TreeTool.php:43
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\hasSymbol
hasSymbol()
Definition:
TreeTool.php:90
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\getTitle
getTitle()
Definition:
TreeTool.php:53
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\getSymbol
getSymbol()
Definition:
TreeTool.php:85
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\$symbol
Symbol $symbol
Definition:
TreeTool.php:41
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\withTree
withTree(Tree $tree)
Definition:
TreeTool.php:72
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\$tree
Tree $tree
Definition:
TreeTool.php:42
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\getTree
getTree()
Definition:
TreeTool.php:80
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\withTitle
withTitle(string $title)
Definition:
TreeTool.php:45
ILIAS\GlobalScreen\Scope\Tool\Factory\TreeTool\withSymbol
withSymbol(Symbol $symbol)
Definition:
TreeTool.php:58
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Definition:
hasSymbol.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:28
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isTopItem
Interface TopIs.
Definition:
isTopItem.php:28
ILIAS\GlobalScreen\Scope\Tool\Factory\isToolItem
Interface isToolItem.
Definition:
isToolItem.php:33
ILIAS\GlobalScreen\Scope\isDecorateable
Definition:
isDecorateable.php:30
ILIAS\UI\Component\Symbol\Glyph\Glyph
Definition:
Glyph.php:27
ILIAS\UI\Component\Symbol\Icon\Icon
This describes how an icon could be modified during construction of UI.
Definition:
Icon.php:29
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:30
ILIAS\UI\Component\Symbol\Symbol\getLabel
getLabel()
Get the label of this icon.
ILIAS\UI\Component\Tree\Tree
This describes a Tree Control.
Definition:
Tree.php:29
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
@inheritDoc
Definition:
hasSymbolTrait.php:64
ILIAS\GlobalScreen\Scope\Tool\Factory
Definition:
AbstractBaseTool.php:21
ILIAS\GlobalScreen\Scope\ComponentDecoratorTrait
trait ComponentDecoratorTrait
Definition:
ComponentDecoratorTrait.php:32
ILIAS\Repository\symbol
symbol()
Definition:
trait.GlobalDICGUIServices.php:215
ILIAS\UI\Component\Symbol\Glyph
Definition:
Factory.php:21
ILIAS\UI\Component\Symbol\Icon
Definition:
Custom.php:21
components
ILIAS
GlobalScreen
src
Scope
Tool
Factory
TreeTool.php
Generated on Wed Apr 8 2026 23:04:54 for ILIAS by
1.9.4 (using
Doxyfile
)