3 declare(strict_types=1);
17 $f = $DIC[
'ui.factory'];
18 $r = $DIC[
'ui.renderer'];
19 $df = new \ILIAS\Data\Factory();
23 $here_uri = $df->
uri($DIC->http()->request()->getUri()->__toString());
27 $query_params_namespace = [
'datatable',
'example'];
28 list($url_builder, $id_token, $action_token) = $url_builder->acquireParameters(
29 $query_params_namespace,
36 $f->table()->action()->standard(
38 $url_builder->withParameter($action_token,
"do_something"),
41 $f->table()->action()->standard(
43 $url_builder->withParameter($action_token,
"do_something_else"),
49 ->withActions($actions)
50 ->withRequest($DIC->http()->request());
56 $query = $DIC->http()->wrapper()->query();
57 if (
$query->has($action_token->getName())) {
58 $action =
$query->retrieve($action_token->getName(),
$refinery->to()->string());
59 $ids =
$query->retrieve($id_token->getName(),
$refinery->custom()->transformation(fn ($v) => $v));
61 if ($action ===
'do_something_else') {
63 $ids = explode(
',', $ids);
64 foreach ($ids as
$id) {
65 $items[] =
$f->modal()->interruptiveItem()->keyValue($id, $id_token->getName(),
$id);
67 echo($r->renderAsync([
68 $f->modal()->interruptive(
72 )->withAffectedItems($items)
76 $items =
$f->listing()->characteristicValue()->text(
78 'table_action' => $action,
79 'id' => print_r($ids,
true),
82 $result[] =
$f->divider()->horizontal();
87 return $r->render($result);
92 $columns = [
'f1' =>
$f->table()->column()->text(
"Field 1")];
95 public function getRows(
96 I\DataRowBuilder $row_builder,
97 array $visible_column_ids,
101 ?array $additional_parameters
103 foreach (range(0, 5) as $cnt) {
104 yield $row_builder->buildDataRow(
'row_id' . $cnt, [
'f1' => $cnt]);
108 public function getTotalRowCount(
110 ?array $additional_parameters
115 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