ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
base.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27
34function base()
35{
36 global $DIC;
37 $f = $DIC['ui.factory'];
38 $r = $DIC['ui.renderer'];
39
40 $dummy_records = [23, 45, 67];
41
42 $columns = [
43 'i1' => $f->table()->column()->statusIcon("icon"),
44 'i2' => $f->table()->column()->statusIcon("check")
45 ];
46
47 $data_retrieval = new class ($f, $r, $dummy_records) implements I\DataRetrieval {
48 public function __construct(
49 protected \ILIAS\UI\Factory $ui_factory,
50 protected \ILIAS\UI\Renderer $ui_renderer,
51 protected array $records
52 ) {
53 }
54
55 public function getRows(
56 I\DataRowBuilder $row_builder,
57 array $visible_column_ids,
59 Order $order,
60 mixed $additional_viewcontrol_data,
61 mixed $filter_data,
62 mixed $additional_parameters
63 ): \Generator {
64 foreach ($this->records as $number) {
65 $row_id = '';
66 $record['i1'] = $this->ui_factory->symbol()->icon()->standard('crs', '', 'small');
67 $record['i2'] = $this->ui_factory->symbol()->icon()->custom(
68 'assets/images/standard/icon_checked.svg',
69 '',
70 'small'
71 );
72 yield $row_builder->buildDataRow($row_id, $record);
73 }
74 }
75
76 public function getTotalRowCount(
77 mixed $additional_viewcontrol_data,
78 mixed $filter_data,
79 mixed $additional_parameters
80 ): ?int {
81 return count($this->records);
82 }
83 };
84
85 $table = $f->table()->data($data_retrieval, 'StatusIcons Columns', $columns)
86 ->withRequest($DIC->http()->request());
87 return $r->render($table);
88}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:29
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:29
Definition: UI.php:24
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
An entity that renders components to a string output.
Definition: Renderer.php:31
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.