ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ ilDoc Overview
Tool.php
Go to the documentation of this file.
1
<?php declare(strict_types=1);
2
3
namespace
ILIAS\GlobalScreen\Scope\Tool\Factory
;
4
5
use
Closure
;
6
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasContent
;
7
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
;
8
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
;
9
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isTopItem
;
10
use
ILIAS\UI\Component\Component
;
11
use
ILIAS\UI\Component\Symbol\Glyph
;
12
use
ILIAS\UI\Component\Symbol\Icon
;
13
use
ILIAS\UI\Component\Symbol\Symbol
;
14
19
class
Tool
extends
AbstractBaseTool
implements
isTopItem
,
hasContent
,
supportsTerminating
20
{
21
25
protected
$terminated_callback
;
29
protected
$symbol
;
33
protected
$content
;
37
protected
$content_wrapper
;
41
protected
$title
;
45
protected
$close_callback
;
46
51
public
function
withTitle
(
string
$title
) :
hasTitle
52
{
53
$clone = clone($this);
54
$clone->title =
$title
;
55
56
return
$clone;
57
}
58
62
public
function
getTitle
() : string
63
{
64
return
$this->title
;
65
}
66
70
public
function
withContentWrapper
(
Closure
$content_wrapper
) :
hasContent
71
{
72
$clone = clone($this);
73
$clone->content_wrapper =
$content_wrapper
;
74
75
return
$clone;
76
}
77
81
public
function
withContent
(
Component
$ui_component) :
hasContent
82
{
83
$clone = clone($this);
84
$clone->content = $ui_component;
85
86
return
$clone;
87
}
88
92
public
function
getContent
() :
Component
93
{
94
if
($this->content_wrapper !== null) {
95
$wrapper =
$this->content_wrapper
;
96
97
return
$wrapper();
98
}
99
100
return
$this->content
;
101
}
102
106
public
function
withSymbol
(
Symbol
$symbol
) :
hasSymbol
107
{
108
// bugfix mantis 25526: make aria labels mandatory
109
if
(($symbol instanceof
Icon
\
Icon
|| $symbol instanceof
Glyph
\
Glyph
)
110
&& ($symbol->getAriaLabel() ===
""
)
111
) {
112
throw
new \LogicException(
"the symbol's aria label MUST be set to ensure accessibility"
);
113
}
114
115
$clone = clone($this);
116
$clone->symbol =
$symbol
;
117
118
return
$clone;
119
}
120
124
public
function
getSymbol
() :
Symbol
125
{
126
return
$this->symbol
;
127
}
128
132
public
function
hasSymbol
() : bool
133
{
134
return
($this->symbol instanceof
Symbol
);
135
}
136
140
public
function
withTerminatedCallback
(
Closure
$callback) :
supportsTerminating
141
{
142
$clone = clone $this;
143
$clone->terminated_callback = $callback;
144
145
return
$clone;
146
}
147
151
public
function
getTerminatedCallback
() : ?
Closure
152
{
153
return
$this->terminated_callback
;
154
}
155
159
public
function
hasTerminatedCallback
() : bool
160
{
161
return
$this->terminated_callback instanceof
Closure
;
162
}
163
}
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$terminated_callback
$terminated_callback
Definition:
Tool.php:25
ILIAS\UI\Component\Symbol\Symbol
This describes a symbol.
Definition:
Symbol.php:11
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\getTitle
getTitle()
Definition:
Tool.php:62
isTopItem
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\getTerminatedCallback
getTerminatedCallback()
Definition:
Tool.php:151
ILIAS\UI\Component\Symbol\Icon\Icon
This describes how a icon could be modified during construction of UI.
Definition:
Icon.php:9
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$symbol
$symbol
Definition:
Tool.php:29
ILIAS\UI\Component
Component
Closure
Symbol
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isTopItem
Interface TopIs.
Definition:
isTopItem.php:8
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasTitle
Interface hasTitle.
Definition:
hasTitle.php:8
ILIAS\UI\Component\Symbol\Glyph\Glyph
This describes how a glyph could be modified during construction of UI.
Definition:
Glyph.php:13
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\getSymbol
getSymbol()
Definition:
Tool.php:124
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
hasSymbol()
Definition:
hasSymbolTrait.php:44
ILIAS\GlobalScreen\Scope\Tool\Factory\supportsTerminating
Class supportsTerminating.
Definition:
supportsTerminating.php:10
ILIAS\UI\Component\Symbol\Glyph
Definition:
Factory.php:6
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$content_wrapper
$content_wrapper
Definition:
Tool.php:37
ILIAS\UI\Component\Symbol\Icon
Definition:
Custom.php:4
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$title
$title
Definition:
Tool.php:41
ILIAS\GlobalScreen\Scope\Tool\Factory
Definition:
AbstractBaseTool.php:3
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasSymbol
Interface hasSymbol Methods for Entries with Symbols.
Definition:
hasSymbol.php:11
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\withTerminatedCallback
withTerminatedCallback(Closure $callback)
Definition:
Tool.php:140
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\hasSymbol
hasSymbol()
Definition:
Tool.php:132
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\getContent
getContent()
Definition:
Tool.php:92
ILIAS\GlobalScreen\Scope\MainMenu\Factory\hasContent
Interface hasContent.
Definition:
hasContent.php:11
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool
Class Tool.
Definition:
Tool.php:19
hasContent
ILIAS\GlobalScreen\Scope\Tool\Factory\AbstractBaseTool
Class AbstractBaseTool.
Definition:
AbstractBaseTool.php:13
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\withSymbol
withSymbol(Symbol $symbol)
Definition:
Tool.php:106
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$content
$content
Definition:
Tool.php:33
hasTitle
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\withContentWrapper
withContentWrapper(Closure $content_wrapper)
Definition:
Tool.php:70
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\withContent
withContent(Component $ui_component)
Definition:
Tool.php:81
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\hasTerminatedCallback
hasTerminatedCallback()
Definition:
Tool.php:159
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\withTitle
withTitle(string $title)
Definition:
Tool.php:51
ILIAS\GlobalScreen\Scope\Tool\Factory\Tool\$close_callback
$close_callback
Definition:
Tool.php:45
src
GlobalScreen
Scope
Tool
Factory
Tool.php
Generated on Tue Sep 2 2025 20:01:29 for ILIAS by
1.8.13 (using
Doxyfile
)