ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
11 
18 function base()
19 {
20  global $DIC;
21  $f = $DIC['ui.factory'];
22  $r = $DIC['ui.renderer'];
23  $df = new \ILIAS\Data\Factory();
24 
25  $columns = [
26  'd1' => $f->table()->column()->timeSpan("German Long", $df->dateFormat()->germanLong()),
27  'd2' => $f->table()->column()->timeSpan("German Short", $df->dateFormat()->germanShort())
28  ];
29 
30  $data_retrieval = new class () implements I\DataRetrieval {
31  public function getRows(
32  I\DataRowBuilder $row_builder,
33  array $visible_column_ids,
34  Range $range,
35  Order $order,
36  ?array $filter_data,
37  ?array $additional_parameters
38  ): \Generator {
39  $row_id = '';
40  $dat = new \DateTimeImmutable();
41  $dat2 = $dat->add(new \DateInterval('PT10H30S'));
42  $record = [
43  'd1' => [$dat, $dat2],
44  'd2' => [$dat, $dat2],
45  ];
46  yield $row_builder->buildDataRow($row_id, $record);
47  }
48 
49  public function getTotalRowCount(
50  ?array $filter_data,
51  ?array $additional_parameters
52  ): ?int {
53  return 1;
54  }
55  };
56 
57  $table = $f->table()->data('TimeSpan Columns', $columns, $data_retrieval)
58  ->withRequest($DIC->http()->request());
59  return $r->render($table);
60 }
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: shib_login.php:25
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:18
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r