ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
11 
12 function base()
13 {
14  global $DIC;
15  $f = $DIC['ui.factory'];
16  $r = $DIC['ui.renderer'];
17  $df = new \ILIAS\Data\Factory();
18  $current_user = $DIC['ilUser'];
19 
20  $columns = [
21  'd1' => $f->table()->column()->date("German Long", $df->dateFormat()->germanLong()),
22  'd2' => $f->table()->column()->date("Time Only", $df->dateFormat()->custom()->hours24()->colon()->minutes()->get()),
23  'd3' => $f->table()->column()->date("User Preference", $current_user->getDateFormat()),
24  ];
25 
26  $data_retrieval = new class () implements I\DataRetrieval {
27  public function getRows(
28  I\DataRowBuilder $row_builder,
29  array $visible_column_ids,
30  Range $range,
31  Order $order,
32  ?array $filter_data,
33  ?array $additional_parameters
34  ): \Generator {
35  $row_id = '';
36  $dat = new \DateTimeImmutable();
37  $record = [
38  'd1' => $dat,
39  'd2' => $dat,
40  'd3' => $dat
41  ];
42  yield $row_builder->buildDataRow($row_id, $record);
43  }
44 
45  public function getTotalRowCount(
46  ?array $filter_data,
47  ?array $additional_parameters
48  ): ?int {
49  return 1;
50  }
51  };
52 
53  $table = $f->table()->data('Date Columns', $columns, $data_retrieval)
54  ->withRequest($DIC->http()->request());
55  return $r->render($table);
56 }
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. ...
Definition: Order.php:12
global $DIC
Definition: feed.php:28
A simple class to express a range of whole positive numbers.
Definition: Range.php:30
$r