3 declare(strict_types=1);
16 $f = $DIC[
'ui.factory'];
17 $r = $DIC[
'ui.renderer'];
18 $df = new \ILIAS\Data\Factory();
22 $here_uri = $df->
uri($DIC->http()->request()->getUri()->__toString());
24 $query_params_namespace = [
'datatable',
'example'];
25 list($url_builder, $id_token, $action_token) = $url_builder->acquireParameters(
26 $query_params_namespace,
32 'some_action' =>
$f->table()->action()->multi(
34 $url_builder->withParameter($action_token,
"do_something"),
37 'some_other_action' =>
$f->table()->action()->multi(
39 $url_builder->withParameter($action_token,
"do_something_else"),
45 ->withActions($actions)
46 ->withRequest($DIC->http()->request());
52 $query = $DIC->http()->wrapper()->query();
53 if (
$query->has($action_token->getName())) {
54 $action =
$query->retrieve($action_token->getName(),
$refinery->to()->string());
55 $ids =
$query->retrieve($id_token->getName(),
$refinery->custom()->transformation(fn ($v) => $v));
57 if ($action ===
'do_something_else') {
59 $ids = explode(
',', $ids);
60 foreach ($ids as
$id) {
61 $items[] =
$f->modal()->interruptiveItem()->keyValue($id, $id_token->getName(),
$id);
63 echo($r->renderAsync([
64 $f->modal()->interruptive(
68 )->withAffectedItems($items)
72 $items =
$f->listing()->characteristicValue()->text(
74 'table_action' => $action,
75 'id' => print_r($ids,
true),
78 $result[] =
$f->divider()->horizontal();
83 return $r->render($result);
88 $columns = [
'f1' =>
$f->table()->column()->text(
"Field 1")];
91 public function getRows(
92 I\DataRowBuilder $row_builder,
93 array $visible_column_ids,
97 ?array $additional_parameters
99 foreach (range(0, 5) as $cnt) {
100 yield $row_builder->buildDataRow(
'row_id' . $cnt, [
'f1' => $cnt]);
104 public function getTotalRowCount(
106 ?array $additional_parameters
111 return $f->table()->data(
'a data table with actions', $columns, $data_retrieval);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
uri(string $uri_string)
Object representing an uri valid according to RFC 3986 with restrictions imposed on valid characters ...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
A simple class to express a range of whole positive numbers.
Refinery Factory $refinery