24use Psr\Http\Message\ServerRequestInterface;
28use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
31use ILIAS\GlobalScreen\GUI\I18n\Translator;
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();
71 $ok = $this->pons->out()->ok();
72 $nok = $this->pons->out()->nok();
75 $write_access = $this->pons->access()->hasUserPermissionTo(
'write');
78 if ($group->isCore()) {
79 $title = $this->collector->getSingleItemFromRaw(
80 $this->identification->fromSerializedIdentification($group->getId()),
83 $title = $this->translations_repository->get($group)->getDefault()?->getTranslation(
84 ) ?? $group->getTitle();
87 $this->hash($group->getId()),
89 self::COLUMN_TITLE => $this->ui_factory->link()->standard(
92 ->withURI($edit_entries)
93 ->withParameter($this->id_token, $this->hash($group->getId()))
96 self::COLUMN_ACTIVE => $group->isActive() ? $ok : $nok,
97 self::CLUMNS_ITEMS => $group->getItems(),
101 if (!$write_access || $group->isCore()) {
102 $row = $row->withDisabledAction(
'delete')
103 ->withDisabledAction(
'translate')
104 ->withDisabledAction(
'move');
113 $flow = $this->pons->flow();
114 return $this->ui_factory
119 $this->translator->translate(
'groups'),
121 self::COLUMN_TITLE => $this->ui_factory->table()->column()->link(
122 $this->translator->translate(
'title',
'group')
124 self::COLUMN_ACTIVE => $this->ui_factory->table()->column()->statusIcon(
125 $this->translator->translate(
'active',
'group')
127 self::CLUMNS_ITEMS => $this->ui_factory->table()->column()->text(
128 $this->translator->translate(
'items',
'group')
132 ->withRequest($this->request)
135 'edit_entries' => $this->ui_factory->table()->action()->single(
136 $this->translator->translate(
'edit_entries',
'group'),
137 $this->url_builder->withURI(
143 'edit' => $this->ui_factory->table()->action()->single(
144 $this->translator->translate(
'edit',
'group'),
149 'toggle_activation' => $this->ui_factory->table()->action()->standard(
150 $this->translator->translate(
'toggle_activation',
'group'),
155 'delete' => $this->ui_factory->table()->action()->standard(
156 $this->translator->translate(
'delete',
'group'),
160 'translate' => $this->ui_factory->table()->action()->single(
161 $this->translator->translate(
'translate',
'group'),
162 $this->url_builder->withURI(
163 $flow->getTranslationAsURI()
Builds a Color from either hex- or rgb values.
Class IdentificationFactory All elements in the GlobalScreen service must be identifiable for the sup...
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.