22use Psr\Http\Message\ServerRequestInterface;
26use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
31use ILIAS\GlobalScreen\GUI\I18n\Translator;
51 private readonly
Group $group,
55 $this->translator = $pons->
i18n();
56 $this->ui_factory = $pons->
out()->ui()->factory();
57 $this->url_builder = $this->token_container->builder();
58 $this->id_token = $this->token_container->token();
59 $this->request = $pons->
in()->request();
60 $this->translations_repository = $pons->
i18n()->ml()->repository();
66 $ok = $this->pons->out()->ok();
67 $nok = $this->pons->out()->nok();
69 foreach ($this->
repository->allForParent($this->group->getId()) as $entry) {
70 if ($entry->isCore()) {
71 $title = $this->collector->getSingleItemFromRaw(
72 $this->identification->fromSerializedIdentification($entry->getId()),
73 )?->getTitle() ??
'Unknown';
75 $title = $this->translations_repository->get($entry)->getDefault()?->getTranslation(
76 ) ?? $entry->getTitle();
80 $this->hash($entry->getId()),
82 self::COLUMN_TITLE => $title,
83 self::COLUMN_ACTIVE => $entry->isActive() ? $ok : $nok,
87 if ($entry->isCore()) {
88 $row = $row->withDisabledAction(
'delete')
89 ->withDisabledAction(
'edit')
90 ->withDisabledAction(
'translate')
91 ->withDisabledAction(
'move');
100 $flow = $this->pons->flow();
101 return $this->ui_factory
106 $this->group->getTitle(),
108 self::COLUMN_TITLE => $this->ui_factory->table()->column()->text(
109 $this->translator->translate(
'title',
'entry')
111 self::COLUMN_ACTIVE => $this->ui_factory->table()->column()->statusIcon(
112 $this->translator->translate(
'active',
'entry')
116 ->withRequest($this->request)
119 'edit' => $this->ui_factory->table()->action()->single(
120 $this->translator->translate(
'edit',
'entry'),
125 'toggle_activation' => $this->ui_factory->table()->action()->standard(
126 $this->translator->translate(
'toggle_activation',
'entry'),
131 'delete' => $this->ui_factory->table()->action()->standard(
132 $this->translator->translate(
'delete',
'entry'),
137 'move' => $this->ui_factory->table()->action()->standard(
138 $this->translator->translate(
'move',
'entry'),
143 'translate' => $this->ui_factory->table()->action()->single(
144 $this->translator->translate(
'translate',
'group'),
145 $this->url_builder->withURI(
146 $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.