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()->single(
34 $url_builder->withParameter($action_token,
"do_something"),
37 'some_other_action' =>
$f->table()->action()->single(
39 $url_builder->withParameter($action_token,
"do_something_else"),
45 ->withActions($actions)
46 ->withRequest($DIC->http()->request());
51 $query = $DIC->http()->wrapper()->query();
52 if (
$query->has($action_token->getName())) {
53 $action =
$query->retrieve($action_token->getName(),
$refinery->to()->string());
54 $ids =
$query->retrieve($id_token->getName(),
$refinery->custom()->transformation(fn ($v) => $v));
56 if ($action ===
'do_something_else') {
58 $ids = explode(
',', $ids);
59 foreach ($ids as
$id) {
60 $items[] =
$f->modal()->interruptiveItem()->keyValue($id, $id_token->getName(),
$id);
62 echo($r->renderAsync([
63 $f->modal()->interruptive(
67 )->withAffectedItems($items)
71 $items =
$f->listing()->characteristicValue()->text(
73 'table_action' => $action,
74 'id' => print_r($ids,
true),
77 $result[] =
$f->divider()->horizontal();
81 return $r->render($result);
86 $columns = [
'f1' =>
$f->table()->column()->text(
"Field 1")];
89 public function getRows(
90 I\DataRowBuilder $row_builder,
91 array $visible_column_ids,
95 ?array $additional_parameters
97 foreach (range(0, 5) as $cnt) {
98 yield $row_builder->buildDataRow(
'row_id' . $cnt, [
'f1' => $cnt]);
102 public function getTotalRowCount(
104 ?array $additional_parameters
109 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