19declare(strict_types=1);
30use ILIAS\GlobalScreen\GUI\Hasher;
31use ILIAS\GlobalScreen\GUI\I18n\Translator;
35use Psr\Http\Message\ResponseInterface;
54 private Translator $translator,
58 $this->ui_factory = $this->ui_services->factory();
59 $this->ui_renderer = $this->ui_services->renderer();
60 $this->main_tpl = $this->ui_services->mainTemplate();
65 return $this->
http->response();
70 return $this->ui_services;
75 return $this->toolbar;
80 $this->
message(
'success', $message, $keep);
85 $this->
message(
'info', $message, $keep);
90 $this->
message(
'failure', $message, $keep);
95 $this->main_tpl->setOnScreenMessage($type,
$message, $keep);
102 URI|
string $post_url,
105 if ($post_url instanceof
URI) {
106 $post_url = (string) $post_url;
108 $modal = $this->ui_factory->modal()->interruptive(
112 )->withAffectedItems(
114 )->withActionButtonLabel($button_text);
121 URI|
string $post_url,
124 if ($post_url instanceof
URI) {
125 $post_url = (string) $post_url;
129 $are_interruptive = array_filter(
134 $modal = match (
true) {
135 $is_form => $this->ui_factory->modal()->roundtrip(
141 $are_interruptive => $this->ui_factory->modal()->interruptive(
143 $this->translator->translate(
'confirm_delete'),
145 )->withAffectedItems(
157 default => $this->ui_factory->modal()->roundtrip(
171 $string = $this->ui_renderer->renderAsync(
$components);
178 $this->
http->sendResponse();
179 $this->
http->close();
185 $this->main_tpl->setContent($string);
191 $components = array_filter(
$components, fn($component):
bool => $component !==
null);
193 $this->main_tpl->setContent(
208 return $this->ui_factory->image()->standard(
209 'assets/images/standard/icon_unchecked.svg',
214 return $this->ui_factory->symbol()->icon()->custom(
215 'assets/images/standard/icon_unchecked.svg',
224 return $this->ui_factory->image()->standard(
225 'assets/images/standard/icon_checked.svg',
230 return $this->ui_factory->symbol()->icon()->custom(
231 'assets/images/standard/icon_checked.svg',
Provides fluid interface to RBAC services.
Builds a Color from either hex- or rgb values.
The scope of this class is split ilias-conform URI's into components.
Stream factory which enables the user to create streams without the knowledge of the concrete class.
outString(string $string)
render(?Component ... $components)
outAsyncAsModal(string $title, URI|string $post_url, ?Component ... $components)
__construct(private UIServices $ui_services, private Services $http, private Translator $translator, private Tabs $tabs, private \ilToolbarGUI $toolbar,)
out(?Component ... $components)
outAsync(?Component ... $components)
outAsyncAsConfirmation(string $title, string $message, string $button_text, URI|string $post_url, InterruptiveItem ... $components)
message(string $type, string $message, bool $keep=true)
info(string $message, bool $keep=true)
success(string $message, bool $keep=true)
ilGlobalTemplateInterface $main_tpl
nok(bool $as_image=false)
error(string $message, bool $keep=true)
A component is the most general form of an entity in the UI.
This describes how an icon could be modified during construction of UI.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.
if(!file_exists('../ilias.ini.php'))