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 
18  $dummy_records = [23, 45, 67];
19 
20  $columns = [
21  'i1' => $f->table()->column()->statusIcon("icon"),
22  'i2' => $f->table()->column()->statusIcon("check")
23  ];
24 
25  $data_retrieval = new class ($f, $r, $dummy_records) implements I\DataRetrieval {
26  public function __construct(
27  protected \ILIAS\UI\Factory $ui_factory,
28  protected \ILIAS\UI\Renderer $ui_renderer,
29  protected array $records
30  ) {
31  }
32 
33  public function getRows(
34  I\DataRowBuilder $row_builder,
35  array $visible_column_ids,
36  Range $range,
37  Order $order,
38  ?array $filter_data,
39  ?array $additional_parameters
40  ): \Generator {
41  foreach ($this->records as $number) {
42  $row_id = '';
43  $record['i1'] = $this->ui_factory->symbol()->icon()->standard('crs', '', 'small');
44  $record['i2'] = $this->ui_factory->symbol()->icon()->custom(
45  'templates/default/images/standard/icon_checked.svg',
46  '',
47  'small'
48  );
49  yield $row_builder->buildDataRow($row_id, $record);
50  }
51  }
52 
53  public function getTotalRowCount(
54  ?array $filter_data,
55  ?array $additional_parameters
56  ): ?int {
57  return count($this->records);
58  }
59  };
60 
61  $table = $f->table()->data('StatusIcons Columns', $columns, $data_retrieval)
62  ->withRequest($DIC->http()->request());
63  return $r->render($table);
64 }
An entity that renders components to a string output.
Definition: Renderer.php:30
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:12
global $DIC
Definition: feed.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:62
A simple class to express a range of whole positive numbers.
Definition: Range.php:30
$r