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 $title = $this->translations_repository->get($entry)->getDefault()?->getTranslation() ?? $entry->getTitle();
72 $this->hash($entry->getId()),
74 self::COLUMN_TITLE => $title,
75 self::COLUMN_ACTIVE => $entry->isActive() ? $ok : $nok,
79 if ($entry->isCore()) {
80 $row = $row->withDisabledAction(
'delete')
81 ->withDisabledAction(
'edit')
82 ->withDisabledAction(
'translate')
83 ->withDisabledAction(
'move');
92 $flow = $this->pons->flow();
93 return $this->ui_factory
98 $this->group->getTitle(),
100 self::COLUMN_TITLE => $this->ui_factory->table()->column()->text(
101 $this->translator->translate(
'title',
'entry')
103 self::COLUMN_ACTIVE => $this->ui_factory->table()->column()->statusIcon(
104 $this->translator->translate(
'active',
'entry')
108 ->withRequest($this->request)
111 'edit' => $this->ui_factory->table()->action()->single(
112 $this->translator->translate(
'edit',
'entry'),
113 $this->url_builder->withURI($flow->getHereAsURI(
'edit')),
117 'toggle_activation' => $this->ui_factory->table()->action()->standard(
118 $this->translator->translate(
'toggle_activation',
'entry'),
119 $this->url_builder->withURI($flow->getHereAsURI(
'toggleActivation')),
123 'delete' => $this->ui_factory->table()->action()->standard(
124 $this->translator->translate(
'delete',
'entry'),
125 $this->url_builder->withURI($flow->getHereAsURI(
'confirmDelete')),
129 'move' => $this->ui_factory->table()->action()->standard(
130 $this->translator->translate(
'move',
'entry'),
131 $this->url_builder->withURI($flow->getHereAsURI(
'selectMove')),
135 'translate' => $this->ui_factory->table()->action()->single(
136 $this->translator->translate(
'translate',
'group'),
137 $this->url_builder->withURI(
138 $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.