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  $dummy_records = [23, 45, 67];
25 
26  $columns = [
27  'i1' => $f->table()->column()->statusIcon("icon"),
28  'i2' => $f->table()->column()->statusIcon("check")
29  ];
30 
31  $data_retrieval = new class ($f, $r, $dummy_records) implements I\DataRetrieval {
32  public function __construct(
33  protected \ILIAS\UI\Factory $ui_factory,
34  protected \ILIAS\UI\Renderer $ui_renderer,
35  protected array $records
36  ) {
37  }
38 
39  public function getRows(
40  I\DataRowBuilder $row_builder,
41  array $visible_column_ids,
42  Range $range,
43  Order $order,
44  ?array $filter_data,
45  ?array $additional_parameters
46  ): \Generator {
47  foreach ($this->records as $number) {
48  $row_id = '';
49  $record['i1'] = $this->ui_factory->symbol()->icon()->standard('crs', '', 'small');
50  $record['i2'] = $this->ui_factory->symbol()->icon()->custom(
51  'assets/images/standard/icon_checked.svg',
52  '',
53  'small'
54  );
55  yield $row_builder->buildDataRow($row_id, $record);
56  }
57  }
58 
59  public function getTotalRowCount(
60  ?array $filter_data,
61  ?array $additional_parameters
62  ): ?int {
63  return count($this->records);
64  }
65  };
66 
67  $table = $f->table()->data('StatusIcons Columns', $columns, $data_retrieval)
68  ->withRequest($DIC->http()->request());
69  return $r->render($table);
70 }
Interface Observer Contains several chained tasks and infos about them.
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
This is how the factory for UI elements looks.
Definition: Factory.php:37
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
global $DIC
Definition: shib_login.php:25
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r