ILIAS  trunk Revision v12.0_alpha-1613-gae4c99ebb18
ILIAS\BookingManager\Common\Table\TableActions Class Reference
+ Collaboration diagram for ILIAS\BookingManager\Common\Table\TableActions:

Public Member Functions

 __construct (protected readonly ilCtrlInterface $ctrl, protected readonly ilLanguage $lng, protected readonly ilGlobalTemplateInterface $tpl, protected readonly UIFactory $ui_factory, protected readonly UIRenderer $ui_renderer, protected readonly Refinery $refinery, protected readonly HttpService $http, protected readonly array $actions)
 
 getEnabledActions (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
 
 execute (URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
 
 onDataRow (DataRow $row, mixed $record)
 

Detailed Description

Definition at line 36 of file TableActions.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\BookingManager\Common\Table\TableActions::__construct ( protected readonly ilCtrlInterface  $ctrl,
protected readonly ilLanguage  $lng,
protected readonly ilGlobalTemplateInterface  $tpl,
protected readonly UIFactory  $ui_factory,
protected readonly UIRenderer  $ui_renderer,
protected readonly Refinery  $refinery,
protected readonly HttpService  $http,
protected readonly array  $actions 
)
Parameters
array<string,TableAction>$actions

Definition at line 41 of file TableActions.php.

50 {
51 }

Member Function Documentation

◆ execute()

ILIAS\BookingManager\Common\Table\TableActions::execute ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)

Definition at line 69 of file TableActions.php.

74 : ?Modal {
75 if (!$this->http->has($action_token->getName())) {
76 return null;
77 }
78
79 $action_id = $this->http->resolveRowParameter($action_token->getName());
80 $action = $this->actions[$action_id] ?? null;
81 if ($action === null) {
82 return null;
83 }
84
85 $response = $action->onExecute($url_builder, $row_id_token, $action_token, $action_type_token);
86
87 return $response instanceof Modal ? $response : null;
88 }
getName()
Get the full name of the token including its namespace.
static http()
Fetches the global http state from ILIAS.
$response
Definition: xapitoken.php:90

◆ getEnabledActions()

ILIAS\BookingManager\Common\Table\TableActions::getEnabledActions ( URLBuilder  $url_builder,
URLBuilderToken  $row_id_token,
URLBuilderToken  $action_token,
URLBuilderToken  $action_type_token 
)

Definition at line 53 of file TableActions.php.

58 : array {
59 return array_filter(
60 array_map(
61 static fn(TableAction $action): ?Action => $action->isAvailable()
62 ? $action->getTableAction($url_builder, $row_id_token, $action_token, $action_type_token)
63 : null,
64 $this->actions
65 )
66 );
67 }

◆ onDataRow()

ILIAS\BookingManager\Common\Table\TableActions::onDataRow ( DataRow  $row,
mixed  $record 
)

Definition at line 90 of file TableActions.php.

90 : DataRow
91 {
92 foreach ($this->actions as $action_id => $action) {
93 if ($action->allowActionForRecord($record)) {
94 continue;
95 }
96
97 $row = $row->withDisabledAction($action_id);
98 }
99
100 return $row;
101 }
withDisabledAction(string $action_id, bool $disable=true)
Refer to an Action by its id and disable it for this row/record only.

References ILIAS\UI\Component\Table\DataRow\withDisabledAction().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: