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
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 ?array $filter_data,
65 ?array $additional_parameters
66 ): \Generator {
67 foreach ($this->records as $idx => $record) {
68 $row_id = '';
69 yield $row_builder->buildDataRow($row_id, $record);
70 }
71 }
72
73 public function getTotalRowCount(
74 ?array $filter_data,
75 ?array $additional_parameters
76 ): ?int {
77 return count($this->records);
78 }
79 };
80
81 $table = $f->table()->data($data_retrieval, 'Link List Columns', $columns)
82 ->withRequest($DIC->http()->request());
83 return $r->render($table);
84}
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
global $DIC
Definition: shib_login.php:26