ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
base.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
10 
11 function base(): string
12 {
13  global $DIC;
14  $f = $DIC->ui()->factory();
15  $r = $DIC->ui()->renderer();
16 
17  $columns = [
18  'l1' => $f->table()->column()->linkListing("a link list column")
19  ];
20 
21  $some_link = $f->link()->standard('ILIAS Homepage', 'http://www.ilias.de');
22  $some_linklisting = $f->listing()->unordered([$some_link, $some_link, $some_link]);
23 
24  $dummy_records = [
25  ['l1' => $some_linklisting],
26  ['l1' => $some_linklisting]
27  ];
28 
29  $data_retrieval = new class ($dummy_records) implements I\DataRetrieval {
30  protected array $records;
31 
32  public function __construct(array $dummy_records)
33  {
34  $this->records = $dummy_records;
35  }
36 
37  public function getRows(
38  I\DataRowBuilder $row_builder,
39  array $visible_column_ids,
40  Range $range,
41  Order $order,
42  ?array $filter_data,
43  ?array $additional_parameters
44  ): \Generator {
45  foreach ($this->records as $idx => $record) {
46  $row_id = '';
47  yield $row_builder->buildDataRow($row_id, $record);
48  }
49  }
50 
51  public function getTotalRowCount(
52  ?array $filter_data,
53  ?array $additional_parameters
54  ): ?int {
55  return count($this->records);
56  }
57  };
58 
59  $table = $f->table()->data('Link List Columns', $columns, $data_retrieval)
60  ->withRequest($DIC->http()->request());
61  return $r->render($table);
62 }
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. ...
Definition: Order.php:12
global $DIC
Definition: feed.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:62
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
A simple class to express a range of whole positive numbers.
Definition: Range.php:30