ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
disabled.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
10 
21 function disabled()
22 {
23  global $DIC;
24 
28  $f = $DIC['ui.factory'];
29 
33  $r = $DIC['ui.renderer'];
34 
35  $request = $DIC->http()->request();
36 
37  $columns = [
38  'id' => $f->table()->column()->number("ID"),
39  'letter' => $f->table()->column()->text("Letter")
40  ->withHighlight(true)
41  ];
42 
43  $data_retrieval = new class ($f, $r) implements I\OrderingBinding {
44  protected array $records;
45 
46  public function __construct(
47  protected \ILIAS\UI\Factory $ui_factory,
48  protected \ILIAS\UI\Renderer $ui_renderer
49  ) {
50  $this->records = $this->initRecords();
51  }
52 
53  public function getRows(
54  I\OrderingRowBuilder $row_builder,
55  array $visible_column_ids
56  ): \Generator {
57  foreach (array_values($this->records) as $record) {
58  yield $row_builder->buildOrderingRow((string) $record['id'], $record);
59  }
60  }
61 
62  protected function initRecords(): array
63  {
64  $r = range(65, 68);
65  shuffle($r);
66  return array_map(fn($id) => ['id' => $id,'letter' => chr($id)], $r);
67  }
68  };
69 
73  $target = (new URI((string) $request->getUri()));
74  $table = $f->table()->ordering('ordering table with disabled ordering', $columns, $data_retrieval, $target)
75  ->withOrderingDisabled(true)
76  ->withRequest($request);
77 
78  return $r->render($table);
79 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
global $DIC
Definition: feed.php:28
__construct()
Constructor setup ILIAS global object public.
Definition: class.ilias.php:62
disabled()
This example shows how to create and render a disabled URL input field and attach it to a form...
Definition: disabled.php:11
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r