19 declare(strict_types=1);
56 protected readonly array $actions
92 return $this->actions[$action_id] ??
null;
101 return match($this->test_request->strVal($action_type_token->
getName())) {
102 self::SUBMIT_ACTION => $this->
submit(
120 array_keys($this->actions),
121 fn(
DataRow $c,
string $v):
DataRow => $this->actions[$v]->allowActionForRecord($record)
134 $action = $this->actions[$this->test_request->strVal($action_token->
getName())];
135 $selected_participants_from_request = $this->test_request
136 ->getMultiSelectionIds($row_id_token->
getName());
139 $selected_participants_from_request
142 if ($selected_participants === []) {
143 $error_message = $action->getSelectionErrorMessage() ?? $this->
lng->txt(
'no_valid_participant_selection');
144 $this->test_response->sendAsync(
145 $this->ui_renderer->renderAsync(
146 $this->ui_factory->messageBox()->failure(
153 $this->test_response->sendAsync(
154 $this->ui_renderer->renderAsync(
157 ->
withParameter($row_id_token, $selected_participants_from_request)
158 ->withParameter($action_token, $action->getActionId())
159 ->withParameter($action_type_token, self::SUBMIT_ACTION),
160 $selected_participants,
161 $selected_participants_from_request ===
'ALL_OBJECTS' 173 $action = $this->actions[$this->test_request->strVal($action_token->
getName())];
174 $selected_participants_from_request = $this->test_request
175 ->getMultiSelectionIds($row_id_token->
getName());
178 $selected_participants_from_request
181 if ($selected_participants === []) {
182 $this->tpl->setOnScreenMessage(
184 $this->
lng->txt(
'no_valid_participant_selection'),
189 return $action->onSubmit(
191 ->withParameter($row_id_token, $selected_participants_from_request)
192 ->withParameter($action_token, $action->getActionId())
193 ->withParameter($action_type_token, self::SUBMIT_ACTION),
194 $this->test_request->getRequest(),
195 $selected_participants,
196 $selected_participants_from_request ===
'ALL_OBJECTS' 202 if ($selected_participants ===
'ALL_OBJECTS') {
204 iterator_to_array($this->
repository->getParticipants($this->test_obj->getTestId())),
212 $selected_participants
This describes commonalities between the different modals.
withDisabledAction(string $action_id, bool $disable=true)
Refer to an Action by its id and disable it for this row/record only.
getName()
Get the full name of the token including its namespace.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
repository()
description: > Example for rendering a repository card
showModal(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
getEnabledActions(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
allowActionForRecord(Participant $record)
getAction(string $action_id)
onDataRow(DataRow $row, mixed $record)
const ACTION_TYPE_PARAMETER
execute(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
submit(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
resolveSelectedParticipants(TableAction $action, array|string $selected_participants)
const MESSAGE_TYPE_FAILURE
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
__construct(protected readonly \ilCtrlInterface $ctrl, protected readonly Language $lng, protected readonly \ilGlobalTemplateInterface $tpl, protected readonly UIFactory $ui_factory, protected readonly UIRenderer $ui_renderer, protected readonly Refinery $refinery, protected readonly RequestDataCollector $test_request, protected readonly ResponseHandler $test_response, protected readonly ParticipantRepository $repository, protected readonly \ilObjTest $test_obj, protected readonly array $actions)