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 
24  $columns = [
25  't1' => $f->table()->column()->status("status")
26  ];
27 
28  $data_retrieval = new class () implements I\DataRetrieval {
29  protected array $records = [
30  ['t1' => 'unknown'],
31  ['t1' => 'incomplete'],
32  ['t1' => 'failed'],
33  ['t1' => 'passed'],
34  ['t1' => 'completed']
35  ];
36 
37  public function getRows(
38  I\DataRowBuilder $row_builder,
39  array $visible_column_ids,
40  Range $range,
41  Order $order,
42  ?array $filter_data,
43  ?array $additional_parameters
44  ): \Generator {
45  foreach ($this->records as $idx => $record) {
46  $row_id = '';
47  yield $row_builder->buildDataRow($row_id, $record);
48  }
49  }
50 
51  public function getTotalRowCount(
52  ?array $filter_data,
53  ?array $additional_parameters
54  ): ?int {
55  return count($this->records);
56  }
57  };
58 
59  $table = $f->table()->data('Status Columns', $columns, $data_retrieval)
60  ->withRequest($DIC->http()->request());
61  return $r->render($table);
62 }
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:18
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
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r