19declare(strict_types=1);
26use ILIAS\GlobalScreen_\UI\Translator;
28use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
47 private Translator $translator,
53 $this->main_tpl = $this->
ui->mainTemplate();
54 $this->ui_renderer = $this->
ui->renderer();
55 $this->ui_factory = $this->
ui->factory();
64 $are_interruptive = array_filter(
$components, fn($component):
bool => $component instanceof
KeyValue) !== [];
66 $modal = match (
true) {
67 $is_form => $this->ui_factory->modal()->roundtrip(
73 $are_interruptive => $this->ui_factory->modal()->interruptive(
75 $this->translator->translate(
'confirm_delete'),
80 $this->hash($item->
getId()),
87 default => $this->ui_factory->modal()->roundtrip(
101 $string = $this->ui_renderer->renderAsync(
$components);
108 $this->
http->sendResponse();
109 $this->
http->close();
116 $this->main_tpl->setContent(
129 $this->tabs_gui->addTab(
131 $this->translator->translate(
'groups'),
132 $this->ctrl->getLinkTargetByClass(
133 ilObjFooterAdministrationGUI::class,
137 $this->tabs_gui->addTab(
139 $this->translator->translate(
'perm_settings'),
140 $this->ctrl->getLinkTargetByClass([ilObjFooterAdministrationGUI::class, ilPermissionGUI::class],
'perm')
146 $this->tabs_gui->clearTargets();
150 && $this->ctrl->getCmdClass() === strtolower(ilFooterEntriesGUI::class)
152 $this->tabs_gui->setBackTarget(
153 $this->translator->translate(
'back'),
154 $this->ctrl->getLinkTargetByClass(
155 ilFooterEntriesGUI::class,
162 $this->tabs_gui->setBackTarget(
163 $this->translator->translate(
'back'),
164 $this->ctrl->getLinkTargetByClass(
165 ilObjFooterAdministrationGUI::class,
173 $this->tabs_gui->activateTab($tab);
178 $this->require(
'read');
183 $this->require(
'write');
188 return $this->rbac_system->checkAccess($permissions, $this->ref_id);
191 public function require(
string $permissions): void
193 if (!$this->hasPermission($permissions)) {
194 $this->
error->raiseError($this->translator->translate(
'msg_no_perm_read'), $this->error->WARNING);
198 public function getHereAsURI(?
string $cmd =
null):
URI
200 $uri =
new URI((
string) $this->
http->request()->getUri());
202 return $uri->withParameter(
'cmd', $cmd);
206 public function buildURI(
string $from_path):
URI
208 $request = $this->
http->request()->getUri();
209 return new URI($request->getScheme() .
'://' . $request->getHost() .
'/' . ltrim($from_path,
'/'));
212 public function sendMessageAndRedirect(
217 $this->main_tpl->setOnScreenMessage(
222 $this->
ctrl->redirectToURL($target);
225 public function saveIdentificationsToRequest(
226 object|
string $gui_class,
231 $this->
ctrl->setParameterByClass(
232 is_object($gui_class) ? $gui_class::class : $gui_class,
244 $query_params = $this->
http->request()->getQueryParams();
246 $ids = $query_params[$name] ?? [];
247 $ids = is_array($ids) ? $ids : [$ids];
250 if (($ids[0] ??
null) ===
'ALL_OBJECTS') {
255 if (($interruptive_items = $this->
http->request()->getParsedBody()[
'interruptive_items'] ??
false)) {
256 foreach ($interruptive_items as $interruptive_item) {
257 $ids[] = $interruptive_item;
261 return array_map(fn(
$id):
string => $this->unhash(
$id), $ids);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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.
getKey()
Get the key of the pair.
getValue()
Get the value of the pair.
Error Handling & global info handling.
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A component is the most general form of an entity in the UI.
This is how the factory for UI elements looks.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.