ILIAS  trunk Revision v11.0_alpha-1744-gb0451eebef4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 
34 function 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,
58  Range $range,
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 }
Interface Observer Contains several chained tasks and infos about them.
base()
expected output: > ILIAS shows the rendered Component.
Definition: base.php:34
Both the subject and the direction need to be specified when expressing an order. ...
Definition: Order.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:76
global $DIC
Definition: shib_login.php:22
A simple class to express a naive range of whole positive numbers.
Definition: Range.php:28
$r