19declare(strict_types=1);
30use ILIAS\GlobalScreen\GUI\Hasher;
75 private bool $write_access
77 $this->ui_factory = $this->pons->out()->ui()->factory();
78 $this->ui_renderer = $this->pons->out()->ui()->renderer();
79 $this->url_builder = $token_container->
builder();
80 $this->token = $token_container->
token();
85 if ($this->parent_item ===
null) {
88 $items = $this->
repository->getSubItemsForTable($this->parent_item);
91 foreach ($items as $sub_item) {
92 $id = $sub_item[
'identification'];
97 $remark = $item->getStatus() !==
null ? $this->ui_renderer->render($item->getStatus()) :
'';
99 if (preg_match(
'/^-\w+-$/', $remark)) {
101 $remark = $this->pons->i18n()->t(substr($remark, 1, -1));
107 'title' => $item->getDefaultTitle(),
108 'active' => $item->isActivated(),
110 'type' => $item->getTypeForPresentation(),
111 'provider' => $item->getProviderNameForPresentation(),
113 )->withDisabledAction(
114 self::ACTION_ACTIVATE,
115 !$this->write_access || $item->isActivated()
116 )->withDisabledAction(
117 self::ACTION_DEACTIVATE,
118 !$this->write_access || !$item->isActivated(),
119 )->withDisabledAction(
121 !$this->write_access || !$item->isInterchangeable()
122 )->withDisabledAction(
124 !$this->write_access || !$item->isCustom()
125 )->withDisabledAction(
126 self::ACTION_TRANSLATE,
128 )->withDisabledAction(
131 )->withDisabledAction(
132 self::ACTION_DEACTIVATE,
133 !$item->canBeDeactivated(),
140 if ($this->write_access) {
142 self::ACTION_EDIT => $this->ui_factory->table()->action()->single(
143 $this->pons->i18n()->t(
'edit'),
144 $this->url_builder->withURI(
149 self::ACTION_TRANSLATE => $this->ui_factory->table()->action()->single(
150 $this->pons->i18n()->t(
'translate'),
151 $this->url_builder->withURI(
152 $this->pons->flow()->getTranslationAsURI()
156 self::ACTION_ACTIVATE => $this->ui_factory->table()->action()->standard(
157 $this->pons->i18n()->t(
'activate'),
158 $this->url_builder->withURI(
163 self::ACTION_DEACTIVATE => $this->ui_factory->table()->action()->standard(
164 $this->pons->i18n()->t(
'deactivate'),
165 $this->url_builder->withURI(
170 self::ACTION_MOVE => $this->ui_factory->table()->action()->standard(
171 $this->pons->i18n()->t(
'move'),
172 $this->url_builder->withURI(
177 self::ACTION_DELETE => $this->ui_factory->table()->action()->standard(
178 $this->pons->i18n()->t(
'delete'),
179 $this->url_builder->withURI(
195 $this->parent_item?->getDefaultTitle() ?? $this->pons->i18n()->t(
'mme_lost_items'),
197 'title' => $this->ui_factory->table()->column()->text(
198 $this->pons->i18n()->t(
'title',
'sub'),
200 'active' => $this->ui_factory->table()->column()->boolean(
201 $this->pons->i18n()->t(
'active',
'sub'),
202 $this->pons->out()->ok(),
203 $this->pons->out()->nok(),
205 'status' => $this->ui_factory->table()->column()->text(
206 $this->pons->i18n()->t(
'status',
'sub'),
208 'type' => $this->ui_factory->table()->column()->text(
209 $this->pons->i18n()->t(
'type',
'topitem'),
211 'provider' => $this->ui_factory->table()->column()->text(
212 $this->pons->i18n()->t(
'provider',
'topitem'),
216 $this->pons->in()->request()
218 ->withOrderingDisabled(!$this->write_access)
219 ->withActions($actions)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
Builds a Color from either hex- or rgb values.
getRows(OrderingRowBuilder $row_builder, array $visible_column_ids)
This is called by the (ordering-)table to retrieve rows; map data-records to rows using the $row_buil...
__construct(private Pons $pons, TokenContainer $token_container, private ilMMItemRepository $repository, private ?ilMMItemFacadeInterface $parent_item, private bool $write_access)
A component is the most general form of an entity in the UI.
buildOrderingRow(string $id, array $record)
This is how the factory for UI elements looks.
An entity that renders components to a string output.
Interface ilMMItemFacadeInterface.