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
26
33function base(): string
34{
35 global $DIC;
36 $f = $DIC->ui()->factory();
37 $r = $DIC->ui()->renderer();
38
39 $columns = [
40 'l1' => $f->table()->column()->linkListing("a link list column")
41 ];
42
43 $some_link = $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de');
44 $some_linklisting = $f->listing()->unordered([$some_link, $some_link, $some_link]);
45
46 $dummy_records = [
47 ['l1' => $some_linklisting],
48 ['l1' => $some_linklisting]
49 ];
50
51 $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
52 protected array $records;
53
54 public function __construct(array $dummy_records)
55 {
56 $this->records = $dummy_records;
57 }
58
59 public function getRows(
60 I\DataRowBuilder $row_builder,
61 array $visible_column_ids,
63 Order $order,
64 mixed $additional_viewcontrol_data,
65 mixed $filter_data,
66 mixed $additional_parameters
67 ): \Generator {
68 foreach ($this->records as $idx => $record) {
69 $row_id = '';
70 yield $row_builder->buildDataRow($row_id, $record);
71 }
72 }
73
74 public function getTotalRowCount(
75 mixed $additional_viewcontrol_data,
76 mixed $filter_data,
77 mixed $additional_parameters
78 ): ?int {
79 return count($this->records);
80 }
81 };
82
83 $table = $f->table()->data($data_retrieval, 'Link List Columns', $columns)
84 ->withRequest($DIC->http()->request());
85 return $r->render($table);
86}
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
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76