ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
disabled.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
37function disabled()
38{
39 global $DIC;
40
44 $f = $DIC['ui.factory'];
45
49 $r = $DIC['ui.renderer'];
50
51 $request = $DIC->http()->request();
52
53 $columns = [
54 'id' => $f->table()->column()->number("ID"),
55 'letter' => $f->table()->column()->text("Letter")
56 ->withHighlight(true)
57 ];
58
59 $data_retrieval = new class ($f, $r) implements I\OrderingRetrieval {
60 protected array $records;
61
62 public function __construct(
63 protected \ILIAS\UI\Factory $ui_factory,
64 protected \ILIAS\UI\Renderer $ui_renderer
65 ) {
66 $this->records = $this->initRecords();
67 }
68
69 public function getRows(
70 I\OrderingRowBuilder $row_builder,
71 array $visible_column_ids
72 ): \Generator {
73 foreach (array_values($this->records) as $record) {
74 yield $row_builder->buildOrderingRow((string) $record['id'], $record);
75 }
76 }
77
78 protected function initRecords(): array
79 {
80 $r = range(65, 68);
81 shuffle($r);
82 return array_map(fn($id) => ['id' => $id,'letter' => chr($id)], $r);
83 }
84 };
85
89 $target = (new URI((string) $request->getUri()));
90 $table = $f->table()->ordering($data_retrieval, $target, 'ordering table with disabled ordering', $columns)
91 ->withOrderingDisabled(true)
92 ->withRequest($request);
93
94 return $r->render($table);
95}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:35
__construct()
Constructor setup ILIAS global object @access public.
Definition: class.ilias.php:76
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26