22use Psr\Http\Message\ServerRequestInterface;
26use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
31use ILIAS\GlobalScreen\GUI\I18n\Translator;
48 private \ILIAS\GlobalScreen\Scope\Footer\Collector\FooterMainCollector
$collector;
53 private readonly
Group $group,
59 $this->translator = $pons->
i18n();
60 $this->ui_factory = $pons->
out()->ui()->factory();
61 $this->url_builder = $this->token_container->builder();
62 $this->id_token = $this->token_container->token();
63 $this->request = $pons->
in()->request();
64 $this->translations_repository = $pons->
i18n()->ml()->repository();
65 $this->collector =
$DIC->globalScreen()->collector()->footer();
66 $this->identification =
$DIC->globalScreen()->identification();
72 $ok = $this->pons->out()->ok();
73 $nok = $this->pons->out()->nok();
75 foreach ($this->
repository->allForParent($this->group->getId()) as $entry) {
76 if ($entry->isCore()) {
77 $title = $this->collector->getSingleItemFromRaw(
78 $this->identification->fromSerializedIdentification($entry->getId()),
79 )?->getTitle() ??
'Unknown';
81 $title = $this->translations_repository->get($entry)->getDefault()?->getTranslation(
82 ) ?? $entry->getTitle();
86 $this->hash($entry->getId()),
88 self::COLUMN_TITLE => $title,
89 self::COLUMN_ACTIVE => $entry->isActive() ? $ok : $nok,
93 if ($entry->isCore()) {
94 $row = $row->withDisabledAction(
'delete')
95 ->withDisabledAction(
'edit')
96 ->withDisabledAction(
'translate')
97 ->withDisabledAction(
'move');
106 $flow = $this->pons->flow();
107 return $this->ui_factory
112 $this->group->getTitle(),
114 self::COLUMN_TITLE => $this->ui_factory->table()->column()->text(
115 $this->translator->translate(
'title',
'entry')
117 self::COLUMN_ACTIVE => $this->ui_factory->table()->column()->statusIcon(
118 $this->translator->translate(
'active',
'entry')
122 ->withRequest($this->request)
125 'edit' => $this->ui_factory->table()->action()->single(
126 $this->translator->translate(
'edit',
'entry'),
131 'toggle_activation' => $this->ui_factory->table()->action()->standard(
132 $this->translator->translate(
'toggle_activation',
'entry'),
137 'delete' => $this->ui_factory->table()->action()->standard(
138 $this->translator->translate(
'delete',
'entry'),
143 'move' => $this->ui_factory->table()->action()->standard(
144 $this->translator->translate(
'move',
'entry'),
149 'translate' => $this->ui_factory->table()->action()->single(
150 $this->translator->translate(
'translate',
'group'),
151 $this->url_builder->withURI(
152 $flow->getTranslationAsURI()
Builds a Color from either hex- or rgb values.
buildOrderingRow(string $id, array $record)
This describes a Table to specify the order of its data (rows).
withActions(array $actions)
This is how the factory for UI elements looks.