Skip to content

Commit

Permalink
[FIX] 0042755: Failed test: Footer-Eintrag löschen
Browse files Browse the repository at this point in the history
  • Loading branch information
chfsx committed Jan 28, 2025
1 parent bba3563 commit 17ab001
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
use ILIAS\GlobalScreen\UI\Footer\Groups\GroupsRepository;
use ILIAS\GlobalScreen\UI\Footer\Translation\TranslationsRepositoryDB;
use ILIAS\GlobalScreen_\UI\UIHelper;

/**
* @author Fabian Schmid <[email protected]>
Expand All @@ -40,6 +41,7 @@
final class ilFooterEntriesGUI
{
use Hasher;
use UIHelper;

public const CMD_DEFAULT = 'index';
public const CMD_ADD = 'add';
Expand Down Expand Up @@ -254,17 +256,23 @@ protected function confirmDelete(): void
$items = [];

foreach ($this->ui_handling->getIdentificationsFromRequest(self::GSFO_ID) as $id) {
$item = $this->repository->get($id);
if ($item === null) {
$entry = $this->repository->get($id);
if ($entry === null) {
continue;
}
if ($item->isCore()) {
if ($entry->isCore()) {
$items[] = $this->ui_factory->modal()->interruptiveItem()->keyValue(
$id,
$entry->getTitle(),
$this->translator->translate('info_not_deletable_core') .
$this->ui_handling->render($this->nok($this->ui_factory))
);
continue;
}
$items[] = $this->ui_factory->modal()->interruptiveItem()->keyValue(
$id,
$this->translator->translate('entry_title'),
$item->getTitle()
$entry->getTitle(),
$this->ui_handling->render($this->ok($this->ui_factory))
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,22 +192,6 @@ protected function confirmDelete(): void
);
}

/* $c = match (true) {
$group === null => $this->ui_factory->messageBox()->failure(
$this->translator->translate('group_not_found')
),
$group->isCore() => $this->ui_factory->messageBox()->failure(
$this->translator->translate('group_core')
),
$group->getItems() > 0 => $this->ui_factory->messageBox()->failure(
$this->translator->translate('group_not_empty')
),
default => $this->ui_factory->modal()->interruptiveItem()->keyValue(
$id,
$this->translator->translate('group_title'),
$group->getTitle()
)
};*/
$this->ui_handling->outAsyncAsModal(
$this->translator->translate('group_delete'),
$this->ctrl->getFormAction($this, 'delete'),
Expand Down

0 comments on commit 17ab001

Please sign in to comment.