19 declare(strict_types=1);
64 $this->ui_factory = $this->dic->ui()->factory();
65 $this->
ctrl = $this->dic->ctrl();
66 $this->request = $this->dic->http()->request();
68 $this->dic->database(),
75 $modal = $this->ui_factory->modal()->roundtrip(
76 $this->translator->translate(
'group_add'),
78 )->withAsyncRenderUrl(
79 $this->
ctrl->getLinkTarget($this, self::CMD_ADD)
82 $confirm_reset = $this->ui_factory->prompt()->standard(
83 $this->ui_handling->getHereAsURI(self::CMD_CONFIRM_RESET),
86 $this->dic->toolbar()->addComponent(
90 $this->translator->translate(
'group_add'),
93 ->withOnClick($modal->getShowSignal())
94 ->
withHelpTopics(...$this->ui_factory->helpTopics(
'gsfo_button_add'))
96 $this->dic->toolbar()->addComponent(
100 $this->translator->translate(
'reset_footer'),
103 ->withOnClick($confirm_reset->getShowSignal())
104 ->
withHelpTopics(...$this->ui_factory->helpTopics(
'gsfo_button_reset'))
107 return [$modal, $confirm_reset];
112 $this->ui_handling->outAsync(
113 $this->ui_factory->prompt()->state()->show(
114 $this->ui_factory->messageBox()->confirmation(
115 $this->translator->translate(
'confirm_reset')
118 $this->ui_factory->button()->standard(
119 $this->translator->translate(
'reset'),
120 $this->
ctrl->getLinkTarget($this, self::CMD_RESET)
132 if ($this->ui_handling->hasPermission(
'write')) {
137 $this->dic->globalScreen()->collector()->footer()
145 $this->ui_handling->hasPermission(
'write')
148 $this->ui_handling->out(
150 $this->ui_handling->getHereAsURI(self::CMD_SAVE_ORDER),
151 $this->ui_handling->buildURI(
152 $this->
ctrl->getLinkTargetByClass(
153 ilFooterTranslationGUI::class,
166 foreach ($this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID) as
$id) {
168 if ($group === null) {
171 if ($group->isCore()) {
172 $items[] = $this->ui_factory->modal()->interruptiveItem()->keyValue(
175 $this->translator->translate(
'info_not_deletable_core') .
176 $this->ui_handling->render($this->nok($this->ui_factory))
180 if ($group->getItems() > 0) {
181 $items[] = $this->ui_factory->modal()->interruptiveItem()->keyValue(
184 $this->translator->translate(
'info_not_deletable_not_empty') .
185 $this->ui_handling->render($this->nok($this->ui_factory))
189 $items[] = $this->ui_factory->modal()->interruptiveItem()->keyValue(
192 $this->ui_handling->render($this->ok($this->ui_factory))
196 $this->ui_handling->outAsyncAsModal(
197 $this->translator->translate(
'group_delete'),
198 $this->
ctrl->getFormAction($this,
'delete'),
203 private function delete():
void 205 foreach ($this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID) as
$id) {
210 $this->ui_handling->sendMessageAndRedirect(
212 $this->translator->translate(
'group_deleted'),
213 $this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT)
219 foreach ($this->request->getParsedBody() as $hashed_id => $position) {
220 $this->
repository->updatePositionById($this->unhash($hashed_id), (
int) $position);
222 $this->ui_handling->sendMessageAndRedirect(
224 $this->translator->translate(
'order_saved'),
225 $this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT)
229 protected function add(): void
236 $action = $this->
ctrl->getFormAction($this, self::CMD_CREATE);
238 $this->ui_handling->outAsyncAsModal(
239 $this->translator->translate(
'group_add'),
253 $this->ctrl->getFormAction($this, self::CMD_CREATE)
255 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
257 $this->ui_handling->out(
259 $this->ctrl->getFormAction($this, self::CMD_CREATE)
264 protected function edit(): void
266 $id = $this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID)[0];
267 $this->ui_handling->saveIdentificationsToRequest(
280 $target = $this->
ctrl->getFormAction($this, self::CMD_UPDATE);
281 $this->ui_handling->outAsyncAsModal(
282 $this->translator->translate(
'group_edit'),
290 $id = $this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID)[0];
300 $this->ctrl->getFormAction($this, self::CMD_CREATE)
302 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
304 $this->ui_handling->out(
306 $this->ctrl->getFormAction($this, self::CMD_CREATE)
313 foreach ($this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID) as
$id) {
315 $this->
repository->store($group->withActive(!$group->isActive()));
318 $this->ui_handling->sendMessageAndRedirect(
320 $this->translator->translate(
'group_activation_toggled'),
321 $this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT)
328 $this->dic->globalScreen()->collector()->footer()
331 $entries_repo->
reset($this->dic->globalScreen()->collector()->footer());
334 $translations->
reset();
336 $this->ui_handling->sendMessageAndRedirect(
338 $this->translator->translate(
'reset_success'),
339 $this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT)
345 $id = $this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID)[0];
346 $this->ui_handling->saveIdentificationsToRequest(
347 ilFooterEntriesGUI::class,
351 $this->
ctrl->redirectByClass(ilFooterEntriesGUI::class);
359 $this->ui_handling->requireReadable();
361 $next_class = $this->
ctrl->getNextClass($this) ??
'';
362 $cmd = $this->
ctrl->getCmd(self::CMD_DEFAULT);
364 switch (strtolower($next_class)) {
365 case strtolower(ilFooterTranslationGUI::class):
367 $this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID)[0]
370 if ($this->request->getQueryParams()[
'async'] ??
false) {
371 $back_target = $this->ui_handling->buildURI($this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT));
381 $this->
ctrl->forwardCommand($translation);
384 case strtolower(ilFooterEntriesGUI::class):
385 $id = $this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID)[0];
386 $this->ui_handling->saveIdentificationsToRequest(
387 ilFooterEntriesGUI::class,
393 $this->
ctrl->forwardCommand(
405 case self::CMD_DEFAULT:
406 $this->ui_handling->requireReadable();
410 $this->ui_handling->requireReadable();
414 case self::CMD_CREATE:
416 case self::CMD_UPDATE:
418 $this->ui_handling->backToMainTab();
419 $this->ui_handling->requireWritable();
button(string $caption, string $cmd)
standard()
description: > This is an example, of how the Notification Slate is generated by assigning Notificat...
repository()
description: > Example for rendering a repository card
Customizing of pimple-DIC for ILIAS.
withHelpTopics(Topic ... $topics)
This is how the factory for UI elements looks.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins