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