ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 ?array $filter_data,
61 ?array $additional_parameters
62 ): \Generator {
63 foreach ($this->records as $number) {
64 $row_id = '';
65 $record['i1'] = $this->ui_factory->symbol()->icon()->standard('crs', '', 'small');
66 $record['i2'] = $this->ui_factory->symbol()->icon()->custom(
67 'assets/images/standard/icon_checked.svg',
68 '',
69 'small'
70 );
71 yield $row_builder->buildDataRow($row_id, $record);
72 }
73 }
74
75 public function getTotalRowCount(
76 ?array $filter_data,
77 ?array $additional_parameters
78 ): ?int {
79 return count($this->records);
80 }
81 };
82
83 $table = $f->table()->data($data_retrieval, 'StatusIcons Columns', $columns)
84 ->withRequest($DIC->http()->request());
85 return $r->render($table);
86}
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.
global $DIC
Definition: shib_login.php:26