3 declare(strict_types=1);
15 $f = $DIC[
'ui.factory'];
16 $r = $DIC[
'ui.renderer'];
18 $dummy_records = [2, 13, 4, 5, 16, 17];
21 'b1' =>
$f->table()->column()->boolean(
'yes/no',
'yes',
'no'),
22 'b2' =>
$f->table()->column()->boolean(
"0/1",
"1",
"0"),
23 'b3' =>
$f->table()->column()->boolean(
25 $f->symbol()->icon()->custom(
'templates/default/images/standard/icon_checked.svg',
'',
'small'),
26 $f->symbol()->icon()->custom(
'templates/default/images/standard/icon_unchecked.svg',
'',
'small')
28 'b4' =>
$f->table()->column()->boolean(
30 $f->symbol()->glyph()->like(),
31 $f->symbol()->glyph()->dislike()->withHighlight()
36 $data_retrieval =
new class ($dummy_records) implements
I\DataRetrieval {
37 protected array $records;
42 $this->records = $dummy_records;
45 public function getRows(
46 I\DataRowBuilder $row_builder,
47 array $visible_column_ids,
51 ?array $additional_parameters
53 foreach ($this->records as $number) {
55 $record[
'b1'] = $number > 10;
56 $record[
'b2'] = $record[
'b1'];
57 $record[
'b3'] = $record[
'b1'];
58 $record[
'b4'] = $record[
'b1'];
59 yield $row_builder->buildDataRow($row_id, $record);
63 public function getTotalRowCount(
65 ?array $additional_parameters
67 return count($this->records);
71 $table =
$f->table()->data(
'Boolean Columns', $columns, $data_retrieval)
72 ->withRequest($DIC->http()->request());
73 return $r->render($table);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Both the subject and the direction need to be specified when expressing an order. ...
__construct()
Constructor setup ILIAS global object public.
A simple class to express a range of whole positive numbers.