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 foreach ($this->
repository->getSubItemsForTable($this->parent_item) as $top_item) {
86 $id = $top_item[
'identification'];
91 $remark = $item->getStatus() !==
null ? $this->ui_renderer->render($item->getStatus()) :
'';
93 if (preg_match(
'/^-[a-zA-Z0-9_]+-$/', $remark)) {
95 $remark = $this->pons->i18n()->t(substr($remark, 1, -1));
101 'title' => $item->getDefaultTitle(),
102 'active' => $item->isActivated(),
104 'type' => $item->getTypeForPresentation(),
105 'provider' => $item->getProviderNameForPresentation(),
107 )->withDisabledAction(
108 self::ACTION_ACTIVATE,
109 !$this->write_access || $item->isActivated()
110 )->withDisabledAction(
111 self::ACTION_DEACTIVATE,
112 !$this->write_access || !$item->isActivated(),
113 )->withDisabledAction(
115 !$this->write_access || !$item->isInterchangeable()
116 )->withDisabledAction(
118 !$this->write_access || !$item->isCustom()
119 )->withDisabledAction(
120 self::ACTION_TRANSLATE,
122 )->withDisabledAction(
125 )->withDisabledAction(
126 self::ACTION_DEACTIVATE,
127 !$item->canBeDeactivated(),
135 $this->ui_factory->table()->ordering(
138 $this->parent_item->getDefaultTitle(),
140 'title' => $this->ui_factory->table()->column()->text(
141 $this->pons->i18n()->t(
'title',
'sub'),
143 'active' => $this->ui_factory->table()->column()->boolean(
144 $this->pons->i18n()->t(
'active',
'sub'),
145 $this->pons->out()->ok(),
146 $this->pons->out()->nok(),
148 'status' => $this->ui_factory->table()->column()->text(
149 $this->pons->i18n()->t(
'status',
'sub'),
151 'type' => $this->ui_factory->table()->column()->text(
152 $this->pons->i18n()->t(
'type',
'topitem'),
154 'provider' => $this->ui_factory->table()->column()->text(
155 $this->pons->i18n()->t(
'provider',
'topitem'),
158 )->withRequest($this->pons->in()->request())
161 self::ACTION_EDIT => $this->ui_factory->table()->action()->single(
162 $this->pons->i18n()->t(
'edit'),
163 $this->url_builder->withURI(
168 self::ACTION_TRANSLATE => $this->ui_factory->table()->action()->single(
169 $this->pons->i18n()->t(
'translate'),
170 $this->url_builder->withURI(
171 $this->pons->flow()->getTranslationAsURI()
175 self::ACTION_ACTIVATE => $this->ui_factory->table()->action()->standard(
176 $this->pons->i18n()->t(
'activate'),
177 $this->url_builder->withURI(
182 self::ACTION_DEACTIVATE => $this->ui_factory->table()->action()->standard(
183 $this->pons->i18n()->t(
'deactivate'),
184 $this->url_builder->withURI(
189 self::ACTION_MOVE => $this->ui_factory->table()->action()->standard(
190 $this->pons->i18n()->t(
'move'),
191 $this->url_builder->withURI(
196 self::ACTION_DELETE => $this->ui_factory->table()->action()->standard(
197 $this->pons->i18n()->t(
'delete'),
198 $this->url_builder->withURI(
$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.