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;
78 public function success(
string $message,
bool $keep =
true): void
80 $this->
message(
'success', $message, $keep);
83 public function info(
string $message,
bool $keep =
true): void
85 $this->
message(
'info', $message, $keep);
88 public function error(
string $message,
bool $keep =
true): void
90 $this->
message(
'failure', $message, $keep);
93 public function message(
string $type,
string $message,
bool $keep =
true): void
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;
119 ->withActionButtonLabel($button_text);
126 URI|
string $post_url,
129 if ($post_url instanceof
URI) {
130 $post_url = (string) $post_url;
134 $are_interruptive = array_filter(
139 $modal = match (
true) {
149 $are_interruptive => $this
154 $this->translator->translate(
'confirm_delete'),
177 $string = $this->ui_renderer->renderAsync(
$components);
184 $this->
http->sendResponse();
185 $this->
http->close();
191 $this->main_tpl->setContent($string);
197 $components = array_filter(
$components, fn(?
Component $component):
bool => $component !==
null);
199 $this->main_tpl->setContent(
214 return $this->ui_factory->image()->standard(
215 'assets/images/standard/icon_unchecked.svg',
220 return $this->ui_factory->symbol()->icon()->custom(
221 'assets/images/standard/icon_unchecked.svg',
230 return $this->ui_factory->image()->standard(
231 'assets/images/standard/icon_checked.svg',
236 return $this->ui_factory->symbol()->icon()->custom(
237 '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'))